[OpenLayers-Users] Problem finding feature in vector layer with getFeatureByFid()

Paul Holthues einpaule at gmail.com
Wed Mar 23 15:27:58 EDT 2011


Hi everyone,

I have a layer which has the following (relevant) structure (which I
read out with Chrome):

EVENT_TYPES: Array[25]
alwaysInRange: true
div: HTMLDivElement
drawn: true
eventListeners: Object
events: Class
features: Array[1]
    0: Class
    _lastHighlighter: undefined
    attributes: Object
    data: Object
    description: "my description"
    fid: "[my Personal Fid]"
...


If I call:

feature = layer.getFeatureByFid("[my Personal Fid]");

feature is null. Am I using the getFeatureByFid wrong?

Maybe the error lies in how I create the feature and set it's fid:


var myFeature = new OpenLayers.Feature.Vector(
    geometryCollection,
    {
        "fid": datastore.getValue(item,"events.ID"),
        "description": "my description"
    });


Thanks for any hints and please ask for further information if needed!

Paul


More information about the Users mailing list