yes, any ol feature have an id property, even autogenerated by ol itself. On 05/01/2011, Alexander Petkov <[email protected]> wrote: > Put a breakpoint in Firebug and inspect feature's properties. > > I see that a dynamically drawn feature in one of the examples has an > 'id' property. > > Alex > > On Tue, Jan 4, 2011 at 4:02 PM, yvecai <[email protected]> wrote: >> I'm not sure to get it. I don't see no uid nor oid properties on selected >> features. >> onSelect: function(feature) { >> $('status').innerHTML =feature.uid; >> }, >> This return 'undefined'. >> I tryied to clone my feature in onBeforeSelect with no result, the clone >> don't have no uid property either. >> >> Yves >> >> On 04. 01. 11 08:21, Diego Guidi wrote: >>> >>> Digging into source code you cansee that every feature has an unique >>> identifier called uid or oid that's used to distinguish between >>> already added features and features to be added. Try to modify uid of >>> feature to copy (maybe adding a random number) before adding to layer. >>> >>> >>> Diego Guidi >>> >>> >>> >>> On Mon, Jan 3, 2011 at 22:05, yvecai<[email protected]> wrote: >>>> >>>> Is there a way to select the very same feature several times? >>>> The default behaviour does not seem to allow a particular feature to be >>>> selected twice. >>>> I tried to push the feature in my own array at onSelect or >>>> onBeforeSelect >>>> with no result, something like: >>>> >>>> var selectCtrl = new >>>> OpenLayers.Control.SelectFeature(pistesLayer, >>>> {clickout: true, >>>> multipleKey: "shiftKey", >>>> toggleKey: "ctrlKey", >>>> mutiple: true, >>>> onBeforeSelect: function(feature) { >>>> mySelectedFeatures.push(feature); >>>> $('status').innerHTML =mySelectedFeatures.length; >>>> }, >>>> }); >>>> Yves >>>> _______________________________________________ >>>> Users mailing list >>>> [email protected] >>>> http://lists.osgeo.org/mailman/listinfo/openlayers-users >>>> >> >> _______________________________________________ >> Users mailing list >> [email protected] >> http://lists.osgeo.org/mailman/listinfo/openlayers-users >> >
-- Diego Guidi _______________________________________________ Users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/openlayers-users
