[OpenLayers-Dev] Advice on best way to extend a OL class.

Phil Scadden p.scadden at gns.cri.nz
Sun Nov 13 15:12:24 EST 2011


>   The "Strategy Cluster Extended" would be a good class extending 
> example :
>
> http://openlayers.org/dev/examples/strategy-cluster-extended.html 
Thanks for that. Still got a javascript issue though.

Suppose I extend linearRing with the swapXY method - call it linearRingEx.

The code calling context though is:
                             } else if (filter.type === 
OpenLayers.Filter.Spatial.INTERSECTS) {
                                 var geom = filter.value;
                                 transformGeometry(geom);
                                 geom.components[0].swapXY();
                                 params.cql_filter = 'INTERSECTS(SHAPE,' 
+ geom.toString() + ')';

To call the swapXY method, I need to somehow cast the geom object (a 
superclass) so that the linearRing descendent is of linearRingEx. I am 
struggling to see how to do this in JS.


Notice: This email and any attachments are confidential. If received in error please destroy and immediately notify us. Do not copy or disclose the contents.



More information about the Dev mailing list