0

I have created viewer app using opengeo gxp library. I have added some layers in Layers config of gxp viewer. some of which are in overlay group, some in custom group and some in background.

As per gxp documentation the layers added in background group are automatically set as base layers, but here in my case all layers have isBaselayer=false, similarly I want to set the baselayers in my custom group also, please help.

    groups : {
                "default" : "Overlays", // title can be overridden with overlayNodeText
                "admin" : {
                    title : "Administrative Boundary",
                    exclusive : true
                },
                "background" : {
                    title : "Base Layers",
                    exclusive : true
                }
            }


       sources : {
        ol : {
            ptype : "gxp_olsource"
        },
        local : {
            ptype : "gxp_wmscsource",
            url : "/geoserver/wms",
            version : "1.1.1"
        },
        google : {
            ptype : "gxp_googlesource"
        },
        osm : {
            ptype : "gxp_osmsource"
        },
        "mapquest" : {
            ptype : "gxp_mapquestsource"
        }
    }

  {
                source : "local",
                title : " Province Boundary",
                name : "opengeo:admin_division",
                styles : "province",
                opacity : 0.8,
                fixed : true,
                group : "admin",
                visibility : true,
                selected : true,
                isBaseLayer : true
            }, {source : "local",
                title : " District Boundary",
                name : "opengeo:admin_division",
                styles : "district",
                opacity : 0.5,
                fixed : true,
                group : "admin",
                isBaseLayer : true
            }, {
                source : "local",
                title : " Tehsil Boundary",
                name : "opengeo:admin_division",
                styles : "tehsil",
                opacity : 0.5,
                fixed : true,
                group : "admin"
            },

            {
            source : "osm",
            name : "mapnik",
            group : "background",
            isBaseLayer: true
            }
1

I think that you should put just this in groups: "admin":

{title : "Administrative Boundary",
                    exclusive : true
                },
                "background" : {
                    title : "Base Layers",
                    exclusive : true

And in your background layer, try to put visibility:true instead of inBaseLayer:true

I put it in that way and it works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.