Application configuration
The application will load by default it will load the localConfig.json
which is now stored in the configs\ folder
You can load a custom configuration by passing the localConfig
argument in query string:
1 |
|
The localConfig file contains the main information about URLs to load and plugins to load in the various modes.
This is the main structure:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
|
If you are building your own app, you can choose to create your custom modes or force one of them by passing the mode
parameter in the query string.
For adding a new locale or configuring currently supported locales, go check this out.
For configuring plugins, see the Configuring Plugins Section and the plugin reference page
Explanation of some config properties
- loadAfterTheme is a flag that allows to load mapstore.js after the theme which can be versioned or not(default.css). default is false
- initialState is an object that will initialize the state with some default values and this WILL OVERRIDE the initialState imposed by plugins & reducers.
- projectionDefs is an array of objects that contain definitions for Coordinate Reference Systems
initialState configuration
It can contain:
- a defaultState valid for every mode
- a piece of state for each mode (mobile, desktop, embedded)
Catalog Tool configuration
Inside defaultState you can set default catalog services adding the following key
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
|
Set selectedService
value to one of the ID of the services object ("Demo CSW Service" for example).
This will become the default service opened and used in the catalog panel.
For each service set the key of the service as the ID.
1 2 3 4 5 6 7 8 9 10 11 |
|
Be careful to use unique IDs
Future implementations will try to detect the type from the url.
newService is used internally as the starting object for an empty service.
Measure Tool configuration
Inside defaultState you can set lengthFormula, showLabel, uom:
- you can customize the formula used for length calculation from "haversine" or "vincenty" (default haversine)
- show or not the measurement label on the map after drawing a measurement (default true)
- set the default uom used for measure tool (default m and sqm)
For the label you can choose whatever value you want.
For the unit you can choose between: - unit length values : ft, m, km, mi, nm standing for feets, meters, kilometers, miles, nautical miles
- unit area values : sqft, sqm, sqkm, sqmi, sqnm standing for square feets, square meters, square kilometers, square miles, square nautical miles
- Customize the style for the start/endPoint for the measure features. You can set startEndPoint to:
- false if you want to disable it
- true (defaults will be used)
- object for customizing styles by placing startPointOptions and/or endPointOptions
- You can either change the radius or set the fillColor or decide to apply this customization to the first and second-last point for polygons
For lineString endPointOptions refers to the last point of the polyline
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
Annotations Editor configuration
Annotations editor can be configured by setting it's defaultState. It looks like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
- format - decimal or aeronautical degree for coordinates
- defaultTextAnnotation - default text value for text annotations
- config.geometryEditorOptions - properties to be passed to CoordinatesEditor of GeometryEditor. For more information refer to the documentation of CoordinatesEditor component
- config.multiGeometry - if set to true allows to add more then one geometry to annotations
- config.defaultPointType - default point type of marker geometry type. Can be 'marker' or 'symbol'
projectionDefs configuration
Custom CRS can be configured here, at root level of localConfig.json file. For example:
1 2 3 4 5 6 |
|
Explanation of these properties:
- code - a code string that will identify the added projection
- def - projection definition in PROJ.4 format
- extent - projected bounds of the projection
- worldExtent - bounds of the projection in WGS84
These parameters for a projection of interest can be found on epsg.io
CRS Selector configuration
CRS Selector is a plugin, that is configured in the plugins section. It should look like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|
Configuration parameters are to be placed in the "cfg" object. These parameters are:
- additionalCRS - object, that contains additional Coordinate Reference Systems. This configuration parameter lets you specify which projections, defined in projectionDefs, should be displayed in the CRS Selector, alongside default projections. Every additional CRS is a property of additionalCRS object. The name of that property is a code of a corresponding projection definition in projectionDefs. The value of that property is an object with the following properties:
- label - a string, that will be displayed in the CRS Selector as a name of the projection
- filterAllowedCRS - which default projections are to be available in the selector. Default projections are:
- EPSG:3857
- EPSG:4326
- allowedRoles - CRS Selector will be accessible only to these roles. By default, CRS Selector will be available for any logged in user.