Hello

à published a table using the sql view, it works but when i want to associat
a vector to get the ID of the selected feature, it doesn't work. Via fireBug
i see that the *numberOfFeatures="0". The same code works with an other
mapPanel but this time it's a simple layer.  Help me please to get the
feature id the sqlView layer.
NB: the sql code is  select * from commune where province = %province%, i
gave default value 11. So the layer is never Null

thank you

this is the code for selection vector:

    select = new OpenLayers.Layer.Vector("Selection", {styleMap:
                new
OpenLayers.Style(OpenLayers.Feature.Vector.style["select"])
            });
            hover = new OpenLayers.Layer.Vector("Hover");
            mapDashBoard.addLayers([layerCommune, hover, select]);

            control = new OpenLayers.Control.GetFeature({
                protocol:
OpenLayers.Protocol.WFS.fromWMSLayer(layerCommune),
                box: true,
                hover: true,
                multipleKey: "shiftKey",
                toggleKey: "ctrlKey"
            });
            control.events.register("featureselected", this, function(e) {
                select.addFeatures([e.feature]);
                alert(e.feature.fid);

            });
            control.events.register("featureunselected", this, function(e) {
                select.removeFeatures([e.feature]);
            });
            control.events.register("hoverfeature", this, function(e) {
                hover.addFeatures([e.feature]);
            });
            control.events.register("outfeature", this, function(e) {
                hover.removeFeatures([e.feature]);
            });
            mapDashBoard.addControl(control);
            control.activate();
*
------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to