Thanks for Mike Williams and Marcelo.
I write Gpolygon.copy() and it work now.
Function code is like this:
    //copy of polygon by constructor
    GPolygon.prototype.copy = function(){
        var points = [];
        var pointsCount = this.getVertexCount();
        var polyline = this.l[0];   //outline of polygon
        for (var i = 0; i < pointsCount; i++) {points.push
(this.getVertex(i));}
        return new GPolygon(points, polyline.color, polyline.weight,
polyline.opacity, this.color, this.opacity);
    }

look at this page:
http://simonepoint.googlepages.com/FixPolygonCopyBug.htm

though it is easy to do, I think many people need it support .copy
rather than write it by themself .
As it is easy to implement gplygon.copy, why not add it to APIs?

BTW, an **abstract method** of the parent class must be implemented by
subclass.
Is Gpolygon a subclass or an object prototyped from Goverlay ?  If it
is , I think it has implemented .copy() already.
Forgive my honesty, my opinion is that Gpolygon has  implemented .copy
() but it has some bugs.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to