InfoWindow Google Maps is displayed not above the marker, but aside, and with the contents of the latter.

... add markers to the map from the array:

 for (var i = 0; i < objects.length; i++) { var ll = objects[i].coordinates.split(','); var latlng = new google.maps.LatLng(ll[0], ll[1]); var address = []; address = objects[i].address; if (distHaversine(latlng, circleOptions.center) < radius) { infowindow = new google.maps.InfoWindow({ content: address }); objects_markers[i] = new google.maps.Marker({ position:latlng, clickable:true, map: map, title: address, animation: google.maps.Animation.DROP, visible: true, icon: 'images/beachflag.png' }); objects_markers[i].addListener('click', function() { infowindow.open(map, objects_markers[i]); }); } 

Tell me, please, what's the problem?

    1 answer 1

    Instead:

    objects_markers[i].addListener('click', function() { infowindow.open(map, objects_markers[i]); });

    Replaced by:

    setInfoWindowHandlers(i);

    And add a function: function setInfoWindowHandlers(i) { objects_markers[i].addListener('click', function() { console.log(i); infowindow[i].open(map, objects_markers[i]); }); } function setInfoWindowHandlers(i) { objects_markers[i].addListener('click', function() { console.log(i); infowindow[i].open(map, objects_markers[i]); }); }