1- import * as L from 'leaflet' ;
1+ import { Map , Icon , Layer , TileLayer } from 'leaflet' ;
22import 'leaflet/dist/leaflet.css' ;
33import { Geocoder as GeocoderControl } from 'leaflet-control-geocoder' ;
44import 'leaflet-control-geocoder/style.css' ;
@@ -8,17 +8,17 @@ import LeafletHash from './leaflet-fullHash';
88import { CollapsableLayerControl } from './leaflet-collapsable-layer-control' ;
99import './style.css' ;
1010
11- const map = L . map ( 'map' ) . setView ( [ 47.3 , 11.3 ] , 9 ) ;
11+ const map = new Map ( 'map' ) . setView ( [ 47.3 , 11.3 ] , 9 ) ;
1212
1313map . attributionControl . setPrefix ( false ) ;
1414const collapsed = window . matchMedia && window . matchMedia ( 'all and (max-width: 700px)' ) . matches ;
1515const layers = new CollapsableLayerControl ( { } , { } , { collapsed : collapsed } ) . addTo ( map ) ;
1616
17- delete ( L . Icon . Default . prototype as any ) . _getIconUrl ;
17+ delete ( Icon . Default . prototype as any ) . _getIconUrl ;
1818import iconRetinaUrl from 'leaflet/dist/images/marker-icon-2x.png' ;
1919import iconUrl from 'leaflet/dist/images/marker-icon.png' ;
2020import shadowUrl from 'leaflet/dist/images/marker-shadow.png' ;
21- L . Icon . Default . mergeOptions ( {
21+ Icon . Default . mergeOptions ( {
2222 iconRetinaUrl,
2323 iconUrl,
2424 shadowUrl,
@@ -50,15 +50,15 @@ const attributionST_CC0 = [
5050] ;
5151const attributionOsm = '<a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> (ODbL)' ;
5252
53- const allMapLayers : Record < string , L . Layer > = { } ;
53+ const allMapLayers : Record < string , Layer > = { } ;
5454
5555[
5656 { id : 'gdi_base_summer' , title : 'Elektronische Karte Tirol: Sommer' } ,
5757 { id : 'gdi_base_winter' , title : 'Elektronische Karte Tirol: Winter' } ,
5858] . forEach ( ( { id, title} , idx ) => {
5959 const imprint =
6060 '<a href="https://www.tirol.gv.at/statistik-budget/tiris/tiris-geodatendienste/impressum-elektronische-karte-tirol/">Elektronische Karte Tirol</a>' ;
61- const layer = L . tileLayer ( `https://wmts.kartetirol.at/wmts/${ id } /${ id } /{z}/{x}/{y}.jpeg80` , {
61+ const layer = new TileLayer ( `https://wmts.kartetirol.at/wmts/${ id } /${ id } /{z}/{x}/{y}.jpeg80` , {
6262 maxZoom : 18 ,
6363 attribution : [ ...attribution , imprint , attributionOsm ] . join ( ', ' ) ,
6464 } ) ;
@@ -77,7 +77,7 @@ const allMapLayers: Record<string, L.Layer> = {};
7777 title : 'Gelände Tirol: Oberflächenmodell' ,
7878 } ,
7979] . forEach ( ( { id, title} ) => {
80- const layer = L . tileLayer . wms (
80+ const layer = new TileLayer . WMS (
8181 'https://gis.tirol.gv.at/arcgis/services/Service_Public/terrain/MapServer/WMSServer' ,
8282 {
8383 layers : id ,
@@ -107,7 +107,7 @@ const allMapLayers: Record<string, L.Layer> = {};
107107 title : 'Orthofoto Tirol: <abbr title="photographisches Infrarot">CIR</abbr> aktuell' ,
108108 } ,
109109] . forEach ( ( { id, title} ) => {
110- const layer = L . tileLayer . wms (
110+ const layer = new TileLayer . WMS (
111111 'https://gis.tirol.gv.at/arcgis/services/Service_Public/orthofoto/MapServer/WMSServer' ,
112112 {
113113 layers : id ,
@@ -127,7 +127,7 @@ const allMapLayers: Record<string, L.Layer> = {};
127127 { id : 'bmaporthofoto30cm/normal' , title : 'basemap.at Orthofoto' , format : 'jpg' } ,
128128 { id : 'bmapgelaende/grau' , title : 'basemap.at Gelände' , format : 'jpg' } ,
129129] . forEach ( ( { id, title, format} ) => {
130- const layer = L . tileLayer (
130+ const layer = new TileLayer (
131131 `https://mapsneu.wien.gv.at/basemap/${ id } /google3857/{z}/{y}/{x}.${ format } ` ,
132132 {
133133 subdomains : '1234' ,
@@ -143,7 +143,7 @@ const allMapLayers: Record<string, L.Layer> = {};
143143} ) ;
144144
145145[ { id : 'p_bz-BaseMap%3ABasemap-Standard' , title : 'South Tyrol Base Map' } ] . forEach ( ( { id, title} ) => {
146- const layer = L . tileLayer (
146+ const layer = new TileLayer (
147147 `https://geoservices.buergernetz.bz.it/geoserver/gwc/service/wmts/?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=${ id } &STYLE=default&TILEMATRIXSET=GoogleMapsCompatible&TILEMATRIX=GoogleMapsCompatible%3A{z}&TILEROW={y}&TILECOL={x}&FORMAT=image%2Fjpeg` ,
148148 {
149149 maxZoom : 20 ,
@@ -175,7 +175,7 @@ const allMapLayers: Record<string, L.Layer> = {};
175175 // Slope/Hangneigung/Clivometria
176176 } ,
177177] . forEach ( ( { id, title} ) => {
178- const layer = L . tileLayer . wms ( 'https://geoservices1.civis.bz.it/geoserver/p_bz-Elevation/wms' , {
178+ const layer = new TileLayer . WMS ( 'https://geoservices1.civis.bz.it/geoserver/p_bz-Elevation/wms' , {
179179 layers : id ,
180180 format : 'image/jpeg' ,
181181 attribution : attributionST_CC0 . join ( ', ' ) ,
@@ -204,7 +204,7 @@ const allMapLayers: Record<string, L.Layer> = {};
204204 title : 'Orthofoto South Tyrol: 2023 <abbr title="photographisches Infrarot">CIR</abbr>' ,
205205 } ,
206206] . forEach ( ( { id, title} ) => {
207- const layer = L . tileLayer . wms (
207+ const layer = new TileLayer . WMS (
208208 'https://geoservices.buergernetz.bz.it/mapproxy/p_bz-Orthoimagery/wms' ,
209209 {
210210 layers : id ,
@@ -217,13 +217,13 @@ const allMapLayers: Record<string, L.Layer> = {};
217217 allMapLayers [ id ] = layer ;
218218} ) ;
219219
220- allMapLayers [ 'OSM' ] = L . tileLayer ( 'https://tile.openstreetmap.org/{z}/{x}/{y}.png' , {
220+ allMapLayers [ 'OSM' ] = new TileLayer ( 'https://tile.openstreetmap.org/{z}/{x}/{y}.png' , {
221221 maxZoom : 19 ,
222222 attribution : attributionOsm ,
223223} ) ;
224224layers . addBaseLayer ( allMapLayers [ 'OSM' ] , 'OpenStreetMap' ) ;
225225
226- allMapLayers [ 'OpenTopoMap' ] = L . tileLayer ( 'https://tile.opentopomap.org/{z}/{x}/{y}.png' , {
226+ allMapLayers [ 'OpenTopoMap' ] = new TileLayer ( 'https://tile.opentopomap.org/{z}/{x}/{y}.png' , {
227227 maxZoom : 19 ,
228228 attribution : [
229229 attributionOsm ,
@@ -243,7 +243,7 @@ layers.addBaseLayer(allMapLayers['OpenTopoMap'], 'OpenTopoMap');
243243 title : 'Gelände Tirol: Geländeneigung' ,
244244 } ,
245245] . forEach ( ( { id, title} ) => {
246- const layer = L . tileLayer . wms (
246+ const layer = new TileLayer . WMS (
247247 'https://gis.tirol.gv.at/arcgis/services/Service_Public/terrain/MapServer/WMSServer' ,
248248 {
249249 layers : id ,
@@ -259,7 +259,7 @@ layers.addBaseLayer(allMapLayers['OpenTopoMap'], 'OpenTopoMap');
259259 allMapLayers [ id ] = layer ;
260260} ) ;
261261
262- allMapLayers [ 'OpenSlopeMap' ] = L . tileLayer (
262+ allMapLayers [ 'OpenSlopeMap' ] = new TileLayer (
263263 'https://tileserver{s}.openslopemap.org/OSloOVERLAY_LR_All_16/{z}/{x}/{y}.png' ,
264264 {
265265 opacity : 0.7 ,
0 commit comments