|
i am trying to show multiple locations its showing proper but the pop box showing same at every place
for (i = 0; i < loc1.length; i++) {
var sunloc = loc1[i].split(',');
marker = new google.maps.Marker({ position: new google.maps.LatLng(sunloc[1], sunloc[2]), map: map });
google.maps.event.addListener(marker, 'click', (function (marker, i) {
return function () {
infowindow.setContent(sunloc[0]);
infowindow.open(map, marker);
}
})(marker, i));
}
}
|
|
|
|
|
kapil sharma 49 wrote: loc1
What is the value in it?
kapil sharma 49 wrote: infowindow.setContent(sunloc[0]);
You sure that the value of sunloc[0] is not same for all?
|
|
|
|