[OpenLayers-Trac] Re: [OpenLayers] #3389: Vector.getFeatureBy returns nothing, while firebug shows the data

OpenLayers trac-20090302 at openlayers.org
Tue Jun 28 08:28:06 EDT 2011


#3389: Vector.getFeatureBy returns nothing, while firebug shows the data
----------------------+-----------------------------------------------------
  Reporter:  cspan    |       Owner:              
      Type:  bug      |      Status:  closed      
  Priority:  minor    |   Milestone:  2.12 Release
 Component:  general  |     Version:  2.10        
Resolution:  invalid  |    Keywords:              
     State:           |  
----------------------+-----------------------------------------------------
Changes (by bartvde):

  * status:  new => closed
  * resolution:  => invalid


Comment:

 Casper, I see now what is wrong. That function is meant to search for
 features using a property, not an attribute. A property and an attribute
 are different, e.g. fid is a property of a Feature.

 What you need to use is getFeaturesByAttribute. It will give you an array
 with features.

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


More information about the Trac mailing list