I am trying to call mouseover event on markers when a user hovers over address, but that doesn’t seem to work. Open this page
type subway and click go. This is link in the address
<a onmouseover="javascript:google.maps.event.trigger(markersArray['+i+'],onmouseover);"
I am also trying to zoom the map on initializing so that all markers fit in it, but that gives me an undefined GLatLngBounds error. The code used is
function calculateCenter() {
/* var latlngbounds = new GLatLngBounds();
for (var i = 0; i < latlng.length; i++)
{
latlngbounds.extend(latlng[i]);
}
map.setCenter(latlngbounds.getCenter(), map.getBoundsZoomLevel(latlngbounds));*/
center = map.getCenter();
}
Look at the syntax for google.maps.event.trigger
This will not work:
because the event name should be a string, so:
or even better, use DHTML:
with quotation marks around the event name.
and there is another error:
var markerBounds = new GLatLngBounds();is API V2 syntax. In the V3 API it is