Optional
advancedAdvanced OpenLayers configuration.
Options in this object are passed to the OlMap's constructor. Other properties defined in this configuration (e.g. initialView) will be applied on top of these map options.
Warning: Not all properties here are supported. For example, you cannot set the
target
because the target is controlled by the<MapContainer />
.
Optional
initialConfigures the initial view. This can be an extent, or a (center, zoom) value.
Optional
layersConfigures the layers of the map.
Layer order
Layers defined in this array are (by default) displayed in their listed order: layers defined first are shown at the bottom, and layers defined at a later position are shown above their predecessors.
Note: base layers are always shown below all operational layers.
Optional
projectionConfigures a specific projection, e.g. "EPSG:4326"
.
Defaults to EPSG:3857
.
To use custom projections, make sure that they are registered first:
import { registerProjections } from "@open-pioneer/map";
// Usually done at the top of the module.
// This will register the projection(s) in proj4's global registry.
registerProjections({
"EPSG:31466": "+proj=tmerc +lat_0=0 +lon_0=6 +k=1 +x_0=2500000 +y_0=0 +ellps=bessel +nadgrids=BETA2007.gsb +units=m +no_defs +type=crs",
// ... more projections
});
// later, use projection: "EPSG:31466"
Options supported during map construction.