Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I used geoext sample app as in the example. added a new source and layers. but does not work: warn message "Non-existing source 'rs' referenced in layer config".

but the response from the server comes (I see it in Firebug)! server ArcGIS Server and WMS version 1.3.0 http://maps.rosreestr.ru/ArcGIS/services/CadastreNew/CadastreWMS/MapServer/WMSServer?request=GetCapabilities&service=WMS

I'm just starting to learn javascript

 /**
 * Add all your dependencies here.
 *
 * @require widgets/Viewer.js
 * @require plugins/LayerTree.js
 * @require plugins/OLSource.js
 * @require plugins/OSMSource.js
 * @require plugins/WMSCSource.js
 * @require plugins/WMSSource.js // for my source
 * @require plugins/BingSource.js
 * @require plugins/GoogleSource.js  
 * @require plugins/ZoomToExtent.js
 * @require plugins/NavigationHistory.js
 * @require plugins/Zoom.js
 * @require plugins/AddLayers.js
 * @require plugins/RemoveLayer.js
 * @require RowExpander.js
 * @require plugins/WMSGetFeatureInfo.js
 * @require plugins/FeatureManager.js
 * @require plugins/FeatureEditor.js
 * @require plugins/FeatureGrid.js
 * @require plugins/DrawBox.js
 * @require plugins/BoxInfo.js
 */

var app = new gxp.Viewer({
    portalConfig: {
        layout: "border",
        region: "center",

        // by configuring items here, we don't need to configure portalItems
        // and save a wrapping container
        items: [{
            id: "centerpanel",
            xtype: "panel",
            layout: "fit",
            region: "center",
            border: false,
            items: ["mymap"]
        }, {
            id: "westpanel",
            xtype: "container",
            layout: "fit",
            region: "west",
            width: 200
        },{
            id: "south",
            xtype: "container",
            layout: "fit",
            region: "south",
            border: false,
            height: 200
        }, {
            id: "southpanel",
            xtype: "container",
            layout: "fit",
            region: "south",
            height: 100
        }
        ],
        bbar: {id: "mybbar"}
    },

    // configuration of all tool plugins for this application
    tools: [{
        ptype: "gxp_layertree",
        outputConfig: {
            id: "tree",
            border: true,
            tbar: [] // we will add buttons to "tree.bbar" later
        },
        outputTarget: "westpanel"
    }, {
        ptype: "gxp_addlayers",
        actionTarget: "tree.tbar"
    }, {
        ptype: "gxp_removelayer",
        actionTarget: ["tree.tbar", "tree.contextMenu"]
    }, {
        ptype: "gxp_zoomtoextent",
        actionTarget: "map.tbar"
    }, {
        ptype: "gxp_zoom",
        actionTarget: "map.tbar"
    }, {
        ptype: "gxp_navigationhistory",
        actionTarget: "map.tbar"
    }, {
        ptype: "gxp_wmsgetfeatureinfo",
        featureManager: "states_manager",
        outputConfig: {
            width: 700
        },
        actionTarget: {
            target: "map.tbar",
            index: 1
        }
    }, {
        ptype: "gxp_featuremanager",
        id: "states_manager",
        paging: false,
        autoLoadFeatures: true,
        layer: {
            source: "local",
            name: "geo:fence"
        }
    }, {
        ptype: "gxp_featureeditor",
        featureManager: "states_manager",
        autoLoadFeature: true
    }, /*{
        ptype: "gxp_featuregrid",
        featureManager: "states_manager",
        outputConfig: {
            loadMask: true
        },
        outputTarget: "south"
    },*/ {
        ptype: "myapp_drawbox",
        id: "drawbox",
        actionTarget: "map.tbar"
    }, {
        ptype: "myapp_boxinfo",
        boxTool: "drawbox",
        outputTarget: "southpanel"
    }
    ],

    // layer sources
    sources: {
        local: {
            ptype: "gxp_wmscsource",
            url: "/geoserver/wms",
            version: "1.1.1"
        },
        osm: {
            ptype: "gxp_osmsource"
        },
        rs: {
            ptype: "gxp_wmssource",
            url: "http://maps.rosreestr.ru/ArcGIS/services/CadastreNew/CadastreWMS/MapServer/WMSServer"
            ,transparent: true,
            format: "png",
            version: "1.3.0"
        },
        bing: {
            ptype: "gxp_bingsource"
        },
        google: {
            ptype: "gxp_googlesource"
        }
    },

    // map and layers
    map: {
        id: "mymap", // id needed to reference map in portalConfig above
        title: "Map",
        projection: "EPSG:3857",
        center: [4187314.9432233, 7447312.6747233],
        zoom: 17,
        layers: [{
            source: "osm",
            name: "mapnik",
            group: "background"
        }, {
            source: "bing",
            name: "Aerial",
            title: "Bing Map",
            group: "background"
        }, { 
            source: "google",
            name: "SATELLITE",
            group: "background"
        }, { 
            source: "rs",
            name: "22,21,20,19,18,16,15,14,13,11,10,9,7,6,4,3,2,1",
            //,group: "background",
            visibility: true    
        }, {
            source: "local",
            name: "geo:roadcover",
            selected: true,
            visibility: true
        }, {
            source: "local",
            name: "geo:bridge_polygon",
            visibility: true    
        }, {
            source: "local",
            name: "geo:cadastre_s",
            visibility: true
        }, {
            source: "local",
            name: "geo:fence",
            visibility: false
        }, {
            source: "local",
            name: "geo:curbs",
            visibility: false
        }, {
            source: "local",
            name: "geo:layout_polygon",
            visibility: false
        }, {
            source: "local",
            name: "geo:RoadInternodalSegment",
            visibility: true
        }
        ],
        items: [{
            xtype: "gx_zoomslider",
            vertical: true,
            height: 100
        }]
    }

   });

this screenshot from Firebug http://gis-lab.info/forum/download/file.php?id=6569&sid=2c5226b95b2cb52e97280be1d6039655

Sorry for my bad english

share|improve this question
add comment

1 Answer

understood! external WMS added through plugins/OLSource.js use plugins/WMSSource.js is possible only for my data (Geoserver)

{
        source: "ol",
        type: "OpenLayers.Layer.WMS",
        args: ["Информация Росреестра", "http://maps.rosreestr.ru/ArcGIS/services/CadastreNew/CadastreWMS/MapServer/WMSServer",
            {transparent: 'true', layers: "22,21,20,19,18,16,15,14,13,11,10,9,7,6,4,3,2,1", format: 'png24'}],
        selected: true,
        visibility: true
    }
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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