Skip to content

Commit 1955b41

Browse files
Tobia Di Pisambarto
andauthored
#3817 Fixing documentation (#4023)
* #3817 fixing documentation * Update docs/developer-guide/map-query-parameters.md Co-Authored-By: mbarto <maurobartolomeoli@gmail.com> * Update docs/developer-guide/map-query-parameters.md Co-Authored-By: mbarto <maurobartolomeoli@gmail.com>
1 parent 52cc9de commit 1955b41

3 files changed

Lines changed: 32 additions & 16 deletions

File tree

docs/developer-guide/API-usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# MapStore API usage
2-
You can include MapStore in your application and interact with it via its JavaScript API
2+
You can include MapStore in your application and interact with it via its [JavaScript API](https://mapstore2.geo-solutions.it/mapstore/docs/api/jsapi)
33

44
## How to use
55

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
# MapViewer query parameters
22

3-
In this section we will describe the available MapViewer query parameters
4-
that can be used when the map is loaded.
3+
In this section we will describe the available MapViewer query parameters that can be used when the map is loaded.
54

65
## Retro-compatibility
7-
In the past a **bbox** query param has been introduced whose value corresponds to extent in the viewport.
6+
In latest releases the **bbox** query param has been introduced whose value corresponds to the extent in the viewport.
87

98
for example:
109
`?bbox=-177.84667968750014,-1.8234225930143395,-9.096679687500114,61.700290838326204`
1110

12-
For more details on it see [sharing a map](../user-guide/share).
11+
For more details on it see [sharing a map](../user-guide/share). This **bbox** has been maintained as independent parameter for retro compatibility reasons since the URL query parameters logic is changing.
1312

1413
## Dynamically dispatching initial actions in MapStore
1514

16-
To dispatch additional actions when the map viewer is started, the **actions** query param can be used.
17-
Only actions from a configured whitelist can be dispatched in this way.
15+
To dispatch additional actions when the map viewer is started, the **actions** query parameter can be used. Only actions from a configured whitelist can be dispatched in this way (see the [configuration section](../configuration-files/local-config) for more details).
1816

19-
The value of this paramater is a JSON string containing an array with an object per action.
17+
```
18+
// list of actions types that are available to be launched dynamically from query param (#3817)
19+
"initialActionsWhiteList": ["ZOOM_TO_EXTENT", "ADD_LAYER", ...]
20+
```
2021

21-
The structure of the object consist of a property type and a bunch of other properties depending on the action.
22+
The value of this paramater is a JSON string containing an array with an object per action. The structure of the object consist of a property type and a bunch of other properties depending on the action.
2223

2324
### Available actions
2425
Only the following actions can be used in the **actions** json string.
@@ -35,27 +36,41 @@ Example:
3536
"maxZoom": 8
3637
}
3738
```
39+
3840
For more details check out the [zoomToExtent](https://mapstore2.geo-solutions.it/mapstore/docs/#actions.map.zoomToExtent) in the framework documentation.
3941

4042
#### Map info
41-
It performs a [GetFeature](https://docs.geoserver.org/stable/en/user/services/wfs/reference.html#getfeature) request and then a [GetFeatureInfo](https://docs.geoserver.org/stable/en/user/services/wms/reference.html#getfeatureinfo) by taking a geometry from a feature retrieved. This action can be used can be used only for existing maps.
43+
It performs a [GetFeature](https://docs.geoserver.org/stable/en/user/services/wfs/reference.html#getfeature) request on the specified layer and then a [GetFeatureInfo](https://docs.geoserver.org/stable/en/user/services/wms/reference.html#getfeatureinfo) by taking a point from the retrieved features's geometry. This action can be used only for existing maps (map previously created).
4244

43-
With the GetFeature request it takes the first coordinate of the geometry of the first feature.
44-
Then it uses it for the GFI request by creating an area of 101x101 px and by limiting it to the specified layer.
45+
With the GetFeature request it takes the first coordinate of the geometry of the first retrieved feature; that coordinates are then used for an usual GFI (WMS GetFeatureInfo) request by limiting it to the specified layer.
4546

46-
You can add to the action a cql_filter that will be used in both request.
47+
A **cql_filter** is also **mandatory** for that action to properly filter required data: that filter will be used in both request (GetFeature and GFI). If you don't need to apply a filter, you can use the standard INCLUDE clause (cql_filter=INCLUDE) so the whole dataset will be queried.
4748

4849
Requirements:
49-
- the layer specified must be visible in the map
50-
- there must be a geometry that can be retrieved from the GetFeature request
50+
- The layer specified must be visible in the map
51+
- There must be a geometry that can be retrieved from the GetFeature request
5152

5253
Example:
54+
5355
```
5456
{
5557
"type": "SEARCH:SEARCH_WITH_FILTER",
5658
"cql_filter": "ID=75",
5759
"layer": "WORKSPACE:LAYER_NAME"
5860
}
61+
5962
?actions=[{"type":"SEARCH:SEARCH_WITH_FILTER","cql_filter":"ID=75","layer":"WORKSPACE:LAYER_NAME"}]
6063
```
64+
65+
The sample request below illustrates how two actions can be concatenated:
66+
67+
```
68+
https://dev.mapstore2.geo-solutions.it/mapstore/#/viewer/openlayers/4093?actions=[{"type":"SEARCH:SEARCH_WITH_FILTER","cql_filter":"STATE_FIPS=34","layer":"topp:states"},{"type":"ZOOM_TO_EXTENT","extent":[-77.48202256347649,38.74612266051003,-72.20858506347648,40.66664704515103],"crs":"EPSG:4326","maxZoom":8}]
69+
```
70+
71+
The MapStore invocation URL above executes the following operations:
72+
73+
- Execution of a search request filtering by **STATE_FIPS** with value 34 on the **topp:states** layer
74+
- Execution of a map zoom to the provided extent
75+
6176
For more details check out the [searchLayerWithFilter](https://mapstore2.geo-solutions.it/mapstore/docs/#actions.search.exports.searchLayerWithFilter) in the framework documentation

mkdocs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ pages:
9090
- Plugins:
9191
- Plugins Architecture: 'developer-guide/plugins-architecture.md'
9292
- Configuring Plugins: 'developer-guide/plugins-documentation.md'
93-
- API:
93+
- Communicating with MapStore:
94+
- API usage: 'developer-guide/API-usage.md'
9495
- MapViewer query paramaters: 'developer-guide/map-query-parameters.md'
9596
- Quick Start: 'quick-start.md'

0 commit comments

Comments
 (0)