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

Reply via email to