[OpenLayers-Users] OPENLAYERS FEATURE POPUP TROUBLE

LOHAMANOJ SIVAKUMAR gis.slokam at gmail.com
Mon May 21 21:17:23 PDT 2012


Hi Imran,

I have attached my part of the code.




var treeConfig = [{
        nodeType: "gx_baselayercontainer",
 expanded: true
}, {
        nodeType: "gx_overlaylayercontainer",
        expanded: true,
        loader: {
            baseAttrs: {
                radioGroup: "foo",
                uiProvider: "layernodeui"
            }
        }
    }];

    treeConfig = new OpenLayers.Format.JSON().write(treeConfig, true);
    tree = new Ext.tree.TreePanel({
        border: true,
        region: "west",
        title: "Layers",
        width: 200,
        split: true,
        collapsible: true,
        collapseMode: "mini",
        autoScroll: true,
        plugins: [
            new GeoExt.plugins.TreeNodeRadioButton({
                listeners: {
                    "radiochange": function(node) {
 info = new OpenLayers.Control.WMSGetFeatureInfo({
            url: 'http://90.0.0.129:8090/geoserver/wms',
            title: 'Identify features by clicking',
     layers: [node.text],
     queryVisible: true,
     eventListeners: {
                getfeatureinfo: function(event) {
                    mapPanel.map.addPopup(new OpenLayers.Popup.FramedCloud(
                        "Info.,",
                        mapPanel.map.getLonLatFromPixel(event.xy),
 null,
                        event.text,
                        null,
                        true
                    ));
                }
            },
        });
                    }
                }
            })
        ],
        loader: new Ext.tree.TreeLoader({
            applyLoader: false,
            uiProviders: {
                "layernodeui": LayerNodeUI
            }
        }),
        root: {
            nodeType: "async",
            children: Ext.decode(treeConfig)
        },
        rootVisible: false,
        lines: false
    });



Please do Help me out to solve this problem.




On Mon, May 21, 2012 at 4:31 PM, Imran Rajjad <rajjad at gmail.com> wrote:

> Hi,
>
> seems like a variable scope issue, I would suggest first you debug the
> code and put a break point on that line and see what value does the
> expression "node.text" is holding. or post some more code because one
> cannot tell the scope of the variable 'node' by your code snippet.
>
> regards,
> Imran
>
> On Mon, May 21, 2012 at 9:57 AM, LOHAMANOJ SIVAKUMAR <gis.slokam at gmail.com
> > wrote:
>
>> Hi Openlayers-Users,
>>
>> Am finding difficulty in bringing POPUP.
>>
>> As in Openlayers popup it has the capacity to bring popup for multiple
>> layers or it will display information based on markers.
>>
>> Where else in my case am trying to retrieve information for one
>> particular layer based on layer radio button click in tree
>>
>> and my code is like this
>>
>> plugins: [
>>             new GeoExt.plugins.TreeNodeRadioButton({
>>                 listeners: {
>>                     "radiochange": function(node) {
>>   info = new OpenLayers.Control.WMSGetFeatureInfo({
>>             url: 'http://90.0.0.129:8090/geoserver/wms',
>>             title: 'Identify features by clicking',
>>      layers: [node.text],    //************************ in this line the
>> value is not getting passed.
>>             queryVisible: true,
>>      eventListeners: {
>>                 getfeatureinfo: function(event) {
>>                     mapPanel.map.addPopup(new
>> OpenLayers.Popup.FramedCloud(
>>                         "Info.,",
>>                         mapPanel.map.getLonLatFromPixel(event.xy),
>>  null,
>>                         event.text,
>>                         null,
>>                         true
>>                     ));
>> mapPanel.map.addControl(info);
>>                 }
>>             },
>>         });
>>                     }
>>                 }
>>             })
>>         ],
>>
>> i cant pass the variable directly to layers parameter, on variable pass
>> the layers parameters not accepting the value.
>>
>> PLEASE DO HELP ME on FEATURE POPUP FOR ONE SINGLE LAYER.
>>
>> am newbie to OPENLAYERS.
>>
>>
>> --
>>
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>>
>>
>
>
> --
> I.R
>



-- 
With Regards,
Lohamanoj S,
GIS DEVELOPER,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120522/d47fec2c/attachment.html


More information about the Users mailing list