[OpenLayers-Dev] WFS layer - mergeNewParams

Pierre GIRAUD bluecarto at gmail.com
Tue Jun 26 04:29:01 EDT 2007


As I can see, the WFS layer does have any mergeNewParams method.

I tried to create one using something similar to the WMS.Untiled one
but I encounter some problems.


Openlayers.Layers.WFS.prototype.mergeNewParams:function(newParams) {
        var upperParams = OpenLayers.Util.upperCaseObject(newParams);
        var newArguments = [upperParams];
        OpenLayers.Layer.HTTPRequest.prototype.mergeNewParams.apply(this,
                                                                 newArguments);
        //redraw
        this.moveTo(null, true);
    }


I tried to call this when the zoom changes but in some cases the I get
a javascript error. This is due to the fact that the wfs tile may be
destroyed before the ajax resquest response is received. When the
request response is received, the requestSuccess callback is called
but some objects or properties don't exist anymore.
I think that the destroy method in Tile.WFS should also cancel the ajax request.

Any thougts about that ?


One other problem is that I would like to change the layer parameters
as soon as the zoomLevel changes. I can't find any map event that
tells that the zoom level is changing and what will be the next zoom
level before the layers are updated.

Regards

Pierre



More information about the Dev mailing list