<span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">Hi I want to use the GetFeature control in a fresh mapfish app. I have configured the protocol of the control, and added a WMS as a simple base layer with the same projection and displayprojection ("EPSG;4326"). I use geoserver.<br>
<br>With firebug I have seen that the control does the WFS POST request to geoserver, and geoserver gives back the gml document (I think then the proxy is not the problem because I can get the geographical features, I put the application inside geoserver folder in apache), the problem comes with the featuresselected event because I have put into the event an alert and it doesn't show, I paste the code here, for any further reference. (I get it from the official mapfish documentation). What could be wrong?.<br>
<br>I thank your time and attention.<br><br>Thank you very much.<br><br> var featureControl = new OpenLayers.Control.GetFeature({<br> //strategies: [new OpenLayers.Strategy.BBOX()],<br> protocol: new OpenLayers.Protocol.WFS({<br>
version: "1.1.0",<br> url: "<a href="http://localhost:8080/geoserver/wfs" target="_blank" style="color: rgb(0, 0, 204); ">http://localhost:8080/geoserver/wfs</a>",<br> featureType: "ways",<br>
featureNS: "simulador",//<a href="http://localhost:8080/geoserver/rest/proxy?url=simulador.trafico" target="_blank" style="color: rgb(0, 0, 204); ">http://localhost:8080/geoserver/rest/proxy?url=simulador.trafico</a><br>
srsName: "EPSG:4326",<br> maxFeatures:50<br> }),<br> box: true,<br> hover: true,<br> multipleKey: "shiftKey",<br> toggleKey: "ctrlKey",<br>
multiple: true,<br> allowSelection:true<br> });<br><br> <font size="4"><b>//I have tried this way</b></font><br><br> featureControl.events.on({<br> 'featuresselected': function(e){<br>
alert('dfsfds');<br> }<br> });<br><br> <font size="4"><b> //And also this way</b></font><br> featureControl.events.register("featuresselected", this, function(e) {<br>
alert("lkjlk");<br> selectLayer.addFeatures([e.feature]);<br> });<br> featureControl.events.register("featureunselected", this, function(e) {<br> alert("lkjlk");<br>
selectLayer.removeFeatures([e.feature]);<br> });<br> featureControl.events.register("hoverfeature", this, function(e) {<br> alert("lkjlk");<br> hoverLayer.addFeatures([e.feature]);<br>
});<br> featureControl.events.register("outfeature", this, function(e) {<br> alert("lkjlk");<br> hoverLayer.removeFeatures([e.feature]);<br> });*/<br>
//map.addControl(featureControl);<br> //featureControl.activate();<br><br> //This is the actions array for the toolbar<br> actions.push(new GeoExt.Action({<br> iconCls: "info",<br>
map: map,<br> toggleGroup: "map",<br> tooltip: "Get country information",<br> control: featureControl<br> }));</span>