Skip to content

mapStoreConfig File

Damianofds edited this page Apr 4, 2013 · 16 revisions

Configuration Options

  • geoStoreBase: Geostore URL (if empty http://<server>:<port>/geostore/rest/ is used)

  • proxy:proxy URL

  • xmlJsonTranslate: xmlJsonTranslate service URL (if empty http://<server>:<port>/xmlJsonTranslate/ is used),

  • defaultLanguage: default language code,

  • gsSources: Sources for getCapabilities: example:

    { "mapquest": { "ptype": "gxp_mapquestsource" }, "osm": { "ptype": "gxp_osmsource" }, "google": { "ptype": "gxp_googlesource" }, "bing": { "ptype": "gxp_bingsource" }, "ol": { "ptype": "gxp_olsource" } },

  • proj4jsDefs: additional proj4js Definitions example:

      {"EPSG:3003":"+proj=tmerc +lat_0=0 +lon_0=9 +k=0.9996 +x_0=1500000 +y_0=0 +ellps=intl +units=m +no_defs"}
    
  • map Map Configuration. Example:

    { "projection": "EPSG:900913", "units": "m", "center": [1250000.000000, 5370000.000000], "zoom":5, "maxExtent": [ -20037508.34, -20037508.34, 20037508.34, 20037508.34 ], "layers": [{ "source": "mapquest", "title": "MapQuest OpenStreetMap", "name": "osm", "group": "background" }] }

  • tools:Optional Array of tools configurations. If present, overrides the configuration in Composer.js.

  • customTools: Optional Array of tools configurations. If present adds the panels in the same container of the main mapPanel

  • portalConfig: Optional configuration to override gxp Viewer configuration.

  • customPanels: Optional Array of Ext.Panel configurations. If present and tools is not defined, add tools in Composer.js configuration.

  • georeferences_data: Array of regions. If present, overrides the default georeferences_data variable defined in data/georeferences.js.

  • cswconfig: configuration for cswViewer (if present).

  • tab : forced tab visualization of the viewport.

Complete Example:

		{
		"geoStoreBase":"http://localhost:8080/geostore/rest/",
		"proxy":"/http_proxy/proxy/?url=",
		"defaultLanguage": "en",
		"gsSources":{ 

			"mapquest": {
				"ptype": "gxp_mapquestsource"
			}, 
			"osm": { 
				"ptype": "gxp_osmsource"
			},
			"google": {
				"ptype": "gxp_googlesource" 
			},
			"bing": {
				"ptype": "gxp_bingsource" 
			}, 
			"ol": { 
				"ptype": "gxp_olsource" 
			}
		},
		"map": {
			"projection": "EPSG:900913",
			"units": "m",
			"center": [1250000.000000, 5370000.000000],
			"zoom":5,
			"maxExtent": [
				-20037508.34, -20037508.34,
				20037508.34, 20037508.34
			],
			"layers": [
				{
					"source": "bing",
					"title": "Bing Aerial",
					"name": "Aerial",
					"group": "background"
				}, {
					"source": "osm",
					"title": "Open Street Map",
					"name": "mapnik",
					"group": "background"
				},{
					"source": "mapquest",
					"title": "MapQuest OpenStreetMap",
					"name": "osm",
					"group": "background"
				},{
					"source": "google",
					"title": "Google Roadmap",
					"name": "ROADMAP",
					"group": "background"
				},{
					"source": "google",
					"title": "Google Terrain",
					"name": "TERRAIN",
					"group": "background"
				},{
					"source": "google",
					"title": "Google Hybrid",
					"name": "HYBRID",
					"group": "background"
				}
			]
		
		},
		"customTools": [
				{
				ptype: "gxp_googleearth",
				actionTarget: {target: "paneltbar", index: 24}
				}
		]
	}

Examples

In this section we show some useful configuration tricks.

Configure an empty background layer

To add an empty background to the backgrounds list, add the following configuration to the map layers array:

   {
        "source": "ol",
        "group": "background",
        "fixed": true,
        "type": "OpenLayers.Layer",
        "visibility": false,
        "args": [
            "None", {"visibility": false}
        ]
   }