<div dir="ltr"><div>Hi <span style="color:rgb(31,73,125);font-family:Calibri,sans-serif;font-size:15px">Endre</span></div><div><span style="color:rgb(31,73,125);font-family:Calibri,sans-serif;font-size:15px"><br></span></div><div>I have the definitions several layers:</div><div><span style="color:rgb(31,73,125);font-family:Calibri,sans-serif;font-size:11pt">var app = new GeoExplorer.Composer({ …</span></div><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> layers: [<u></u><u></u></span></p><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> {<u></u><u></u></span></p><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> source: "ol",<u></u><u></u></span></p><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> type: "OpenLayers.Layer.WMS",<u></u><u></u></span></p><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">…</span></p><div><br></div><div><span style="font-family:inherit">But </span>I need to click on a vector layer and select a feature. </div>Try this definition but do not load the vector layer:<div><br></div><div><br></div><div><div>new GeoExt.Action(Ext.apply({</div><div> <span class="Apple-tab-span" style="white-space:pre">        </span> text: 'WFS',</div><div> <span class="Apple-tab-span" style="white-space:pre">        </span> control: new OpenLayers.Control.SelectFeature(</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>this.layer, {</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span>onSelect: this.newfunction,</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span>scope: this})<span class="Apple-tab-span" style="white-space:pre">        </span></div><div> <span class="Apple-tab-span" style="white-space:pre">        </span> }, actionDefaults))</div></div><div><br></div><div>newfunction: function(e){<br><div>var record = gxp.plugins.OLSource.prototype.createLayerRecord({</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span>source: "local",</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span> title:"Nueva",</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span> name:"tasmania",</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span> group: "default",</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span> fixed: true,</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span>queryable: true,</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span> type: "OpenLayers.Layer.WMS",</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span> args: [</div><div> <span class="Apple-tab-span" style="white-space:pre">                        </span>"Nueva", {visibility: true}</div><div> <span class="Apple-tab-span" style="white-space:pre">                                </span>]</div><div> <span class="Apple-tab-span" style="white-space:pre">                        </span>});</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>this.target.mapPanel.layers.add(record);</div></div><div><br></div><div>}</div><div><br></div><div>Thanks in advanced</div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-08-11 4:00 GMT-03:00 Moen Endre <span dir="ltr"><<a href="mailto:endre.moen@imr.no" target="_blank">endre.moen@imr.no</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="NO-BOK" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">This should be supported out of the box from geoexplorer (I think the code is in gxp). What version of geoexplorer are you using?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">If you add the layers with the composer constructor which begins with:
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">var app = new GeoExplorer.Composer({ …<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> layers: [<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> {<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> source: "ol",<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> type: "OpenLayers.Layer.WMS",<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">…<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">You can add queryable: true to enable WFS, and it should be available in the “get feature info” button in the toolbar.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Or you can add it when creating the layer with gxp.plugins.OLSource.prototype.createLayerRecord({source: "ol", ...})<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">-Endre<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:users-bounces@geoext.org" target="_blank">users-bounces@geoext.org</a> [mailto:<a href="mailto:users-bounces@geoext.org" target="_blank">users-bounces@geoext.org</a>]
<b>On Behalf Of </b>pablo zader<br>
<b>Sent:</b> 11. august 2015 08:03<br>
<b>To:</b> <a href="mailto:Users@geoext.org" target="_blank">Users@geoext.org</a><br>
<b>Subject:</b> [Users] Add WFS to map and ClickableFeatures<u></u><u></u></span></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">Hi list<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">I am working with Geoexplorer (GXP + Openlayers + GeoExt) and need add WFS layer to Map. how can I do it?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">What I really need is to load a WFS layer and select a feature with the mouse.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<div>
<p class="MsoNormal">I am trying with this code. but can't add to map:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">var WFSgeoDB=new OpenLayers.Layer.Vector("WFS", { <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span> </span> strategies: [new OpenLayers.Strategy.BBOX()], <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span> </span> protocol: new OpenLayers.Protocol.WFS.v1_1_0({ <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span> </span> url: "<a href="http://localhost:8080/services/WFSgeoDB" target="_blank">http://localhost:8080/services/WFSgeoDB</a>", <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span> </span> featureType: "streets", <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span> </span> featureNS: "<a href="http://www.deegree.org/app" target="_blank">http://www.deegree.org/app</a>", <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span> </span> featurePrefix: "app", <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span> </span> geometryName: "road" <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span> </span> }) <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span> </span> }); <u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Then I discovered this class: <b>gxp.plugins.ClickableFeatures
</b>(<a href="http://horizon.boundlessgeo.com/opengeo-docs/sdk-api/lib/plugins/ClickableFeatures.html" target="_blank">http://horizon.boundlessgeo.com/opengeo-docs/sdk-api/lib/plugins/ClickableFeatures.html</a>)<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> , but not how to use it. You can serve this class for what I want? someone could give some example of its use?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Thanks in advanced<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">Pablo <u></u><u></u></p>
<div>
<div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote></div><br><br clear="all"><div><br></div><br>
</div></div>