[OpenLayers-Users] GetFeatures , features property...
Pedro Baracho
pedropbaracho at gmail.com
Wed Nov 18 09:08:24 EST 2009
I think features is a property of the event featureselected.
what you should do is:
map.someevent.somelayer.
>
> events.register("featureselected", this,
> function(e) {
> map.someobject = e.feature;
> console.log(map.someobject);
> }
or map.someobject.push(e.feature) in case of an array.
On Wed, Nov 18, 2009 at 5:18 AM, Dragan Podvezanec <
dragan.podvezanec at gmail.com> wrote:
>
> Hi all.
>
> If I understood documentation right, "features" property in GetFeature
> Control should fill an object with selected features. I don't know why, but
> I get nothing:
>
> map.someobject = {};
>
> map.someevent.somelayer = new OpenLayers.Control.GetFeature({
> protocol:
> OpenLayers.Protocol.WFS.fromWMSLayer(map.somelayer,{
> geometryName:
> geometry,
> srsName:
> "EPSG:900913"
> }),
> hover: false,
> features:
> map.someobject
> });
>
>
> map.someevent.somelayer.events.register("featureselected", this,
> function(e) {
> console.log(e.feature);
> console.log(map.someobject);
> });
>
> When I click on layer, I see in console log e.feature, and it's ok, but
> map.someobject is an empty object. What am I doing wrong here ?
> --
> View this message in context:
> http://n2.nabble.com/GetFeatures-features-property-tp4023776p4023776.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20091118/88b94418/attachment.html
More information about the Users
mailing list