Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * 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/ZoomToExtent.js
- * @require plugins/NavigationHistory.js
- * @require plugins/Zoom.js
- * @require plugins/AddLayers.js
- * @require plugins/RemoveLayer.js
- * @require RowExpander.js
- * @require plugins/CatalogueSource.js
- * @require plugins/GeoNodeCatalogueSource.js
- * @require plugins/CSWCatalogueSource.js
- * @require widgets/CatalogueSearchPanel.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"]
- }, {
- xtype: "container",
- layout: "vbox",
- region: "west",
- width: 200,
- defaults: {
- width: "100%",
- layout: "fit"
- },
- items: [{
- title: "Layers",
- id: "westpanel",
- border: false,
- flex: 1
- }, {
- id: "legendpanel",
- height: 500
- }]
- }],
- 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_removelayer",
- actionTarget: ["tree.tbar", "tree.contextMenu"]
- }],
- // layer sources
- sources: {
- local: {
- ptype: "gxp_wmscsource",
- url: "/geoserver/wms",
- version: "1.1.1"
- },
- osm: {
- ptype: "gxp_osmsource"
- },
- geonetwork: {
- ptype: "gxp_cataloguesource",
- url: "/geonetwork/srv/en/csw",
- title: "Geonetwork"
- },
- ol: {
- ptype: "gxp_olsource"
- }
- },
- // map and layers
- map: {
- id: "mymap", // id needed to reference map in portalConfig above
- title: "Map",
- //projection: "EPSG:900913",
- //center: [-10764594.758211, 4523072.3184791],
- projection: "EPSG:4326",
- center: [-97, 38],
- zoom: 3,
- layers: [{
- source: "ol",
- type: "OpenLayers.Layer.WMS",
- args: ["World map", "http://vmap0.tiles.osgeo.org/wms/vmap0", {layers: 'basic'}],
- group: "background"
- }],
- tbar: [{
- text: "Find Layers",
- handler: createCatalogueSearchPanel
- }]
- }
- });
- /*
- * Function that creates a CatalogueSearchPanel
- */
- function createCatalogueSearchPanel()
- {
- var catalogueSearchPanel = new gxp.CatalogueSearchPanel({
- map: app.map,
- selectedSource: "geonetwork",
- sources: {
- geonetwork: {
- ptype: "gxp_cataloguesource",
- url: "/geonetwork/srv/en/csw",
- title: "Geonetwork"
- }
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement