Hi all,
This is not a Google Map's question per se, but probably a simply JavaScript concept I am missing. I'll describe the scenario nonetheless.
My map is loaded into:
[HTML]<div id="map"></div>[/HTML]
And constructed by calling the standard (for the Google Map API) load() function.
I want to change the location of the map when a link is clicked on the page, such as:
[HTML]<p><a href="javascrip t:void(0);" onclick="map.pa nTo(new GLatLng(1.46904 7,-3.601271));">Lo cation 1</a></p>[/HTML]
However, in this link "map" is out of context; how do I reselect it?
This is not a Google Map's question per se, but probably a simply JavaScript concept I am missing. I'll describe the scenario nonetheless.
My map is loaded into:
[HTML]<div id="map"></div>[/HTML]
And constructed by calling the standard (for the Google Map API) load() function.
Code:
function load()
{
// Check if the browser is compatiable with Google Maps
if ( GBrowserIsCompatible() )
{
// Load a new map in the DIV id="map"
var map = new GMap2(document.getElementById("map"));
// Add the map controls
map.addControl(new GMapTypeControl(1));
map.addControl(new GLargeMapControl());
map.addControl(new GScaleControl());
}
}
[HTML]<p><a href="javascrip t:void(0);" onclick="map.pa nTo(new GLatLng(1.46904 7,-3.601271));">Lo cation 1</a></p>[/HTML]
However, in this link "map" is out of context; how do I reselect it?
Comment