Google map api usually will has function for set map all right??
function initialize()
{
if (GBrowserIsCompatible())
{
var map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(12.340001834116316, 101.337890625), 5);
}
}
this function will use in body onload="initialize()" for Set map
the problem is in case that i have other fuction for use after click
some button
ex
function showAllmarker()
{
var map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(12.340001834116316, 101.337890625), 5);
map.setMapType(G_HYBRID_MAP);
map.addOverlay(createMarker());
}
you will see function showAllmarker will need indicator for map ( div
which id="map")
but "var map = new GMap2(document.getElementById("map"));"
it will clear all state of map. T T , i just want to add some marker
in it
it can't use below syntax.
function showAllmarker()
{
var map = document.getElementById("map");
map.addOverlay(createMarker());
}
Does anyone have any advice on this?
Nampol L.
Thailand
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---