-
Notifications
You must be signed in to change notification settings - Fork 410
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
5 changed files
with
73 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# MapStore2 API usage | ||
You can include MapStore2 in your application and interact with it via its JavaScript API | ||
|
||
## How to use | ||
|
||
1. Create a map using the standard installation | ||
1. Go to Share -> Embed | ||
1. Copy the API html code and paste it in your application page | ||
|
||
The map will now load inside your application | ||
|
||
NOTE: If the map is using a Google Maps background you will have to provide your own API key. | ||
Add `&key=YOUR_API_KEY` in the <script> src value | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Custom search service | ||
MapStore2 Searchbox uses [OpenStreetMap Nominatim](https://wiki.openstreetmap.org/wiki/Nominatim) service but you can set it up to use your own WFS service. | ||
The results will be fetched from every service you set, plus OSM Nominatim, and displayed in the order you specified. | ||
|
||
## How to use | ||
|
||
We assume you already have a WFS service set up. | ||
For example it can be on the same server you are using to display your data, so you can make the data easily searchable. | ||
|
||
1. Open the Burger Menu (top right corner) and select "Settings" | ||
1. In the Settings popup you should see a big button "Configure Search Settings", click it | ||
1. You will see a list of services, click "Add" | ||
1. Here you have to input the info on how the search will be performed | ||
1. Input a name for the new service, it will not be displayed as it is for your own reference | ||
1. Input the url to your WFS service. For example, if you are using GeoServer on the same host you can just omit the hostname: `/geoserver/wfs` | ||
1. Input the layername where to search | ||
1. Input a comma-separated list of attribute names where to search | ||
1. Hit Next | ||
1. Here you have to define how the results will be displayed | ||
1. Input the title template, to show a feature property (must be a string) the syntax is `${properties.nameoftheproperty}`. | ||
For example you can create complex templates like: `Woo, I found a ${properties.buildingname} with ${properties.animaltypes} in it!`, but you probably want to just have a simple string like `${properties.title}` | ||
1. Input the description template, it will displayed underneath the title in a different font, the syntax is the same as the title | ||
1. Input the priority of this service, the results from all the services will be ordered by the service priority. Higher priority results will be displayed on top of the list (Priority 5 is higher than priority 1) | ||
1. In the next page there are some optional settings | ||
- Order By: Input the feature attribute to order the results of this specific service | ||
- Max Features: Input the maximum number of features to fetch when searching on this service | ||
1. Save | ||
|
||
Once saved, the service will be queried by the search box. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# How to Customize the Theme | ||
|
||
The look and feel is completely customizable either using one of the included themes, or building your own. Themes are built using [less](http://lesscss.org/). | ||
You can find the default theme here: https://github.com/geosolutions-it/MapStore2/tree/master/web/client/themes/default | ||
|
||
In the [themes folder](https://github.com/geosolutions-it/MapStore2/tree/master/web/client/themes) you can also find other ones that you can study. | ||
|
||
To add a new theme: | ||
1. create a new folder in the themes folder with the name of your theme | ||
1. create less files in the folder (at least `theme.less`, the main file, and `variables.less`, to customize standard variables) | ||
1. add the new theme to the [index file](https://github.com/geosolutions-it/MapStore2/blob/master/web/client/themes/index.js), with the id corresponding to the theme folder name | ||
|
||
You can then switch your application to use the theme adding a new section in the `appConfig.js` file: | ||
|
||
``` | ||
initialState: { | ||
defaultState: { | ||
... | ||
theme: { | ||
selectedTheme: { | ||
id: <your theme id> | ||
} | ||
}, | ||
... | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters