Google Maps - Multiple markers - 1 InfoWindow problem?

Right I found a solution. I added an extra property to the marker called 'info' and then referenced it from the 'addlistener' event 'infowindow. SetContent(this.Info) Here is the updated code: function setMarkers(branches, map) { var marker = null; var infowindow = new google.maps.InfoWindow(); var bounds = new google.maps.LatLngBounds(); for (var I = 0; I ' }); google.maps.event.

AddListener(marker, 'click', function () { infowindow. SetContent(this.Info); infowindow. Open(map, this); }); bounds.

Extend(myLatlngMarker); } map. FitBounds(bounds); }.

Right, I found a solution. I added an extra property to the marker called 'info' and then referenced it from the 'addlistener' event 'infowindow. SetContent(this.Info)'.

Here is the updated code: function setMarkers(branches, map) { var marker = null; var infowindow = new google.maps.InfoWindow(); var bounds = new google.maps.LatLngBounds(); for (var I = 0; I ' }); google.maps.event. AddListener(marker, 'click', function () { infowindow. SetContent(this.

Info); infowindow. Open(map, this); }); bounds. Extend(myLatlngMarker); } map.

FitBounds(bounds); }.

Function setMarkers(branches, map) { var bounds = new google.maps.LatLngBounds(); for (var I = 0; I ' + branch3 + ''; var marker = new google.maps. Marker({ position: myLatlngMarker, map: map, title: branch2 }); google.maps.event. AddListener(marker, 'click', function () { infowindow.

SetContent(contentString); infowindow. Open(map, this); }); bounds. Extend(myLatlngMarker); } map.

FitBounds(bounds); }.

Yes, and it doesn't make a difference – user441365 Sep 13 at 13:43 Can you try placing the 'infowindow. SetContent(contentString);' outside the addListener? – bjornruysen Sep 13 at 13:46 it doesn't make a difference – user441365 Sep 13 at 13:48 what's in "this"?Infowindow.

Open(map, this); have you tried replacing it with marker? Just a guess though – stratton Sep 13 at 13:50 @stratton 'this' contains the marker. I have tried to replace it with 'marker' but then there is always one infowindow opening in the same marker, no matter what marker you clicked.

– user441365 Sep 13 at 13:54.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions