Developers Page - amarong/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 GET request the page will load: config/myconfig.js
instead.
For more informations about configuration see the configuration page
You can use MapStore as alternative viewer for GeoNetwork. See the integration page for more details.
- Nominatim Geocoder
- Print Plugin
- WFS Search
- WPS Manager
- Marker Editor
- [GetFeature Info Menu] (https://github.com/geosolutions-it/mapstore/wiki/WMS-Get-Feature-Info-Menu)
- AOI Plugin
- Import Export
- Geolocate
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.
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. To do this is very simple by 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);
Make attention 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. To do 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 you 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>