[OpenLayers-Dev] inheritance with Geometry

Cameron Shorter cameron.shorter at gmail.com
Tue May 8 18:13:37 EDT 2007


Chris, you are right,
I made the mistake of trusting the JSDocs which only show one Polygon 
class. There seems to be two.
http://dev.openlayers.org/docs/index.html
http://dev.openlayers.org/docs/overview-summary-Polygon.js.html

So it looks like there are some opportunities for improvement in jsdoc.

However, I still have a problem accessing  some of the Geometry 
functions from the Polygon class.
Ie, when I call polygon.calculateBounds() I get the error:
polygon.calculateBounds is not a function.

Christopher Schmidt wrote:
> On Tue, May 08, 2007 at 05:11:16PM +1000, Cameron Shorter wrote:
>   
>> I'm digging around some of the Geometry code and have discovered that 
>> OpenLayers.Geometry.Polygon inherits from OpenLayers.Handler.Polygon 
>> instead of OpenLayers.Geometry (as I'd expect).
>>     
>
> Er... huh?
>
> OpenLayers.Geometry.Polygon = OpenLayers.Class.create();
> OpenLayers.Geometry.Polygon.prototype =
>     OpenLayers.Class.inherit(OpenLayers.Geometry.Collection, {
>
> OpenLayers.Geometry.Collection = OpenLayers.Class.create();
> OpenLayers.Geometry.Collection.prototype =
>   OpenLayers.Class.inherit( OpenLayers.Geometry, {
>
> Those are from my checkout of trunk, updated a couple minutes ago... are
> you sure you're looking at the right code?
>
> Regards,
>   


-- 
Cameron Shorter
Systems Architect, http://lisasoft.com.au
Tel: +61 (0)2 8570 5050
Mob: +61 (0)419 142 254




More information about the Dev mailing list