Wasn't it Mike Williams who wrote:
>
>Each GDirections() instance clears up its own information, but if you
>create a *new* GDirections instance for each route they don't clear the
>information created by previous GDirections() instances.
>
>You currently create a new GDirections() instance and create a new map
>each time getDir() is called.
>
>For the GDirections, simply move your
> var directions;
>line outside your function declarations to make it global.
On further consideration, that won't work.
The GDirections will end up being associated with only one of your maps,
so when you create a new map, the old GDirections won't work.
The efficient solution would be to only have one map. Instead of
creating a new map every time, you would simply recentre the existing
map and hide any overlays that you don't currently need.
Alternatively, you could have two maps (give them different names for
both the div "id" and the Javascript variable) and switch between them.
Remember to use the {size} option when creating the map in a div that's
not currently displayed.
--
http://econym.org.uk/gmap
The Blackpool Community Church Javascript Team
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---