In fact I just redefined the GMarker.initialize and GMarker.remove functions to store/null the map value and then call the original prototype. (I did it there because I also redefined the GMarker function itself to set the initial value of the map to null.)
To answer your question of "why?" - I assume the API must already store the map variable internally, so I am just using up more space - I wouldn't have to redefine the GMarker overlay methods to do the handling myself. On Aug 25, 6:42 pm, Mike Williams <[email protected]> wrote: > Wasn't it Rossko who wrote: > > > > >> It would be nice to have a method for GMarker, etc. that would return > >> the underlying map (or null if the overlay has not been placed on a > >> map yet). > > >But why? If an overlay is on a map, you put it there, you know you > >did it, and only need to remember that. > >You might use a custom property to do that, something like > > marker = new Gmarker(....) ; > > mymap.addOverlay(marker) ; > > marker.parentMap = whatever ; > > Or even > > GMap.prototype.myAddOverlay(overlay) { > this.addOverlay(overlay); > overlay.ParentMap = this; > } > > GMap.prototype.myRemoveOverlay(overlay) { > this.removeOverlay(overlay); > overlay.ParentMap = null; > } > > -- > Mike Williamshttp://econym.org.uk/gmap --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
