Here I am using Google map API to show Google map in my site. Here I am able to add google map statically by following code:
var map = new GMap2(document.getElementById('map'));
map.addControl(new GSmallMapControl());
map.setCenter(new GLatLng(21.183008, 81.36186199999997), 6);
var marker = new GMarker(new GLatLng(21.183008, 81.36186199999997), {});
GEvent.addListener(marker, "mouseover", function () {
marker.openInfoWindow("Hi ");
});
GEvent.addListener(marker, "mouseout", function () {
map.closeInfoWindow();
});
map.addOverlay(marker);
var marker1 = new GMarker(new GLatLng(21.25, 81.62), {});
GEvent.addListener(marker1, "mouseover", function () {
marker1.openInfoWindow("HI All");
});
GEvent.addListener(marker1, "mouseout", function () {
map.closeInfoWindow();
});
map.addOverlay(marker1);
I have set of marker value in array. When I try it to create dynamically only last information window displayed.
awaiting for response....