[OpenLayers-Trac] [OpenLayers] #3237: Issue with filter params in Protocol/HTTP.js

OpenLayers trac-20090302 at openlayers.org
Fri Apr 1 11:57:23 EDT 2011


#3237: Issue with filter params in Protocol/HTTP.js
----------------------------------+-----------------------------------------
 Reporter:  etdube                |       Owner:              
     Type:  feature               |      Status:  new         
 Priority:  minor                 |   Milestone:  2.11 Release
Component:  Protocol.HTTP         |     Version:  SVN         
 Keywords:  filter http protocol  |       State:              
----------------------------------+-----------------------------------------
 I noticed a minor issue in Protocol/HTTP.js in the trunk. In the read()
 method, options is set using applyDefaults(), which does a shallow copy
 and assigns this.options.params to options. This effectively means that
 this.options.params and options.params are the same object, and its
 attributes are persisted from a call to read() to another. It can cause
 problems when the layer's filter changes between two calls, since params
 will contain the query string attributes from a previous filter (e.g.
 color__eq:"blue" and queryable:["color"]), even if these are not in the
 new filter anymore.

 Assigning an empty object to options.params after the
 applyDefaults(options, this.options) call solves the issue (see attached
 patch).

-- 
Ticket URL: <http://trac.openlayers.org/ticket/3237>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list