[OpenLayers-Users] Specifying an ID when creating a vector feature

Spencer Renosis renosis at gmail.com
Wed May 30 12:37:26 PDT 2012


Hi,

I am trying to figure out how to give features I create a custom ID. For
example:

var feature_point = new OpenLayers.Feature.Vector(new
OpenLayers.Geometry.Point(-81, 26));

map.layers[1].addFeatures([feature_point]);

When I do this, I end up with an id of "OpenLayers.Feature.Vector_92" or
whatever random number it chooses. What I want to know is, how do I give
the feature, its' own custom id during creation? It would also be nice to
know if there is a way to change a features id later on, not during
creation?

-- 
Thanks,

Renosis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120530/db942492/attachment.html>


More information about the Users mailing list