Developers Page - geosolutions-it/MapStore GitHub Wiki
This section provides several useful informations for a developer in order to: manage the MapStore configuration, add and configure additional plugins and develop in general in MapStore.
By default MapStore loads configuration from config/mapStoreConfig.js. Passing the parameter config=myconfig
in a GET request the page will load: config/myconfig.js
instead.
For more informations about configuration see the configuration page
You can use MapStore as an alternative viewer for GeoNetwork. See the integration page for more details.
MapStore provides different levels of localization management. See the localization page for more details.
Plugins (MapStore Tools) are used to add additional functionality to MapStore in a modular manner. Plugins may have action and / or specifics outputs. The action refers to a button or a menu item, while the output refers to something visible on the screen as a pop-up window or a panel (form a grid or something like that).
In general the tools configuration isn't maintained in the MapStore state (for example if you save the Viewer context in GeoStore). However MapStore provide the possibility to save the plugin state if needed. So in a plugin configuration you can simply add the property:
saveState: true
If this property is present and set to true it enables the possibility to save the state of the plugin. Note that in this case the Plugin must implement the function getState()
that calculates and returns its status (for more details about this functionality please click on the Medatada Explorer link below).
- AddLayer Plugin
- Advanced Snapping Agent
- Custom Geocoder based on WFS
- Download Plugin
- Feature Grid
- Geolocate
- Geo Location Menu
- Google Source
- Graticule
- Import Export
- MapManager Plugins
- Marker Editor
- Metadata Explorer
- MousePosition
- Nominatim Geocoder
- OverviewMap
- Print Plugin
- Print Snapshot
- Resource Status
- SpatialSelectorQueryForm
- Static Page Plugin
- Styler
- TabPanel WFS Grid
- Time Plugin
- WFS Search
- WFS Grid
- [WMS GetFeature Info] (https://github.com/geosolutions-it/mapstore/wiki/WMS-Get-Feature-Info)
- [WMS GetFeature Info Menu] (https://github.com/geosolutions-it/mapstore/wiki/WMS-Get-Feature-Info-Menu)
- WPS Manager
- ZoomBox Plugin
MapStore automatically recognize if some parameters are present in the configuration to determine to render the viewer in a tab or not. For example if you use the MetadataExplorer tool you need this kind of visualization. If the cswconfig
paramenter is present, the viewer will be automatically rendered in a tab.
To force the tab rendering add "tab":true
to the MapStore configuration.
The Tab handle can be configure to display a custom title and a custom icon.
The following example sets the title to "My Title" and a custom icon via css rule:
"portalConfig":{
"title": "My Title",
"iconCls": "flame-icon"
}
The CSS style for the icon should define a background-image:
.flame-icon {
background-image: url(../images/flame_icon.png);
}
Many times the "View" header is not needed. To change the configuration of that panel, you can write that configuration inside the portalConfig
parameter in configuration.
"portalConfig":{
"header":false,
}
If you want you can add a welcome sceen during the viewer loading.
This is very simple to do following these steps:
-
Go to the composer.html/viewer.html and uncomment the relative code to import the relavant script
-
MapStore provide for you a default welcome sceen. If you want to customize this please edit the relevant CSS inside the mapstore.css file. The welcome sceen CSS names are:
#loading-mask, #loading, #loading .loading-indicator
In order to enable the graticule plugin please add the followig property to the 'app' definitions inside the composer.html and/or viewer.html:
showGraticule: true,
Follow aconfiguration example:
app = new GeoExplorer.Composer({
...
sources: sources,
showGraticule: true,
...
}, mapIdentifier, authorization, fullScreen);
Notice that this Plugin only work if the map projection is EPSG:4326.
In MapStore you can add a new submodule in order to integrate external functionalities. Doing this is very simple and you can follow the 'csw' module intergration located at:
you@prompt:~$ cd mapstore/
you@prompt:~$ cd mapcomposer/app/static/externals/csw
In order to add a new external submodule (you have also the possibility to use a Git submodule) you have to follow these steps:
-
Copy your submodule at the following path:
you@prompt:~$ cd mapcomposer/app/static/externals
-
Then link the module dependencies to the 'mapcomposer' editing the 'buildjs.cfg' dependencies file located at:
you@prompt:~$ cd mapstore/mapcomposer
Following the 'metadataexplorer' example in this file:
[metadataexplorer.js] root = app/static/externals/csw include = src/CSWCatalogChooser.js src/CSWGrid.js src/CSWHttpProxy.js src/CSWPagingToolbar.js src/CSWPanel.js src/CSWRecord.js src/CSWRecordsReader.js src/CSWSearchTool.js src/eventHandlers.js lib/ResourceBundle/Bundle.js lib/ResourceBundle/PropertyReader.js
-
Add the new module dependencies to the Ant build script (images, css etc.) located at:
you@prompt:~$ cd mapstore/
Following the 'metadataexplorer' example in this file:
<!-- copy metadataexplorer css --> <copy todir="${composerbuild}/${ant.project.name}/WEB-INF/app/static/externals/csw/css"> <fileset dir="mapcomposer/app/static/externals/csw/css"/> </copy> <!-- copy metadataexplorer img --> <copy todir="${composerbuild}/${ant.project.name}/WEB-INF/app/static/externals/csw/img"> <fileset dir="mapcomposer/app/static/externals/csw/img"/> </copy> <!-- copy metadataexplorer i18n --> <copy todir="${composerbuild}/${ant.project.name}/WEB-INF/app/static/externals/csw/i18n"> <fileset dir="mapcomposer/app/static/externals/csw/i18n"/> </copy>