[OpenLayers-Users] extent has no properties

Eric Lemoine eric.c2c at gmail.com
Wed Sep 24 16:37:23 EDT 2008


Hi.

One thing I note, which I'm afraid is unrelated to your issue, is that
you should do:

OpenLayers.Control.prototype.apply(this, [options]);

Instead of:

OpenLayers.Control.prototype.apply(this, arguments);

Eric

2008/9/24, Bas Couwenberg <bascouwenberg at gmail.com>:
> 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
>



More information about the Users mailing list