Open Pioneer Trails Packages
    Preparing search index...

    Interface MapConfig

    Options supported during map construction.

    interface MapConfig {
        advanced?: Partial<OlMapOptions>;
        initialView?: InitialViewConfig;
        layers?: Layer[];
        projection?:
            | "EPSG:3857"
            | "EPSG:4326"
            | "EPSG:25832"
            | "EPSG:25833"
            | string & {};
    }
    Index

    Properties

    advanced?: Partial<OlMapOptions>

    Advanced 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 />.

    initialView?: InitialViewConfig

    Configures the initial view. This can be an extent, or a (center, zoom) value.

    layers?: Layer[]

    Configures 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.

    projection?:
        | "EPSG:3857"
        | "EPSG:4326"
        | "EPSG:25832"
        | "EPSG:25833"
        | string & {}

    Configures 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"