Google Web Map example-add multiple map annotations
<script src= "PS Tutorial. google.com/maps?file=api&v=2&key=abqiaaaac8kc8qqriigpsk23kp5gkbsh2hu1_ Yr14uohynbnrsdsru1coxqaa7zqsv6wfxh6g3z1aadux7pesa ">http://maps.google.com/maps?file=api&v=2& ; Key=abqiaaaac8kc8qqriigpsk23kp5gkbsh2hu1_yr14uohynbnrsdsru1coxqaa7zqsv6wfxh6g3z1aadux7pesa "Type=" text/ JavaScript tutorial "charset=" Utf-8 ></script>n<body>
<div id= "Map" style= "width:800px; height:500px "></div><noscript><b>javascript must is enabled in the order of" for your use Google maps.< /b>
However, it seems JavaScript is either disabled or not supported by your browser.
To view Google Maps, enable JavaScript by changing your browser options, and then
Try again.
</noscript>
<script type= "Text/javascript" >
<! [cdata[
if (gbrowseriscompatible ()) {
Geocoder = new Gclientgeocoder ();
function Createmarker (point,html) {
var marker = new Gmarker (point);
Gevent.addlistener (Marker, "click", Function () {
marker.openinfowindowhtml (HTML);
});
return marker;
}
Display the map, with some controls and set the initial location
var map = new GMap2 (document.getElementById ("map"));
Map.addcontrol (New Gmaptypecontrol ());
Map.addcontrol (New Gsmallmapcontrol ());
Map.addcontrol (New Goverviewmapcontrol ());
Map.setcenter (New Glatlng ( -33.862828,151.216974), g_normal_map);
var point = new Glatlng ( -33.8619151,151.2091963);
var marker = Createmarker (point, ' Map.addoverlay (marker);
var point = new Glatlng ( -33.8683270,151.2086250);
var marker = Createmarker (point, ' Map.addoverlay (marker);
var point = new Glatlng ( -33.858362,151.214876);
var marker = Createmarker (point, ' Map.addoverlay (marker);
var point = new Glatlng ( -33.862828,151.216974);
var marker = Createmarker (point, ' Map.addoverlay (marker);
GMap.prototype.centerAndZoomOnBounds = function (bounds) {
Make 10% bigger so all markers show completely
var span = new Gsize ((Bounds.maxx-bounds.minx) * 1.1, (Bounds.maxy-bounds.miny) *1.1);
var center = new Gpoint (Bounds.minx + SPAN.WIDTH/2., Bounds.miny + SPAN.HEIGHT/2.);
var newzoom = this.spec.getLowestZoomLevel (center, span, this.viewsize);
if (This.getzoomlevel ()!= newzoom) {
This.centerandzoom (center, Newzoom);
} else {
THIS.RECENTERORPANTOLATLNG (center);
}
}
Display a warning if the browser is not compatible
} else {
Alert ("Sorry, the Google Maps API is isn't compatible with this browser");
}
]]>
</script></body>