Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
- <title>Google Maps JavaScript API Example</title>
- <script src="http://maps.google.com/maps?file=api&v=2&sensor=true_or_false&key=ABQIAAAAXZV-zRxFr6EJ2d1v0lUK7RSjspX_WPlEeEONGeyst2upYYHfZRRSc773EaSN0vuMID_nnylSrb7BOg" type="text/javascript"></script>
- <script type="text/javascript">
- function initialize() {
- var map = new GMap2(document.getElementById("map_canvas"));
- map.setCenter(new GLatLng(5.558560 ,-0.200924), 13);
- // map.openInfoWindow(map.getCenter(), document.createTextNode("My world of Testing"));
- /*
- // Create our "cafe" marker icon
- var cafeIcon = new GIcon();
- cafeIcon.image = "http://chart.apis.google.com/chart?chst=d_map_pin_icon&chld=cafe|996600";
- cafeIcon.shadow = "http://chart.apis.google.com/chart?chst=d_map_pin_shadow";
- cafeIcon.iconSize = new GSize(12, 20);
- cafeIcon.shadowSize = new GSize(22, 20);
- cafeIcon.iconAnchor = new GPoint(6, 20);
- cafeIcon.infoWindowAnchor = new GPoint(5, 1);
- // Set up our GMarkerOptions object literal
- markerOptions = { icon:cafeIcon };
- // Add 10 markers to the map at random locations
- var bounds = map.getBounds();
- var southWest = bounds.getSouthWest();
- var northEast = bounds.getNorthEast();
- var lngSpan = northEast.lng() - southWest.lng();
- var latSpan = northEast.lat() - southWest.lat();
- for (var i = 0; i < 10; i++) {
- var point = new GLatLng(southWest.lat() + latSpan * Math.random(),
- southWest.lng() + lngSpan * Math.random());
- map.addOverlay(new GMarker(point));
- }
- */
- function createMarker(point, number) {
- var marker = new GMarker(point);
- var message = ["<div style='width:300px; height:120px;'><img src='footer_logo.gif' style='float:left; margin-right:5px; font-family:verdana; font-size:11px;'> 9tribe Websolution is launching <br>it operation fully this month. Launch Launch Launch. <a href='http://gidmakus.wordpress.com'>Gidmakus Wordpress</a></div>","is","the","secret","message"];
- marker.value = number;
- GEvent.addListener(marker, "click", function() {
- var myHtml = message[number -1];
- // var myHtml = "<b>#" + number + "</b><br/>" + message[number -1];
- map.openInfoWindowHtml(point, myHtml);
- });
- return marker;
- }
- // Add 5 markers to the map at random locations
- var bounds = map.getBounds();
- var southWest = bounds.getSouthWest();
- var northEast = bounds.getNorthEast();
- var lngSpan = northEast.lng() - southWest.lng();
- var latSpan = northEast.lat() - southWest.lat();
- for (var i = 0; i < 5; i++) {
- var point = new GLatLng(southWest.lat() + latSpan * Math.random(),
- southWest.lng() + lngSpan * Math.random());
- map.addOverlay(createMarker(point, i + 1));
- }
- }
- </script>
- </head>
- <body onload="initialize()" onunload="GUnload()">
- <div id="map_canvas" style="width:500px; height:300px; font-family:tahoma; font-size:12px; line-height:20px;"></div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement