Leaflet/docs/examples/wms/wms-example3.md
chcederquist 9b89ab4eb5
Updated title and descriptions of docs (#9692)
Co-authored-by: Florian Bischof <design.falke@gmail.com>
2025-05-09 18:47:17 +02:00

38 lines
990 B
Markdown

---
layout: tutorial_frame
title: WMS Example 3
---
<script type="module">
import L, {Map, CRS, TileLayer, Control} from 'leaflet';
const map = new Map('map', {
center: [-17, -67],
zoom: 3
});
const basemaps = {
Topography: new TileLayer.WMS('http://ows.mundialis.de/services/service?', {
layers: 'TOPO-WMS'
}),
Places: new TileLayer.WMS('http://ows.mundialis.de/services/service?', {
layers: 'OSM-Overlay-WMS'
}),
'Topography, then places': new TileLayer.WMS('http://ows.mundialis.de/services/service?', {
layers: 'TOPO-WMS,OSM-Overlay-WMS'
}),
'Places, then topography': new TileLayer.WMS('http://ows.mundialis.de/services/service?', {
layers: 'OSM-Overlay-WMS,TOPO-WMS'
})
};
const layerControl = new Control.Layers(basemaps, {}, {collapsed: false}).addTo(map);
basemaps.Topography.addTo(map);
globalThis.L = L; // only for debugging in the developer console
globalThis.map = map; // only for debugging in the developer console
</script>