Wow!!!!!!!!!!!!!!What a stupid mistake :-D :-D Now it works perfectly!thank you so much Andrew and Rossko! Last question,can i zoom over a region by clicking on a checkbox?Can i change this map.setCenter(new GLatLng(42.2, 12.4), 6); by a function call?
On 6 Gen, 11:10, Andrew Leach <[email protected]> wrote: > On Jan 6, 12:11 am, Darko1984 <[email protected]> wrote: > > > No,it doesn't work :-( > > This is the my map > > pagehttp://meteocecchina.altervista.org/script/gmapdbv2.php > > There's no map listener in that page, so I can't see where you were > adding it. > > However, the issue is this: > > if (GBrowserIsCompatible()) { > var map = new GMap2(document.getElementById("map")); > > which should be > > if (GBrowserIsCompatible()) { > map = new GMap2(document.getElementById("map")); > > To get that to work, you need to declare "map" as a global variable, > probably here: > > var gmarkers = []; > var map; > > That will mean that the reference to your map persists after the > function load() has completed, and you can add and trigger listeners > on it. -- You received this message because you are subscribed to the Google Groups "Google Maps API V2" 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.
