<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt;color:#000000;"><DIV>Hi list,</DIV>
<DIV>&nbsp;</DIV>
<DIV>I try to select a feature from a wfs layer but it didn´t work.</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>
<P>var select = new OpenLayers.Layer.Vector("Selection", { </P>
<P>styleMap: new </P>
<P>OpenLayers.StyleMap({strokeColor: "blue",</P>
<P>strokeWidth: 5 , strokeOpacity: 0.5, fillOpacity: 0.4}),</P>
<P>displayInLayerSwitcher: true, visibility: true});</P></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>
<P>var wfs2 = new OpenLayers.Layer.Vector("WFS_", </P>
<P>{ styleMap: styleMap,</P>
<P>strategies: [new OpenLayers.Strategy.Fixed()], </P>
<P>projection: destproj, </P>
<P>protocol: new OpenLayers.Protocol.WFS({ </P>
<P>url: "http://myserver:81/geoserver/wfs", </P>
<P>featureNS: <A href="http://mycomp.org">http://mycomp.org</A>, </P>
<P>featureType: "mylayer", </P>
<P>geometryName: "SHAPE", </P>
<P>srsName: "EPSG:4326",</P>
<P>version: "1.1.0" </P>
<P>}),</P>
<P>projection: new OpenLayers.Projection("EPSG:4326")</P>
<P>}); </P>
<P>&nbsp;</P><FONT size=2>
<P>var selectFeature = new OpenLayers.Control.SelectFeature(wfs2,{box:true});</P>
<P>//map.addControl(selectFeature);</P>
<P>selectFeature.events.register("featureselected", this, function(e){ </P>
<P>select.addFeatures([e.feature]); });</P>
<P>selectFeature.events.register("featureunselected", this, function(e){select.removeFeatures([e.feature]);});</P>
<P> </P>
<P>map.addControl(selectFeature);</P></FONT>
<P>&nbsp;</P>
<P><FONT size=3>I can cover my feature with a box but then nothing happens. At firebug I can see that my code never reach "select.addFeatures([e.feature]);".</FONT></P>
<P><FONT size=3>If I use:</FONT></P><FONT size=2>
<P>selectControl = new OpenLayers.Control.GetFeature({</P>
<P>protocol: OpenLayers.Protocol.WFS({</P>
<P>url: "http://myserver:81/geoserver/wfs?service=wfs", </P>
<P>featureNS: "http://mycomp.org",</P>
<P>featureType: "mylayer", </P>
<P>geometryName: "SHAPE", </P>
<P>srsName: "EPSG:4326",</P>
<P>version: "1.0.0",</P>
<P>}),</P>
<P>box: true,</P>
<P>multipleKey: "shiftKey",</P>
<P>toggleKey: "ctrlKey"</P>
<P>}, {projection: new OpenLayers.Projection("EPSG:4326")}</P>
<P>);</P>
<P>selectControl.events.register("featureselected", this, function(e){ </P>
<P>//select.addFeatures(Proj4js.transform(sourceproj,destproj,[e.feature.geometry])); </P>
<P>//Proj4js.reportError = function(msg){alert(msg);}//[e.feature.transform(sourceproj,destproj)]); </P>
<P>select.addFeatures([e.feature])</P>
<P>});</P>
<P>selectControl.events.register("featureunselected", this, function(e){select.removeFeatures([e.feature]);});</P>
<P>&nbsp;</P>
<P>map.addControl(selectControl);</P>
<P>&nbsp;</P>
<P><FONT size=3>I get a response at firebug (but feature has different projection). If I want to transform my response then I get a message saying "Latitude failed to converge".</FONT></P>
<P><FONT size=3>Features are multipolygon if that does matter.&nbsp;</FONT></P>
<P><FONT size=3></FONT>&nbsp;</P>
<P><FONT size=3>What did I wrong?</FONT></P>
<P><FONT size=3>Thanks for any hint.</FONT></P>
<P><FONT size=3></FONT>&nbsp;</P>
<P><FONT size=3>best regards</FONT></P>
<P><FONT size=3>Sarah</FONT></P></FONT></FONT></DIV></div><br></body></html>