[Users] Add WFS to map and ClickableFeatures

pablo zader pzader at gmail.com
Wed Aug 12 09:30:25 CEST 2015


Hi Endre

I have the definitions several layers:
var app = new GeoExplorer.Composer({ …

                    layers: [

                    {

                                   source: "ol",

                                   type: "OpenLayers.Layer.WMS",

…

But I need to click on a vector layer and select a feature.
Try this definition but do not load  the vector layer:


new GeoExt.Action(Ext.apply({
                    text: 'WFS',
                    control: new OpenLayers.Control.SelectFeature(
this.layer, {
onSelect: this.newfunction,
scope: this})
                }, actionDefaults))

newfunction: function(e){
var record = gxp.plugins.OLSource.prototype.createLayerRecord({
source: "local",
               title:"Nueva",
               name:"tasmania",
       group: "default",
               fixed: true,
queryable: true,
               type: "OpenLayers.Layer.WMS",
                   args: [
                        "Nueva", {visibility: true}
                    ]
                });

this.target.mapPanel.layers.add(record);

}

Thanks in advanced


2015-08-11 4:00 GMT-03:00 Moen Endre <endre.moen at imr.no>:

> This should be supported out of the box from geoexplorer (I think the code
> is in gxp). What version of geoexplorer are you using?
>
>
>
> If you add the layers with the composer constructor which begins with:
>
> var app = new GeoExplorer.Composer({ …
>
>                     layers: [
>
>                     {
>
>                                    source: "ol",
>
>                                    type: "OpenLayers.Layer.WMS",
>
>>
>
>
> You can add queryable: true to enable WFS, and it should be available in
> the “get feature info” button in the toolbar.
>
>
>
> Or you can add it when creating the layer with
> gxp.plugins.OLSource.prototype.createLayerRecord({source: "ol", ...})
>
>
>
> -Endre
>
>
>
> *From:* users-bounces at geoext.org [mailto:users-bounces at geoext.org] *On
> Behalf Of *pablo zader
> *Sent:* 11. august 2015 08:03
> *To:* Users at geoext.org
> *Subject:* [Users] Add WFS to map and ClickableFeatures
>
>
>
> Hi list
>
> I am working with Geoexplorer (GXP + Openlayers + GeoExt) and need add WFS
> layer to Map. how can I do it?
>
> What I really need is to load a WFS layer and select a feature with the
> mouse.
>
>
>
> I am trying with this code. but can't add to map:
>
>
>
> var WFSgeoDB=new OpenLayers.Layer.Vector("WFS", {
>
>                strategies: [new OpenLayers.Strategy.BBOX()],
>
>                protocol: new OpenLayers.Protocol.WFS.v1_1_0({
>
>                  url: "http://localhost:8080/services/WFSgeoDB",
>
>                  featureType: "streets",
>
>                  featureNS: "http://www.deegree.org/app",
>
>                  featurePrefix: "app",
>
>                  geometryName: "road"
>
>                })
>
>              });
>
>
>
> Then I discovered this class: *gxp.plugins.ClickableFeatures *(
> http://horizon.boundlessgeo.com/opengeo-docs/sdk-api/lib/plugins/ClickableFeatures.html
> )
>
>  , but not how to use it. You can serve this class for what I want?
> someone could give some example of its use?
>
>
>
>
>
> Thanks in advanced
>
>
>
> Pablo
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20150812/09c2b3d0/attachment.htm 


More information about the Users mailing list