On 09/21/2010 01:05 PM, Ricardo Bayley wrote:
I have SelectFeature Control which has multiple layers (3 actually).
Do any of know if it is possible to know from what layer does the
selectedFeature comes from ?

On my maps, given a vector layer called "cameras", I do it like this:

    sidebar_new = function (e) {
        if (e.feature.layer === cameras) {
            /* Code goes here. */
        }
        ...
    };

    hover = new OpenLayers.Control.SelectFeature(
        [
            cameras,
            ...
        ],
        {
            clickout: false,
            hover: true,
            highlightOnly: true,
            multiple: false,
            toggle: false,
            eventListeners: {
                featurehighlighted: sidebar_new,
                featureunhighlighted: sidebar_del
            }
        }
    );
    map.addControl(hover);

Hope that helps!
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to