[OpenLayers-Trac] Re: [OpenLayers] #3446: New getFeaturesByGeometryType method

OpenLayers trac-20090302 at openlayers.org
Mon Aug 1 11:36:16 EDT 2011


#3446: New getFeaturesByGeometryType method
--------------------------+-------------------------------------------------
 Reporter:  dr            |       Owner:  crschmidt      
     Type:  feature       |      Status:  new            
 Priority:  minor         |   Milestone:  2.12 Release   
Component:  Layer.Vector  |     Version:  2.10           
 Keywords:                |       State:  Needs More Work
--------------------------+-------------------------------------------------

Comment(by tschaub):

 Wish I had weighed in on #2979.  I think if we are going to be adding
 convenience functions to the layer, they should be thought out in a bigger
 picture context.

 The proper way to accomplish this (in my opinion) would be more like:
 {{{
     layer.query(filter)
 }}}

 In the case of an attribute filter, you would write:
 {{{
     layer.query("foo = 'bar'")
 }}}

 And if we shipped with a {{{geometryType}}} filter function, you could do
 something like:
 {{{
     layer.query("geometryType(geometry) = 'Point'")
 }}}
 (This would take some special work to test {{{feature.geometry}}} when
 {{{feature.attributes.geometry}}} is not present.)

 Anyway, I agree with Eric that it is easy to iterate through
 layer.features for now.  If/when we add convenience, let's try to do it
 without a new method for each case.

-- 
Ticket URL: <http://trac.openlayers.org/ticket/3446#comment:3>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list