GenericMapLayer

From Maria GDK Wiki
Revision as of 09:33, 3 May 2022 by Elu (talk | contribs) (Created page with "== About == Used for displaying maps from a tile map service, with default projection 'EPSG:3857'. ==Setup== <source lang="ts"> nterface IGenericMapLayerInfo extends IBaseL...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

About

Used for displaying maps from a tile map service, with default projection 'EPSG:3857'.

Setup

nterface IGenericMapLayerInfo extends IBaseLayerInfo {
    LayerType: "GenericMapLayer";
    /** URL of tile map service provider, with {x}, {y} and {z} as parameters */
    url: URL;
}

Example

include {Layers} from "@mariateleplan/map-core"
const genericMapLayer: Layers.IGenericMapLayerInfo = {
            "Visible": false,
            "LayerType": "GenericMapLayer",
            "Id": "xyz_generic_map",
            "url": "http://examplehoster/exapmleexample&x={x}&y={y}&z={z}",
            "ParentLayerId": "maps"
}

const layers: Layers.ILayersInfo = {
    Services:{},
    Layers:[new Layers.GdkMapLayer(genericMapLayer);]
}
const props = {   
      "Zoom": 10,
      "Center": [1197567, 8380058],
      "Projection": 'EPSG:3857'
    }
const mapHtmlId = "map";
const maria = new MariaCore(props, mapHtmlId)
maria.SetupLayers(layers)