GoogleMaps multiple map directions and PAN
I have built a directions list for users to print.
The problem is that there is a pan function that zooms each direction into turn in question. Every attempt to make this function trigger automatically has failed and at the moment there is a button marked test by each direction that开发者_Go百科 shows were it is on the map. Directions are loaded in using a PHP XML Feed.
Example.
This is the pan function
function tito(colat, colong, section) {
section.panTo(new google.maps.LatLng(colat, colong));
section.setZoom(14);
}
I think it may be that the function is triggered to early, so I tried timeout functions to no avail. Can anyone see the problem?
I think the call:
tito("53.3269400", "-1.5168300", "map4")
should instead be:
tito("53.3269400", "-1.5168300", map4)
Your function expects the third argument to be the map object but you are passing it a string.
精彩评论