GdkMapLayer: Difference between revisions
Jump to navigation
Jump to search
(Created page with "== About == Used to display maps from the Gdk Map service. ==Setup== <source lang="ts"> interface IGdkMapLayerInfo extends IBaseLayerInfo { LayerType: "GdkMapLayer";...") |
No edit summary |
||
Line 14: | Line 14: | ||
} | } | ||
</source> | </source> | ||
=== Example === | |||
<source lang="ts"> | |||
include {Layers} from "@mariateleplan/map-core" | |||
const gdkMapLayerInfo: Layers.IGdkMapLayerInfo= { | |||
"LayerType": "GdkMapLayer", | |||
"Id": "gdk_map", | |||
"Name": "GDK Imagery", | |||
"ServiceUrl": "http://tpg-mariagdktst/", | |||
"BasemapId": "0b254a7a-ff92-4b98-b6a2-1cfb8d91e9f1", | |||
"Visible": true, | |||
"ParentLayerId": "maps" | |||
} | |||
const layers: Layers.ILayersInfo = { | |||
Services:{}, | |||
Layers:[new Layers.GdkMapLayer(gdkMapLayerInfo);] | |||
} | |||
const props = { | |||
"Zoom": 10, | |||
"Center": [1197567, 8380058], | |||
"Projection": 'EPSG:3857' | |||
} | |||
const mapHtmlId = "map"; | |||
const maria = new MariaCore(props, mapHtmlId) | |||
maria.SetupLayers(layers) | |||
</source> | |||
[[Category:Web]] |
Latest revision as of 09:29, 3 May 2022
About
Used to display maps from the Gdk Map service.
Setup
interface IGdkMapLayerInfo extends IBaseLayerInfo {
LayerType: "GdkMapLayer";
/** Id of basemap to use from the service */
BasemapId: string;
/** URL to GDK map service */
ServiceUrl?: URL; // If not set, use servicessetup
}
Example
include {Layers} from "@mariateleplan/map-core"
const gdkMapLayerInfo: Layers.IGdkMapLayerInfo= {
"LayerType": "GdkMapLayer",
"Id": "gdk_map",
"Name": "GDK Imagery",
"ServiceUrl": "http://tpg-mariagdktst/",
"BasemapId": "0b254a7a-ff92-4b98-b6a2-1cfb8d91e9f1",
"Visible": true,
"ParentLayerId": "maps"
}
const layers: Layers.ILayersInfo = {
Services:{},
Layers:[new Layers.GdkMapLayer(gdkMapLayerInfo);]
}
const props = {
"Zoom": 10,
"Center": [1197567, 8380058],
"Projection": 'EPSG:3857'
}
const mapHtmlId = "map";
const maria = new MariaCore(props, mapHtmlId)
maria.SetupLayers(layers)