Skip to content

Commit

Permalink
Merge branch 'master' into fullscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
offtherailz committed Mar 31, 2017
2 parents 1a20d1e + 421a8af commit c8e8d2a
Show file tree
Hide file tree
Showing 123 changed files with 1,440 additions and 1,800 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ _site
.jekyll-metadata
*.lock
docs/developer-guide/reference/
web/client/mapstore/docs/
4 changes: 2 additions & 2 deletions docma-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
"label": "Download",
"href": "index.html",
"items": [
{ "label": "<code>mvn clean install</code>" },
{
"label": "MapStore 2 Releases",
"href": "https://github.com/geosolutions-it/MapStore2/releases",
Expand Down Expand Up @@ -132,10 +131,11 @@
"plugins": [
"web/client/plugins/index.jsdoc",
"web/client/plugins/BackgroundSwitcher.jsx",
"web/client/plugins/Map.jsx",
"web/client/plugins/FullScreen.jsx",
"web/client/plugins/Identify.jsx",
"web/client/plugins/Login.jsx",
"web/client/plugins/Map.jsx",
"web/client/plugins/ScrollTop.jsx",
"web/client/plugins/Search.jsx"
]
},
Expand Down
2 changes: 1 addition & 1 deletion docs/developer-guide/application-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ module.exports = finalCreateStore(reducers, {});
},
{
"type": "wms",
"url":"http://demo.geo-solutions.it/geoserver/wms",
"url":"https://demo.geo-solutions.it/geoserver/wms",
"visibility": true,
"opacity": 0.5,
"title": "Weather data",
Expand Down
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)
69 changes: 69 additions & 0 deletions docs/developer-guide/local-config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Application configuration
The application will load by default it will load the `localConfig.js`

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 main information about URLs to load and plugins to load in the various modes.

This is the main structure:
```
{
// 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"
},
// optional state initializer (it will override the one defined in appConfig.js)
"initialState": {
// default initial state for every mode (will override initialState imposed by plugins reducers)
"defaultState": {
...
},
// mobile override (defined properties will overide default in mobile mode)
"mobile": {
...
}
}
"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)
2 changes: 1 addition & 1 deletion docs/developer-guide/map-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ module.exports = {
}],
"toolsOptions": {
"test": {
"label": "ciao"
"label": "Hello"
}
...
}
Expand Down
2 changes: 1 addition & 1 deletion docs/developer-guide/plugins-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ My.jsx:

// this is a dumb component
const MyComponent = require('../components/MyComponent');
const {connect} = require('react-redux');
const {connect} = require('../utils/PluginsUtils');

// let's wire it to state and actions
const MyPlugin = connect((state) => ({
Expand Down
37 changes: 37 additions & 0 deletions docs/developer-guide/plugins-documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,41 @@ or fully configured:
]
}
```

## Dynamic configuration
Configuration properties of plugins can use expressions, so that they are dynamically bound to the
application state.

An expression is anything between curly brackets ({...}) that is a javascript expression,
where the **monitored state** of the application is available as a set of variables.

To define the monitored state, you have to add a **monitorState** property in **localConfig.json**.

```js
{
...
"monitorState": [{"name": "mapType", "path": "mapType.mapType"}]
...
}
```

Where:
* **name** is the name of the variable that can be used in expressions
* **path** is a javascript object path to the state fragment to be monitored (e.g. map.present.zoom)

When you have a monitored state, you can use it in configuration properties this way:

```js
"cfg": {
...
"myProp": "{mapType === 'openlayers' ? 1 : 2}"
...
}
```

Expressions are supported in **cfg** properties and in **hideFrom** and **showIn** sections.

In addition to monitored state also the **page request parameters** are available as variables to be
used in expressions.

Look at the [plugin reference page](./api/plugins) for a list of available configuration properties.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
"react-responsive": "1.1.3",
"react-router": "2.5.2",
"react-router-redux": "3.0.0",
"react-scroll-up": "1.2.1",
"react-select": "1.0.0-rc.1",
"react-selectize": "2.0.3",
"react-share": "1.8.0",
Expand Down
2 changes: 1 addition & 1 deletion prod-webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ webpackConfig.plugins = [
options: {
postcss: {
plugins: [
require('postcss-prefix-selector')({prefix: '.ms2', exclude: ['.ms2']})
require('postcss-prefix-selector')({prefix: '.ms2', exclude: ['.ms2', '[data-ms2-container]']})
]
},
context: __dirname
Expand Down
7 changes: 7 additions & 0 deletions project/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
set -e

npm install
npm run compile
npm run lint
mvn clean install
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"proxyUrl": "/mapstore/proxy/?url=",
"geoStoreUrl": "/mapstore/rest/geostore",
"printUrl": "https://demo.geo-solutions.it/geoserver/pdf/info.json",
"themePrefix": "__PROJECTNAME__",
"translationsPath": "./MapStore2/web/client/translations",
"plugins": {
"desktop": ["Map", "Home"]
Expand Down
Loading

0 comments on commit c8e8d2a

Please sign in to comment.