GUnload () for one google map

I have Javascript / HTML code that displays a variable number of maps depending on what the user selects.

I worked on how to dynamically create multiple maps on a page that are well-documented.

However, I'm not sure if this is ... how can I safely destroy a map after creating it? Usually I just leave this to GUnload () for sorting.

Thanks for any help!

+4
source share
1 answer

Unfortunately, the Google Maps API has not yet provided a documented method for the separate map's GUnload() .

There is open Issue No. 772 for this feature in the Google Maps API Issue Tracker. On May 24, 2009, it was marked as β€œConfirmed,” but it remains open to this day.

In the first comment on this issue, a member of the Google Maps team confirmed that a possible β€œpartial” workaround at the moment is to call

 map_to_delete.clearOverlays(); GEvent.clearInstanceListeners(map_to_delete); 
+4
source

All Articles