[OpenLayers-Users] extent has no properties

Bas Couwenberg bascouwenberg at gmail.com
Wed Sep 24 10:50:01 EDT 2008


Hello,

I made a custom control in a separate *.js file which I want to use on
my WMS layer to select a point there and with a WFS GetFeature request
retrieve the geometry. The top part of the class looks as followed:

------------------
 Select = OpenLayers.Class(OpenLayers.Control, {

     layer: null,

        defaultHandlerOptions: {
            'single': true,
            'double': false,
            'pixelTolerance': 0,
            'stopSingle': false,
            'stopDouble': false
        },
        initialize: function(layer,options) {
         this.layer = layer;
            this.handlerOptions = OpenLayers.Util.extend(
                {}, this.defaultHandlerOptions
            );
            OpenLayers.Control.prototype.initialize.apply(
                this, arguments
            );
            this.handler = new OpenLayers.Handler.Click(
                this, {
                    'click': this.trigger
                }, this.handlerOptions
            );
        },

------------------------
When I user the 'layer' parameter :  *

var* selectCcontrol = *new* Select(wozSelectLayer, {'displayClass':
'olControlSelectFeature'}) ;
I get the error: extent has no properties
 this.extent = extent.clone();
Renderer.js (line 98)
I need the layer in this class and without it the eror doesn't occur. What
am I doing wrong?

Best regards,

Bas Couwenberg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20080924/a0480b7b/attachment.html


More information about the Users mailing list