new module:maps(mapTarget, initialConfig, serviceURL, mapState, baseLayersState, rootMapGroup, lizmap3)
Create the OpenLayers Map
Parameters:
| Name | Type | Description |
|---|---|---|
mapTarget |
string | The id of the container element for the OpenLayers Map |
initialConfig |
Config | The lizmap initial config instance |
serviceURL |
string | The lizmap service URL |
mapState |
MapState | The lizmap map state |
baseLayersState |
BaseLayersState | The lizmap base layers state |
rootMapGroup |
MapRootState | The lizmap root map group |
lizmap3 |
object | The old lizmap object |
- Source:
Classes
Members
customTileGrid :null|TileGrid
TileGrid configuration when layers is loaded as TileWMS
Type:
- null | TileGrid
- Source:
hidpi :boolean
WMS/TileWMS high dpi support
Type:
- boolean
- Source:
isDragZoomActive :boolean
Is dragZoom active?
Type:
- boolean
- Source:
statesSingleWMSLayers :Map
Key (name) / value (state) Map of layers loaded in a single WMS image
Type:
- Source:
useTileWms :boolean
Map and base Layers are loaded as TileWMS
Type:
- boolean
- Source:
Methods
(async) _setWmtsSourceFromCapabilities(baseLayer, baseLayerState, url, serviceURL)
Replace the source of an external WMTS base layer by one built from its capabilities. If the capabilities cannot be read by the browser (CORS, network, unknown layer) the layer is fetched through QGIS Server instead.
Parameters:
| Name | Type | Description |
|---|---|---|
baseLayer |
TileLayer | the OpenLayers base layer |
baseLayerState |
WmtsBaseLayerState | the WMTS base layer state |
url |
string | the WMTS url |
serviceURL |
string | the lizmap service URL |
- Source:
activateDragZoom()
Activate DragZoom interaction
- Source:
addHighlightFeatures(features, format, projection)
Add highlight features on top of all layer
Parameters:
| Name | Type | Description |
|---|---|---|
features |
string | features as GeoJSON or WKT |
format |
string | format string as |
projection |
string | undefined | optional features projection |
- Source:
addToolLayer(layer)
Adds the given layer to the top of the tools group layers.
Parameters:
| Name | Type | Description |
|---|---|---|
layer |
LayerBase | Layer. |
- Source:
clearHighlightFeatures()
Clear all highlight features
- Source:
deactivateDragZoom()
Deactivate DragZoom interaction
- Source:
getLayerByName(name) → {ImageLayer|undefined}
Return overlay layer if name matches.
name is unique for every layers
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string | The layer name. |
- Source:
Returns:
The OpenLayers layer or undefined
- Type
- ImageLayer | undefined
getLayerOrGroupByName(name) → {ImageLayer|LayerGroup|undefined}
Return overlay layer or group if name matches.
name is unique for every layers/groups
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string | The layer or group name. |
- Source:
Returns:
The OpenLayers layer or OpenLayers group or undefined
- Type
- ImageLayer | LayerGroup | undefined
isSingleWMSLayer(name) → {MapLayerState|undefined}
Return MapLayerState instance of WMS layer or group if the layer is loaded in the single WMS image, undefined if not.
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string | the WMS layer or group name |
- Source:
Returns:
the MapLayerState instance of WMS layer or group if the layer is loaded in the single WMS image or undefined.
- Type
- MapLayerState | undefined
removeToolLayer(layer)
Removes the given layer from the tools group layers.
Parameters:
| Name | Type | Description |
|---|---|---|
layer |
LayerBase | Layer. |
- Source:
setHighlightFeatures(features, format, projection)
Set highlight features on top of all layer
Parameters:
| Name | Type | Description |
|---|---|---|
features |
string | features as GeoJSON or WKT |
format |
string | format string as |
projection |
string | undefined | optional features projection |
- Source:
simulateClick(coordinates, click_typeopt)
Simulate a click on the map
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
coordinates |
Array.<number> | map coordinates |
||
click_type |
string |
<optional> |
'singleclick' | OL map event type ('singleclick', 'click', 'dblclick') |
- Source:
zoomToFid(featureTypeDotId, optionsopt)
Zoom to given feature id
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
featureTypeDotId |
string | The string as |
|
options |
object |
<optional> |
OpenLayers View fit options object https://openlayers.org/en/latest/apidoc/module-ol_View-View.html#fit |
- Source:
zoomToGeometryOrExtent(geometryOrExtent, optionsopt)
Zoom to given geometry or extent
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
geometryOrExtent |
Geometry | Extent | The geometry or extent to zoom to. CRS is 4326 by default. |
|
options |
object |
<optional> |
OpenLayers View fit options object https://openlayers.org/en/latest/apidoc/module-ol_View-View.html#fit |
- Source:
zoomToWkt(wkt, projection, optionsopt)
Zomm to given WKT geometry
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
wkt |
string | The WKT geometry |
|
projection |
string | The projection of the WKT geometry |
|
options |
object |
<optional> |
OpenLayers View fit options object https://openlayers.org/en/latest/apidoc/module-ol_View-View.html#fit |
- Source: