Take a look at how Mike Williams has extended the GPolygon() and GPolyline() objects with his EPoly extension:
http://econym.org.uk/gmap/epoly.htm You could take a similar approach and create new prototype methods of GPolygon() where required. Or look at his ELabel extension: http://econym.org.uk/gmap/elabel.htm ELabel is a custom GOverlay() and as GPolygons and GPolylines are GOverlays too you might find looking at the ELabel source code will help you create the 'initialize()' method for your GCircle(). Also look at the other prototype methods of ELabel - you'll be able to see what (other) new prototype methods you must define for GCircle(). ('supportsHide' looks like is required for example). HTH. Martin. On 19 Oct, 08:38, pps <[email protected]> wrote: > Martin wrote: > > Try this: > > > function GCircle(){ > > // this is the constructor > > } > > > GCircle.prototype=new GPolyline(); > > > GCircle.prototype.newMethod=function(){ > > // define a new method here > > }; > > Obviously that's one of the first methods that I tried. Doesn't work. > The errors are completely unreadable and impossible to deal with. It > happens in some fh(...) function within some eval(...), basically you > get the idea: the error is in the middle of nowhere. In other cases it > complains that initialize is undefined or something else. At the end I > actually solved my problem in way that nobody proposes to extend objects > like that. But I'd like to see if any google developers can say about > extending their objects and how it should be done in their framework > properly. > (Actually I didn't try GPolyline, I tried GPolygon since I'm talking > about Circles/Polygons here) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
