Wrong positioning of Google Maps infoWindow -
Wrong positioning of Google Maps infoWindow -
i have website @ http://arquitectospelomundo.com displays several markers, combined markerclusterer function, display, when clicked, infowindow info. when clicking straight on map, info window appears on right spot; when clicking on sidebar (on 1 of pictures), info window goes out of bounds. working correctly , changed; trying figure out far no success. appreciate help pointing me in right direction. give thanks you.
as seems issue related markerclusterer.
when marker click has been triggered within cluster map-property of marker null , wrong position.
possible solution:
when marker within cluster utilize hidden marker(hidden via visible
) anchor infowindow:
google.maps.event.addlistener(marker, 'click', function() { //create dummy-marker on first click if(!map.get('dummy')){ map.set('dummy',new google.maps.marker({map:map,visible:false})) } var latlng = marker.getposition(); //when marker within cluster if(!marker.getmap()){ //set position of dummy map.get('dummy').setposition(latlng); //use dummy infowindow-anchor marker= map.get('dummy'); } map.panto(latlng); infowindow.setcontent(contentstring); infowindow.open(map,marker); });
google-maps infowindow
Comments
Post a Comment