-
Notifications
You must be signed in to change notification settings - Fork 43
mapStoreConfig File
-
geoStoreBase: Geostore URL (if empty http://<server>:<port>/geostore/rest/ is used) -
proxy:proxy URL -
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"} -
mapMap 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. You can not create other instances of the existing plugins using this array, but if one of the configuration objects have the attributeforceMultiple, you can create skip this control. If you don't userforceMultiple, you can also override the default plugins configuration. For exemple, to set a custom extent for the Zoom To Max Extent plugin:"customTools":[ { "ptype": "gxp_zoomtoextent", "actionTarget": {"target": "paneltbar", "index": 1}, "extent":[ 1046403.2 , 5200006.1, 1413757.5 , 5544708.1] }, { "ptype": "gxp_zoomtoextent", "forceMultiple":true, "actionTarget": {"target": "paneltbar", "index": 13} } /...
This configuration will change the extent of the default plugin (first config) and will add another one,using the forceMultiple attribute, with the default values instead.
-
portalConfig: Optional configuration to override gxp Viewer configuration. See here for more details. -
customPanels: Optional Array ofExt.Panelconfigurations. If present andtoolsis not defined, add tools in Composer.js configuration. -
georeferences_data: Array of regions. If present, overrides the defaultgeoreferences_datavariable defined indata/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}
}
]
}
In this section we show some useful configuration tricks.
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}
]
}
The customPanels attribute is an Array that can contain many Ext.Component configuration object that will be placed inside MapStore.
They can be used to wrap plugins, contain custom html or also other custom panels. One exemple of the use of custom panels is the markerEditor.
http://localhost:8081/viewer?config=markerEditor
The customPanelSample configuration is an ad hoc exemple to help you to use this useful configuration option. It shows nested panel definition, plugin placement, custom html, and also an IFrame.
http://localhost:8081/?config=customPanelSample
NOTE: if you want to place some custom panels inside other custom panel (e.g. some panels inside a tab), you have to place the container before the other panels in the array.
Custom panels can have the target attribute (String) . If present, the panel will be placed inside the container with this string as id (for exemple, the tab panel that contains the layer tree and the legend has west as id). If target is not present the panel will be placed inside the portalPanel.
This is an extract from customPanelSample.js
"customPanels":[
{
"xtype":"panel",
"id":"additionalTab",
"target": "west",
"title": "my New Tab",
"layout":"accordion"
},{
"target":"additionalTab",
"html":"This is a custom panel. Both this and 'my New Tab' are custom panels.",
"title": "Panel 1"
},{
"target":"additionalTab",
"html":"insert your plugin here",
"title": "Panel 2"
},{
"xtype":"tabpanel",
"id":"east",
"region": "east",
"width": 570,
"minWidth":550,
"activeTab": 0,
"border":false,
"collapseMode": "mini" ,
"items":{
"xtype":"panel",
"id":"editor",
"title":"editor",
"layout":"fit",
"target":"east"
}
},{
"xtype":"panel",
"id":"south",
"region":"south",
"html":"another custom panel....",
"height":100
},{
"target":"east",
"html":"<iframe style='width:100%;height:100%' src='http://mapstore.geo-solutions.it' ><iframe/>",
"layout":"fit",
"itemId":"startTab",
"title": "MapStore WebSite"
}
],
//....
"customTools":[
//...
{
"ptype": "gxp_marker_editor",
"outputTarget":"editor",
"toggleGroup":"toolGroup"
}]