MapViewer query parameters
In this section we will describe the available MapViewer query parameters that can be used when the map is loaded.
In latest releases the bbox query param has been introduced whose value corresponds to the extent in the viewport.
For more details on it see sharing a map. This bbox has been maintained as independent parameter for retro compatibility reasons since the URL query parameters logic is changing.
Dynamically dispatching initial actions in MapStore
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 for more details).
The value of this parameter 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.
Only the following actions can be used in the actions json string.
Zoom to extent
It zooms the map to the defined extent.
1 2 3 4 5 6
For more details check out the zoomToExtent in the framework documentation.
It performs a GetFeature request on the specified layer and then a GetFeatureInfo by taking a point from the retrieved features's geometry. This action can be used only for existing maps (map previously created).
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.
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.
Requirements: - The layer specified must be visible in the map - There must be a geometry that can be retrieved from the GetFeature request
1 2 3 4 5 6 7
The sample request below illustrates how two actions can be concatenated:
The MapStore invocation URL above executes the following operations:
- Execution of a search request filtering by STATE_FIPS with value 34 on the topp:states layer
- Execution of a map zoom to the provided extent
For more details check out the searchLayerWithFilter in the framework documentation
This action allows to add layers directly to the map by taking them from the Catalogs
- The number of layers should match the number of sources
- The source name must match a catalog service name present in the map
1 2 3 4 5 6