Try this:
function GCircle(){
// this is the constructor
}
GCircle.prototype=new GPolyline();
GCircle.prototype.newMethod=function(){
// define a new method here
};
Martin.
On 19 Oct, 05:42, john_ca <[email protected]> wrote:
> This is related to my previous post, but is a separate topic.
> I'm drawing a circle on map and for that I use Gpolygon and calculate
> vertices manually.
> Circle is a polygon, so it's logical to make circle descendant of
> GPolygon. How is that supposed to be done in Javascript? There's
> multiple discussions on the web on how to do that properly but nothing
> like that works with gmaps API. Basically,
> var circle = new GPolyCircle(...);
> should work fine and have the same methods as GPolygon has.
>
> I tried different methods of inheritance proposed by different people
> here:http://www.sitepoint.com/blogs/2006/01/17/javascript-inheritance/
> Nothing seems to work, therefore I'm asking: what's the official way
> to extend gmaps objects?
>
> Thank you
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---