Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation about localConfig.js #1654

Merged
merged 2 commits into from
Mar 29, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/developer-guide/configuration-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
MapStore2 (and every application developed with MapStore2) allows customization through configuration.
Several configuration files (at development and / or run time) are available to configure all the different aspects of an application.

* [Maps configuration](maps-configuration)
* [Application Configuration](local-config)
* [Maps configuration](maps-configuration)
58 changes: 58 additions & 0 deletions docs/developer-guide/local-config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Application configuration
The application load will load by Default it will load the `localConfig.js`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

load will load ?


You can load a custom configuration by passing the `localConfig` argument in query string:

```
localhost:8081/?localConfig=myConfig#/viewer/openlayers/0
```


The **localConfig** file contains the mail informations about URLs to load and plugins to load in the various modes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mail informations?


This is the mail structure:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mail?

```
{
// URL of geoStore
"geoStoreUrl": "rest/geostore/",
// printURL the url of the print service, if any
"printUrl": "/geoserver-test/pdf/info.json",
// a string or an object for the proxy URL.
"proxyUrl": {
// if it is an object, the url entry holds the url to the proxy
"url": "/MapStore2/proxy/?url=",
// useCORS array contains a list of services that support CORS and so do not need a proxy
"useCORS": ["http://nominatim.openstreetmap.org", "https://nominatim.openstreetmap.org"]
},
// API keys for bing and mapquest services
"bingApiKey"
"mapquestApiKey"
// path to the translation files directory (if different from default)
"translationsPath"
// if true, every ajax and mapping request will be authenticated with the configurations if match a rule
"useAuthenticationRules": true
// the athentication rules to match
"authenticationRules": [
{ // every rule has a `urlPattern` regex to match
"urlPattern": ".*geostore.*",
// and a authentication `method` to use (basic, authkey)
"method": "basic"
}, {
"urlPattern": "\\/geoserver.*",
"method": "authkey"
}
"plugins": {
// plugins to load for the mobile mode
"mobile": [...]
// plugins to load for the desktop mode
"desktop": [...]
// plugins to load for the embedded mode
"embedded": [...]
// plugins to load for the myMode mode
"myMode": [...]
}
],
```
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 configuring plugins, see the [Configuring Plugins Section](plugins-documentation) and the [plugin reference page](./api/plugins)