I am looking for documentation links on how to extend google maps classes such as google.maps.Marker. I did find a very helpful link at http://www.googlemapsbook.com/2007/01/22/extending-gmarker/. However that is for api v2 and I am using api V3. I also looked at google’s documentation to extend OverlayTypes here (http://code.google.com/apis/maps/documentation/javascript/overlays.html#CustomOverlays) however, that does not apply to Marker which is an MvcObject. I also read and understood that for most practical requirements, we wont need to extend the Marker class. It has a very useful interface with which you can do almost everything you need. However, my app is now becoming complex and I would love to encapsulate some of my custom features in a custom marker class that extends Google’s marker. Is that even possible or am I dreaming?
Thank you folks!
google.maps.Markeris an object.You don’t need a special interface to extend objects, you may extend the prototype of google.maps.Marker.
Sample:
http://jsfiddle.net/doktormolle/KgTF5/