By default when you click on a marker the map pans to that location.
When I click on a marker, I want the map to center on a different location (a nearby point I have calculated).
The problem is that after the map moves to the desired location, it moves again to center on the clicked marker.
I want to override this behaviour, I want the map pan to the desired location and stay there ignoring that the marker was clicked.
google.maps.event.addListener(marker, 'click', function() {
map.panTo(differentLatLng);
});
I tried adding a “return false” to the event handler, but the default handling persists.
I’ve used this while still creating a custom infoWindow via maker click listener, so this might help.
infoWindow = new google.maps.InfoWindow({disableAutoPan: true});
Eric