Below code cab be used to achieve this
for (i = 0; i < lats.length; i++)
{
var myLatlng1 = new google.maps.LatLng(lats[i],longs[i]);
var marker = new google.maps.Marker({position: myLatlng1,map: map,title: 'Hello World!', icon: 'http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=A|009BEE|FFFFFF'
});
marker.id = i;
infoWindowArray[i] = new google.maps.InfoWindow({content: infoTexts[i]});
google.maps.event.addListener(marker, 'click', function() {
this.info = infoWindowArray[this.id];
this.info.open(map,this);
});
}
No comments:
Post a Comment