function init(): void { let overlays: OverlayState = OverlayState.load() ?? new OverlayState(); const map = L.map('map').setView([35.6653, -105.9507], 13); const streetLayer = TileLayerWrapper.constructLayer( "streetLayer", L.tileLayer( 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 19, attribution: "street map tiles © OpenStreetMap" })); const satelliteLayer = TileLayerWrapper.constructLayer( "satelliteLayer", L.tileLayer( 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', { maxZoom: 19, attribution: "satellite tiles © Esri" })); TileLayerWrapper.enableOnly("streetLayer", map); overlays.markers.forEach(m=>m.add(map)); overlays.circles.forEach(m=>m.add(map)); overlays.polygons.forEach(m=>m.add(map)); const createOverlayModal = new CreateOverlayModal(); const modals = new ModalCollection( createOverlayModal); MapHandler.init(map, overlays, TileLayerWrapper.layers, modals); MapHandler.setButtonClick("addPoint-btn", MapHandler.markerCollect); MapHandler.setButtonClick("addCircle-btn", MapHandler.circleCollect); MapHandler.setButtonClick("save-btn", MapHandler.overlaySave); MapHandler.setButtonClick("clear-btn", MapHandler.overlayClear); MapHandler.setButtonClick("tiles-btn", MapHandler.swapTiles); } init();