@mcp-b/geo-leaflet 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{circle-CqXHsyYH.js → circle-BNPIzKH-.js} +3 -2
- package/dist/components/choropleth/choropleth.js +2 -2
- package/dist/components/circle/circle.js +1 -1
- package/dist/components/control/control.js +1 -1
- package/dist/components/geojson/geojson.d.ts +1 -1
- package/dist/components/geojson/geojson.js +1 -1
- package/dist/components/map/map.d.ts +1 -1
- package/dist/components/map/map.js +1 -1
- package/dist/components/marker/marker.d.ts +1 -1
- package/dist/components/marker/marker.js +1 -1
- package/dist/components/polygon/polygon.js +1 -1
- package/dist/components/polyline/polyline.js +1 -1
- package/dist/components/scale-control/scale-control.d.ts +1 -1
- package/dist/components/scale-control/scale-control.js +1 -1
- package/dist/components/tilelayer/tilelayer.js +1 -1
- package/dist/{control-ysNMOWeF.js → control-DvPCCR2e.js} +6 -5
- package/dist/default-icon.js +7 -8
- package/dist/docs/custom-elements.json +1 -1
- package/dist/{geojson-DPaCrjMF.js → geojson-Dlvc_wAg.js} +3 -2
- package/dist/index.js +9 -9
- package/dist/leaflet-src-DkjKLRUt.js +6772 -0
- package/dist/map-DGu4FVda.js +247 -0
- package/dist/{marker-D4gW4fyF.js → marker-RT0-gpae.js} +4 -3
- package/dist/marker-icon-Bv3BCQL8.js +4 -0
- package/dist/{polygon-DbFiHm4R.js → polygon-DtiZDmnC.js} +3 -2
- package/dist/{polyline-SAcEwHDC.js → polyline-C3VgapkC.js} +3 -2
- package/dist/{scale-control-BR_iH4gM.js → scale-control-D5QJFlOJ.js} +3 -2
- package/dist/{tilelayer-DI2cPv01.js → tilelayer-CwHdbtD_.js} +3 -2
- package/package.json +3 -3
- package/dist/map-DzUl12tT.js +0 -240
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { n as __toESM, t as require_leaflet_src } from "./leaflet-src-DkjKLRUt.js";
|
|
2
|
+
import { t as marker_icon_default } from "./marker-icon-Bv3BCQL8.js";
|
|
3
|
+
import { t as __decorate } from "./decorate-DcF3lt7P.js";
|
|
4
|
+
import { css, html, unsafeCSS } from "lit";
|
|
5
|
+
import { customElement, property, query } from "lit/decorators.js";
|
|
6
|
+
import { GeoMapElement } from "@mcp-b/geo-support/base/geo-map-element";
|
|
7
|
+
import { SigveloMapClickEvent, SigveloMapLoadEvent, SigveloMapMoveEndEvent, SigveloMapMoveEvent, SigveloMapZoomEndEvent, SigveloMapZoomEvent } from "@mcp-b/geo-support/events";
|
|
8
|
+
//#region ../../node_modules/.pnpm/leaflet@1.9.4/node_modules/leaflet/dist/leaflet.css?raw
|
|
9
|
+
var import_leaflet_src = /* @__PURE__ */ __toESM(require_leaflet_src(), 1);
|
|
10
|
+
var leaflet_default = "/* required styles */\r\n\r\n.leaflet-pane,\r\n.leaflet-tile,\r\n.leaflet-marker-icon,\r\n.leaflet-marker-shadow,\r\n.leaflet-tile-container,\r\n.leaflet-pane > svg,\r\n.leaflet-pane > canvas,\r\n.leaflet-zoom-box,\r\n.leaflet-image-layer,\r\n.leaflet-layer {\r\n position: absolute;\r\n left: 0;\r\n top: 0;\r\n }\r\n.leaflet-container {\r\n overflow: hidden;\r\n }\r\n.leaflet-tile,\r\n.leaflet-marker-icon,\r\n.leaflet-marker-shadow {\r\n -webkit-user-select: none;\r\n -moz-user-select: none;\r\n user-select: none;\r\n -webkit-user-drag: none;\r\n }\r\n/* Prevents IE11 from highlighting tiles in blue */\r\n.leaflet-tile::selection {\r\n background: transparent;\r\n}\r\n/* Safari renders non-retina tile on retina better with this, but Chrome is worse */\r\n.leaflet-safari .leaflet-tile {\r\n image-rendering: -webkit-optimize-contrast;\r\n }\r\n/* hack that prevents hw layers \"stretching\" when loading new tiles */\r\n.leaflet-safari .leaflet-tile-container {\r\n width: 1600px;\r\n height: 1600px;\r\n -webkit-transform-origin: 0 0;\r\n }\r\n.leaflet-marker-icon,\r\n.leaflet-marker-shadow {\r\n display: block;\r\n }\r\n/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */\r\n/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */\r\n.leaflet-container .leaflet-overlay-pane svg {\r\n max-width: none !important;\r\n max-height: none !important;\r\n }\r\n.leaflet-container .leaflet-marker-pane img,\r\n.leaflet-container .leaflet-shadow-pane img,\r\n.leaflet-container .leaflet-tile-pane img,\r\n.leaflet-container img.leaflet-image-layer,\r\n.leaflet-container .leaflet-tile {\r\n max-width: none !important;\r\n max-height: none !important;\r\n width: auto;\r\n padding: 0;\r\n }\r\n\r\n.leaflet-container img.leaflet-tile {\r\n /* See: https://bugs.chromium.org/p/chromium/issues/detail?id=600120 */\r\n mix-blend-mode: plus-lighter;\r\n}\r\n\r\n.leaflet-container.leaflet-touch-zoom {\r\n -ms-touch-action: pan-x pan-y;\r\n touch-action: pan-x pan-y;\r\n }\r\n.leaflet-container.leaflet-touch-drag {\r\n -ms-touch-action: pinch-zoom;\r\n /* Fallback for FF which doesn't support pinch-zoom */\r\n touch-action: none;\r\n touch-action: pinch-zoom;\r\n}\r\n.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {\r\n -ms-touch-action: none;\r\n touch-action: none;\r\n}\r\n.leaflet-container {\r\n -webkit-tap-highlight-color: transparent;\r\n}\r\n.leaflet-container a {\r\n -webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);\r\n}\r\n.leaflet-tile {\r\n filter: inherit;\r\n visibility: hidden;\r\n }\r\n.leaflet-tile-loaded {\r\n visibility: inherit;\r\n }\r\n.leaflet-zoom-box {\r\n width: 0;\r\n height: 0;\r\n -moz-box-sizing: border-box;\r\n box-sizing: border-box;\r\n z-index: 800;\r\n }\r\n/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */\r\n.leaflet-overlay-pane svg {\r\n -moz-user-select: none;\r\n }\r\n\r\n.leaflet-pane { z-index: 400; }\r\n\r\n.leaflet-tile-pane { z-index: 200; }\r\n.leaflet-overlay-pane { z-index: 400; }\r\n.leaflet-shadow-pane { z-index: 500; }\r\n.leaflet-marker-pane { z-index: 600; }\r\n.leaflet-tooltip-pane { z-index: 650; }\r\n.leaflet-popup-pane { z-index: 700; }\r\n\r\n.leaflet-map-pane canvas { z-index: 100; }\r\n.leaflet-map-pane svg { z-index: 200; }\r\n\r\n.leaflet-vml-shape {\r\n width: 1px;\r\n height: 1px;\r\n }\r\n.lvml {\r\n behavior: url(#default#VML);\r\n display: inline-block;\r\n position: absolute;\r\n }\r\n\r\n\r\n/* control positioning */\r\n\r\n.leaflet-control {\r\n position: relative;\r\n z-index: 800;\r\n pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */\r\n pointer-events: auto;\r\n }\r\n.leaflet-top,\r\n.leaflet-bottom {\r\n position: absolute;\r\n z-index: 1000;\r\n pointer-events: none;\r\n }\r\n.leaflet-top {\r\n top: 0;\r\n }\r\n.leaflet-right {\r\n right: 0;\r\n }\r\n.leaflet-bottom {\r\n bottom: 0;\r\n }\r\n.leaflet-left {\r\n left: 0;\r\n }\r\n.leaflet-control {\r\n float: left;\r\n clear: both;\r\n }\r\n.leaflet-right .leaflet-control {\r\n float: right;\r\n }\r\n.leaflet-top .leaflet-control {\r\n margin-top: 10px;\r\n }\r\n.leaflet-bottom .leaflet-control {\r\n margin-bottom: 10px;\r\n }\r\n.leaflet-left .leaflet-control {\r\n margin-left: 10px;\r\n }\r\n.leaflet-right .leaflet-control {\r\n margin-right: 10px;\r\n }\r\n\r\n\r\n/* zoom and fade animations */\r\n\r\n.leaflet-fade-anim .leaflet-popup {\r\n opacity: 0;\r\n -webkit-transition: opacity 0.2s linear;\r\n -moz-transition: opacity 0.2s linear;\r\n transition: opacity 0.2s linear;\r\n }\r\n.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {\r\n opacity: 1;\r\n }\r\n.leaflet-zoom-animated {\r\n -webkit-transform-origin: 0 0;\r\n -ms-transform-origin: 0 0;\r\n transform-origin: 0 0;\r\n }\r\nsvg.leaflet-zoom-animated {\r\n will-change: transform;\r\n}\r\n\r\n.leaflet-zoom-anim .leaflet-zoom-animated {\r\n -webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);\r\n -moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);\r\n transition: transform 0.25s cubic-bezier(0,0,0.25,1);\r\n }\r\n.leaflet-zoom-anim .leaflet-tile,\r\n.leaflet-pan-anim .leaflet-tile {\r\n -webkit-transition: none;\r\n -moz-transition: none;\r\n transition: none;\r\n }\r\n\r\n.leaflet-zoom-anim .leaflet-zoom-hide {\r\n visibility: hidden;\r\n }\r\n\r\n\r\n/* cursors */\r\n\r\n.leaflet-interactive {\r\n cursor: pointer;\r\n }\r\n.leaflet-grab {\r\n cursor: -webkit-grab;\r\n cursor: -moz-grab;\r\n cursor: grab;\r\n }\r\n.leaflet-crosshair,\r\n.leaflet-crosshair .leaflet-interactive {\r\n cursor: crosshair;\r\n }\r\n.leaflet-popup-pane,\r\n.leaflet-control {\r\n cursor: auto;\r\n }\r\n.leaflet-dragging .leaflet-grab,\r\n.leaflet-dragging .leaflet-grab .leaflet-interactive,\r\n.leaflet-dragging .leaflet-marker-draggable {\r\n cursor: move;\r\n cursor: -webkit-grabbing;\r\n cursor: -moz-grabbing;\r\n cursor: grabbing;\r\n }\r\n\r\n/* marker & overlays interactivity */\r\n.leaflet-marker-icon,\r\n.leaflet-marker-shadow,\r\n.leaflet-image-layer,\r\n.leaflet-pane > svg path,\r\n.leaflet-tile-container {\r\n pointer-events: none;\r\n }\r\n\r\n.leaflet-marker-icon.leaflet-interactive,\r\n.leaflet-image-layer.leaflet-interactive,\r\n.leaflet-pane > svg path.leaflet-interactive,\r\nsvg.leaflet-image-layer.leaflet-interactive path {\r\n pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */\r\n pointer-events: auto;\r\n }\r\n\r\n/* visual tweaks */\r\n\r\n.leaflet-container {\r\n background: #ddd;\r\n outline-offset: 1px;\r\n }\r\n.leaflet-container a {\r\n color: #0078A8;\r\n }\r\n.leaflet-zoom-box {\r\n border: 2px dotted #38f;\r\n background: rgba(255,255,255,0.5);\r\n }\r\n\r\n\r\n/* general typography */\r\n.leaflet-container {\r\n font-family: \"Helvetica Neue\", Arial, Helvetica, sans-serif;\r\n font-size: 12px;\r\n font-size: 0.75rem;\r\n line-height: 1.5;\r\n }\r\n\r\n\r\n/* general toolbar styles */\r\n\r\n.leaflet-bar {\r\n box-shadow: 0 1px 5px rgba(0,0,0,0.65);\r\n border-radius: 4px;\r\n }\r\n.leaflet-bar a {\r\n background-color: #fff;\r\n border-bottom: 1px solid #ccc;\r\n width: 26px;\r\n height: 26px;\r\n line-height: 26px;\r\n display: block;\r\n text-align: center;\r\n text-decoration: none;\r\n color: black;\r\n }\r\n.leaflet-bar a,\r\n.leaflet-control-layers-toggle {\r\n background-position: 50% 50%;\r\n background-repeat: no-repeat;\r\n display: block;\r\n }\r\n.leaflet-bar a:hover,\r\n.leaflet-bar a:focus {\r\n background-color: #f4f4f4;\r\n }\r\n.leaflet-bar a:first-child {\r\n border-top-left-radius: 4px;\r\n border-top-right-radius: 4px;\r\n }\r\n.leaflet-bar a:last-child {\r\n border-bottom-left-radius: 4px;\r\n border-bottom-right-radius: 4px;\r\n border-bottom: none;\r\n }\r\n.leaflet-bar a.leaflet-disabled {\r\n cursor: default;\r\n background-color: #f4f4f4;\r\n color: #bbb;\r\n }\r\n\r\n.leaflet-touch .leaflet-bar a {\r\n width: 30px;\r\n height: 30px;\r\n line-height: 30px;\r\n }\r\n.leaflet-touch .leaflet-bar a:first-child {\r\n border-top-left-radius: 2px;\r\n border-top-right-radius: 2px;\r\n }\r\n.leaflet-touch .leaflet-bar a:last-child {\r\n border-bottom-left-radius: 2px;\r\n border-bottom-right-radius: 2px;\r\n }\r\n\r\n/* zoom control */\r\n\r\n.leaflet-control-zoom-in,\r\n.leaflet-control-zoom-out {\r\n font: bold 18px 'Lucida Console', Monaco, monospace;\r\n text-indent: 1px;\r\n }\r\n\r\n.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {\r\n font-size: 22px;\r\n }\r\n\r\n\r\n/* layers control */\r\n\r\n.leaflet-control-layers {\r\n box-shadow: 0 1px 5px rgba(0,0,0,0.4);\r\n background: #fff;\r\n border-radius: 5px;\r\n }\r\n.leaflet-control-layers-toggle {\r\n background-image: url(images/layers.png);\r\n width: 36px;\r\n height: 36px;\r\n }\r\n.leaflet-retina .leaflet-control-layers-toggle {\r\n background-image: url(images/layers-2x.png);\r\n background-size: 26px 26px;\r\n }\r\n.leaflet-touch .leaflet-control-layers-toggle {\r\n width: 44px;\r\n height: 44px;\r\n }\r\n.leaflet-control-layers .leaflet-control-layers-list,\r\n.leaflet-control-layers-expanded .leaflet-control-layers-toggle {\r\n display: none;\r\n }\r\n.leaflet-control-layers-expanded .leaflet-control-layers-list {\r\n display: block;\r\n position: relative;\r\n }\r\n.leaflet-control-layers-expanded {\r\n padding: 6px 10px 6px 6px;\r\n color: #333;\r\n background: #fff;\r\n }\r\n.leaflet-control-layers-scrollbar {\r\n overflow-y: scroll;\r\n overflow-x: hidden;\r\n padding-right: 5px;\r\n }\r\n.leaflet-control-layers-selector {\r\n margin-top: 2px;\r\n position: relative;\r\n top: 1px;\r\n }\r\n.leaflet-control-layers label {\r\n display: block;\r\n font-size: 13px;\r\n font-size: 1.08333em;\r\n }\r\n.leaflet-control-layers-separator {\r\n height: 0;\r\n border-top: 1px solid #ddd;\r\n margin: 5px -10px 5px -6px;\r\n }\r\n\r\n/* Default icon URLs */\r\n.leaflet-default-icon-path { /* used only in path-guessing heuristic, see L.Icon.Default */\r\n background-image: url(images/marker-icon.png);\r\n }\r\n\r\n\r\n/* attribution and scale controls */\r\n\r\n.leaflet-container .leaflet-control-attribution {\r\n background: #fff;\r\n background: rgba(255, 255, 255, 0.8);\r\n margin: 0;\r\n }\r\n.leaflet-control-attribution,\r\n.leaflet-control-scale-line {\r\n padding: 0 5px;\r\n color: #333;\r\n line-height: 1.4;\r\n }\r\n.leaflet-control-attribution a {\r\n text-decoration: none;\r\n }\r\n.leaflet-control-attribution a:hover,\r\n.leaflet-control-attribution a:focus {\r\n text-decoration: underline;\r\n }\r\n.leaflet-attribution-flag {\r\n display: inline !important;\r\n vertical-align: baseline !important;\r\n width: 1em;\r\n height: 0.6669em;\r\n }\r\n.leaflet-left .leaflet-control-scale {\r\n margin-left: 5px;\r\n }\r\n.leaflet-bottom .leaflet-control-scale {\r\n margin-bottom: 5px;\r\n }\r\n.leaflet-control-scale-line {\r\n border: 2px solid #777;\r\n border-top: none;\r\n line-height: 1.1;\r\n padding: 2px 5px 1px;\r\n white-space: nowrap;\r\n -moz-box-sizing: border-box;\r\n box-sizing: border-box;\r\n background: rgba(255, 255, 255, 0.8);\r\n text-shadow: 1px 1px #fff;\r\n }\r\n.leaflet-control-scale-line:not(:first-child) {\r\n border-top: 2px solid #777;\r\n border-bottom: none;\r\n margin-top: -2px;\r\n }\r\n.leaflet-control-scale-line:not(:first-child):not(:last-child) {\r\n border-bottom: 2px solid #777;\r\n }\r\n\r\n.leaflet-touch .leaflet-control-attribution,\r\n.leaflet-touch .leaflet-control-layers,\r\n.leaflet-touch .leaflet-bar {\r\n box-shadow: none;\r\n }\r\n.leaflet-touch .leaflet-control-layers,\r\n.leaflet-touch .leaflet-bar {\r\n border: 2px solid rgba(0,0,0,0.2);\r\n background-clip: padding-box;\r\n }\r\n\r\n\r\n/* popup */\r\n\r\n.leaflet-popup {\r\n position: absolute;\r\n text-align: center;\r\n margin-bottom: 20px;\r\n }\r\n.leaflet-popup-content-wrapper {\r\n padding: 1px;\r\n text-align: left;\r\n border-radius: 12px;\r\n }\r\n.leaflet-popup-content {\r\n margin: 13px 24px 13px 20px;\r\n line-height: 1.3;\r\n font-size: 13px;\r\n font-size: 1.08333em;\r\n min-height: 1px;\r\n }\r\n.leaflet-popup-content p {\r\n margin: 17px 0;\r\n margin: 1.3em 0;\r\n }\r\n.leaflet-popup-tip-container {\r\n width: 40px;\r\n height: 20px;\r\n position: absolute;\r\n left: 50%;\r\n margin-top: -1px;\r\n margin-left: -20px;\r\n overflow: hidden;\r\n pointer-events: none;\r\n }\r\n.leaflet-popup-tip {\r\n width: 17px;\r\n height: 17px;\r\n padding: 1px;\r\n\r\n margin: -10px auto 0;\r\n pointer-events: auto;\r\n\r\n -webkit-transform: rotate(45deg);\r\n -moz-transform: rotate(45deg);\r\n -ms-transform: rotate(45deg);\r\n transform: rotate(45deg);\r\n }\r\n.leaflet-popup-content-wrapper,\r\n.leaflet-popup-tip {\r\n background: white;\r\n color: #333;\r\n box-shadow: 0 3px 14px rgba(0,0,0,0.4);\r\n }\r\n.leaflet-container a.leaflet-popup-close-button {\r\n position: absolute;\r\n top: 0;\r\n right: 0;\r\n border: none;\r\n text-align: center;\r\n width: 24px;\r\n height: 24px;\r\n font: 16px/24px Tahoma, Verdana, sans-serif;\r\n color: #757575;\r\n text-decoration: none;\r\n background: transparent;\r\n }\r\n.leaflet-container a.leaflet-popup-close-button:hover,\r\n.leaflet-container a.leaflet-popup-close-button:focus {\r\n color: #585858;\r\n }\r\n.leaflet-popup-scrolled {\r\n overflow: auto;\r\n }\r\n\r\n.leaflet-oldie .leaflet-popup-content-wrapper {\r\n -ms-zoom: 1;\r\n }\r\n.leaflet-oldie .leaflet-popup-tip {\r\n width: 24px;\r\n margin: 0 auto;\r\n\r\n -ms-filter: \"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)\";\r\n filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);\r\n }\r\n\r\n.leaflet-oldie .leaflet-control-zoom,\r\n.leaflet-oldie .leaflet-control-layers,\r\n.leaflet-oldie .leaflet-popup-content-wrapper,\r\n.leaflet-oldie .leaflet-popup-tip {\r\n border: 1px solid #999;\r\n }\r\n\r\n\r\n/* div icon */\r\n\r\n.leaflet-div-icon {\r\n background: #fff;\r\n border: 1px solid #666;\r\n }\r\n\r\n\r\n/* Tooltip */\r\n/* Base styles for the element that has a tooltip */\r\n.leaflet-tooltip {\r\n position: absolute;\r\n padding: 6px;\r\n background-color: #fff;\r\n border: 1px solid #fff;\r\n border-radius: 3px;\r\n color: #222;\r\n white-space: nowrap;\r\n -webkit-user-select: none;\r\n -moz-user-select: none;\r\n -ms-user-select: none;\r\n user-select: none;\r\n pointer-events: none;\r\n box-shadow: 0 1px 3px rgba(0,0,0,0.4);\r\n }\r\n.leaflet-tooltip.leaflet-interactive {\r\n cursor: pointer;\r\n pointer-events: auto;\r\n }\r\n.leaflet-tooltip-top:before,\r\n.leaflet-tooltip-bottom:before,\r\n.leaflet-tooltip-left:before,\r\n.leaflet-tooltip-right:before {\r\n position: absolute;\r\n pointer-events: none;\r\n border: 6px solid transparent;\r\n background: transparent;\r\n content: \"\";\r\n }\r\n\r\n/* Directions */\r\n\r\n.leaflet-tooltip-bottom {\r\n margin-top: 6px;\r\n}\r\n.leaflet-tooltip-top {\r\n margin-top: -6px;\r\n}\r\n.leaflet-tooltip-bottom:before,\r\n.leaflet-tooltip-top:before {\r\n left: 50%;\r\n margin-left: -6px;\r\n }\r\n.leaflet-tooltip-top:before {\r\n bottom: 0;\r\n margin-bottom: -12px;\r\n border-top-color: #fff;\r\n }\r\n.leaflet-tooltip-bottom:before {\r\n top: 0;\r\n margin-top: -12px;\r\n margin-left: -6px;\r\n border-bottom-color: #fff;\r\n }\r\n.leaflet-tooltip-left {\r\n margin-left: -6px;\r\n}\r\n.leaflet-tooltip-right {\r\n margin-left: 6px;\r\n}\r\n.leaflet-tooltip-left:before,\r\n.leaflet-tooltip-right:before {\r\n top: 50%;\r\n margin-top: -6px;\r\n }\r\n.leaflet-tooltip-left:before {\r\n right: 0;\r\n margin-right: -12px;\r\n border-left-color: #fff;\r\n }\r\n.leaflet-tooltip-right:before {\r\n left: 0;\r\n margin-left: -12px;\r\n border-right-color: #fff;\r\n }\r\n\r\n/* Printing */\r\n\r\n@media print {\r\n /* Prevent printers from removing background-images of controls. */\r\n .leaflet-control {\r\n -webkit-print-color-adjust: exact;\r\n print-color-adjust: exact;\r\n }\r\n }\r\n";
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region ../../node_modules/.pnpm/leaflet@1.9.4/node_modules/leaflet/dist/images/layers.png
|
|
13
|
+
var layers_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC";
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region ../../node_modules/.pnpm/leaflet@1.9.4/node_modules/leaflet/dist/images/layers-2x.png
|
|
16
|
+
var layers_2x_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=";
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/components/map/map.styles.ts
|
|
19
|
+
var map_styles_default = css`
|
|
20
|
+
:host {
|
|
21
|
+
display: block;
|
|
22
|
+
position: relative;
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
min-height: 300px;
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
border: 1px solid var(--sigvelo-color-neutral-border-muted, rgb(255 255 255 / 15%));
|
|
27
|
+
border-radius: var(--sigvelo-radius-md, 8px);
|
|
28
|
+
background: var(--sigvelo-color-surface-sunken, #171717);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.map-layout {
|
|
32
|
+
position: absolute;
|
|
33
|
+
inset: 0;
|
|
34
|
+
display: grid;
|
|
35
|
+
grid-template-rows: minmax(0, 1fr) auto;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.map-layout > .map-host {
|
|
39
|
+
position: relative;
|
|
40
|
+
inset: auto;
|
|
41
|
+
min-height: 0;
|
|
42
|
+
height: auto;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.leaflet-container {
|
|
46
|
+
border-radius: 0;
|
|
47
|
+
background: var(--sigvelo-color-surface-sunken, #171717);
|
|
48
|
+
font-family: inherit;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/*
|
|
52
|
+
* Leaflet ships its attribution link at #0078a8 on #333, which is 2.55:1
|
|
53
|
+
* against the surrounding text — below the 3:1 WCAG requires of a link
|
|
54
|
+
* distinguished by colour alone. This sheet is applied after Leaflet's, so
|
|
55
|
+
* underlining it satisfies the rule without depending on hue, and the
|
|
56
|
+
* control picks up the active theme instead of Leaflet's fixed palette.
|
|
57
|
+
*/
|
|
58
|
+
.attribution-footer {
|
|
59
|
+
display: flex;
|
|
60
|
+
box-sizing: border-box;
|
|
61
|
+
width: 100%;
|
|
62
|
+
min-width: 0;
|
|
63
|
+
justify-content: flex-end;
|
|
64
|
+
border-top: 1px solid var(--sigvelo-color-neutral-border-muted, rgb(255 255 255 / 15%));
|
|
65
|
+
color: var(--sigvelo-color-text-muted, #b4b4b4);
|
|
66
|
+
background: var(--sigvelo-color-surface, #181818);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.attribution-footer .leaflet-control-attribution {
|
|
70
|
+
float: none;
|
|
71
|
+
box-sizing: border-box;
|
|
72
|
+
width: 100%;
|
|
73
|
+
max-width: none;
|
|
74
|
+
margin: 0;
|
|
75
|
+
padding: 4px 8px;
|
|
76
|
+
border: 0;
|
|
77
|
+
border-radius: 0;
|
|
78
|
+
color: var(--sigvelo-color-text-muted, #b4b4b4);
|
|
79
|
+
background: transparent;
|
|
80
|
+
box-shadow: none;
|
|
81
|
+
font-size: 11px;
|
|
82
|
+
line-height: 1.35;
|
|
83
|
+
text-align: right;
|
|
84
|
+
white-space: normal;
|
|
85
|
+
pointer-events: auto;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.attribution-footer .leaflet-control-attribution a {
|
|
89
|
+
color: var(--sigvelo-color-primary-text, #ececec);
|
|
90
|
+
text-decoration: underline;
|
|
91
|
+
text-underline-offset: 2px;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.leaflet-container .leaflet-bar {
|
|
95
|
+
overflow: hidden;
|
|
96
|
+
border: 1px solid var(--sigvelo-color-neutral-border-muted, rgb(255 255 255 / 15%));
|
|
97
|
+
border-radius: var(--sigvelo-radius-sm, 4px);
|
|
98
|
+
box-shadow: 0 1px 4px rgb(0 0 0 / 25%);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.leaflet-container .leaflet-bar a,
|
|
102
|
+
.leaflet-container .leaflet-bar a:hover {
|
|
103
|
+
border-bottom-color: var(--sigvelo-color-neutral-border-muted, rgb(255 255 255 / 15%));
|
|
104
|
+
color: var(--sigvelo-color-text, #ececec);
|
|
105
|
+
background: var(--sigvelo-color-surface, #181818);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.leaflet-container .leaflet-bar a:hover {
|
|
109
|
+
background: var(--sigvelo-color-surface-raised, #282828);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.leaflet-container .leaflet-popup-content-wrapper,
|
|
113
|
+
.leaflet-container .leaflet-popup-tip {
|
|
114
|
+
color: #171717;
|
|
115
|
+
background: #fcfcfc;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.leaflet-container .leaflet-popup-close-button,
|
|
119
|
+
.leaflet-container .leaflet-popup-close-button:hover {
|
|
120
|
+
color: #595959;
|
|
121
|
+
}
|
|
122
|
+
`;
|
|
123
|
+
//#endregion
|
|
124
|
+
//#region src/components/map/map.ts
|
|
125
|
+
const leafletCssWithAssets = leaflet_default.replace(/url\(images\/layers-2x\.png\)/g, `url(${layers_2x_default})`).replace(/url\(images\/layers\.png\)/g, `url(${layers_default})`).replace(/url\(images\/marker-icon\.png\)/g, `url(${marker_icon_default})`);
|
|
126
|
+
let SigveloLeafletMap = class SigveloLeafletMap extends GeoMapElement {
|
|
127
|
+
constructor(..._args) {
|
|
128
|
+
super(..._args);
|
|
129
|
+
this.zoomControl = true;
|
|
130
|
+
this.attributionControl = true;
|
|
131
|
+
this._map = null;
|
|
132
|
+
}
|
|
133
|
+
static {
|
|
134
|
+
this.styles = [
|
|
135
|
+
...GeoMapElement.styles,
|
|
136
|
+
unsafeCSS(leafletCssWithAssets),
|
|
137
|
+
map_styles_default
|
|
138
|
+
];
|
|
139
|
+
}
|
|
140
|
+
/** Access the underlying Leaflet map instance (after mapReady resolves). */
|
|
141
|
+
get map() {
|
|
142
|
+
return this._map;
|
|
143
|
+
}
|
|
144
|
+
createMap(container) {
|
|
145
|
+
this._map = import_leaflet_src.map(container, {
|
|
146
|
+
center: [this.latitude, this.longitude],
|
|
147
|
+
zoom: this.zoom,
|
|
148
|
+
minZoom: this.minZoom,
|
|
149
|
+
maxZoom: this.maxZoom,
|
|
150
|
+
zoomControl: this.zoomControl,
|
|
151
|
+
attributionControl: this.attributionControl
|
|
152
|
+
});
|
|
153
|
+
if (this.attributionControl) {
|
|
154
|
+
const attribution = this._map.attributionControl.getContainer();
|
|
155
|
+
if (attribution && this.attributionFooter) this.attributionFooter.append(attribution);
|
|
156
|
+
}
|
|
157
|
+
this._map.on("click", (e) => {
|
|
158
|
+
this.dispatchEvent(new SigveloMapClickEvent({
|
|
159
|
+
lat: e.latlng.lat,
|
|
160
|
+
lng: e.latlng.lng
|
|
161
|
+
}, e.originalEvent));
|
|
162
|
+
});
|
|
163
|
+
this._map.on("move", () => {
|
|
164
|
+
if (!this._map) return;
|
|
165
|
+
const center = this._map.getCenter();
|
|
166
|
+
this._suppressExternalUpdate = true;
|
|
167
|
+
this.latitude = center.lat;
|
|
168
|
+
this.longitude = center.lng;
|
|
169
|
+
this._suppressExternalUpdate = false;
|
|
170
|
+
this.dispatchEvent(new SigveloMapMoveEvent({
|
|
171
|
+
lat: center.lat,
|
|
172
|
+
lng: center.lng
|
|
173
|
+
}));
|
|
174
|
+
});
|
|
175
|
+
this._map.on("moveend", () => {
|
|
176
|
+
if (!this._map) return;
|
|
177
|
+
const center = this._map.getCenter();
|
|
178
|
+
this.dispatchEvent(new SigveloMapMoveEndEvent({
|
|
179
|
+
lat: center.lat,
|
|
180
|
+
lng: center.lng
|
|
181
|
+
}));
|
|
182
|
+
});
|
|
183
|
+
this._map.on("zoom", () => {
|
|
184
|
+
if (!this._map) return;
|
|
185
|
+
const zoom = this._map.getZoom();
|
|
186
|
+
this._suppressExternalUpdate = true;
|
|
187
|
+
this.zoom = zoom;
|
|
188
|
+
this._suppressExternalUpdate = false;
|
|
189
|
+
this.dispatchEvent(new SigveloMapZoomEvent(zoom));
|
|
190
|
+
});
|
|
191
|
+
this._map.on("zoomend", () => {
|
|
192
|
+
if (!this._map) return;
|
|
193
|
+
this.dispatchEvent(new SigveloMapZoomEndEvent(this._map.getZoom()));
|
|
194
|
+
});
|
|
195
|
+
this._map.whenReady(() => {
|
|
196
|
+
this._resolveMapReady();
|
|
197
|
+
this.dispatchEvent(new SigveloMapLoadEvent());
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
destroyMap() {
|
|
201
|
+
this._map?.remove();
|
|
202
|
+
this._map = null;
|
|
203
|
+
}
|
|
204
|
+
updateView(changed) {
|
|
205
|
+
if (!this._map) return;
|
|
206
|
+
if (changed.has("latitude") || changed.has("longitude") || changed.has("zoom")) this._map.setView([this.latitude, this.longitude], this.zoom);
|
|
207
|
+
if (changed.has("minZoom")) this._map.setMinZoom(this.minZoom);
|
|
208
|
+
if (changed.has("maxZoom")) this._map.setMaxZoom(this.maxZoom);
|
|
209
|
+
}
|
|
210
|
+
invalidateSize() {
|
|
211
|
+
this._map?.invalidateSize();
|
|
212
|
+
}
|
|
213
|
+
flyTo(options) {
|
|
214
|
+
this._map?.flyTo([options.center.lat, options.center.lng], options.zoom, { duration: options.duration ? options.duration / 1e3 : void 0 });
|
|
215
|
+
}
|
|
216
|
+
fitBounds(options) {
|
|
217
|
+
this._map?.fitBounds([[options.bounds.south, options.bounds.west], [options.bounds.north, options.bounds.east]], {
|
|
218
|
+
padding: options.padding ? [options.padding, options.padding] : void 0,
|
|
219
|
+
maxZoom: options.maxZoom
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
render() {
|
|
223
|
+
return html`
|
|
224
|
+
<div class="map-layout">
|
|
225
|
+
<div class="map-host" part="map"></div>
|
|
226
|
+
${this.attributionControl ? html`<footer
|
|
227
|
+
class="attribution-footer"
|
|
228
|
+
part="attribution"
|
|
229
|
+
aria-label="Map attribution"
|
|
230
|
+
></footer>` : null}
|
|
231
|
+
</div>
|
|
232
|
+
<slot></slot>
|
|
233
|
+
`;
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
__decorate([property({
|
|
237
|
+
attribute: "zoom-control",
|
|
238
|
+
type: Boolean
|
|
239
|
+
})], SigveloLeafletMap.prototype, "zoomControl", void 0);
|
|
240
|
+
__decorate([property({
|
|
241
|
+
attribute: "attribution-control",
|
|
242
|
+
type: Boolean
|
|
243
|
+
})], SigveloLeafletMap.prototype, "attributionControl", void 0);
|
|
244
|
+
__decorate([query(".attribution-footer")], SigveloLeafletMap.prototype, "attributionFooter", void 0);
|
|
245
|
+
SigveloLeafletMap = __decorate([customElement("sigvelo-leaflet-map")], SigveloLeafletMap);
|
|
246
|
+
//#endregion
|
|
247
|
+
export { SigveloLeafletMap as t };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { n as __toESM, t as require_leaflet_src } from "./leaflet-src-DkjKLRUt.js";
|
|
1
2
|
import "./default-icon.js";
|
|
2
3
|
import { t as __decorate } from "./decorate-DcF3lt7P.js";
|
|
3
4
|
import { findLeafletMap } from "./components/find-leaflet-map.js";
|
|
4
|
-
import * as L from "leaflet";
|
|
5
5
|
import { LitElement, css, html } from "lit";
|
|
6
6
|
import { customElement, property } from "lit/decorators.js";
|
|
7
7
|
//#region src/components/marker/marker.styles.ts
|
|
8
|
+
var import_leaflet_src = /* @__PURE__ */ __toESM(require_leaflet_src(), 1);
|
|
8
9
|
var marker_styles_default = css`
|
|
9
10
|
:host {
|
|
10
11
|
display: none;
|
|
@@ -55,13 +56,13 @@ let SigveloLeafletMarker = class SigveloLeafletMarker extends LitElement {
|
|
|
55
56
|
draggable: this.draggable,
|
|
56
57
|
opacity: this.opacity
|
|
57
58
|
};
|
|
58
|
-
if (this.iconUrl) options.icon =
|
|
59
|
+
if (this.iconUrl) options.icon = import_leaflet_src.icon({
|
|
59
60
|
iconUrl: this.iconUrl,
|
|
60
61
|
iconSize: [this.iconWidth, this.iconHeight],
|
|
61
62
|
iconAnchor: [this.iconWidth / 2, this.iconHeight],
|
|
62
63
|
popupAnchor: [0, -this.iconHeight]
|
|
63
64
|
});
|
|
64
|
-
this._marker =
|
|
65
|
+
this._marker = import_leaflet_src.marker([this.latitude, this.longitude], options).addTo(this._mapEl.map);
|
|
65
66
|
this._bindChildPopup();
|
|
66
67
|
this._marker.on("dragend", () => {
|
|
67
68
|
if (!this._marker) return;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/leaflet@1.9.4/node_modules/leaflet/dist/images/marker-icon.png
|
|
2
|
+
var marker_icon_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { marker_icon_default as t };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { n as __toESM, t as require_leaflet_src } from "./leaflet-src-DkjKLRUt.js";
|
|
1
2
|
import { t as __decorate } from "./decorate-DcF3lt7P.js";
|
|
2
3
|
import { findLeafletMap } from "./components/find-leaflet-map.js";
|
|
3
|
-
import * as L from "leaflet";
|
|
4
4
|
import { LitElement, css, html } from "lit";
|
|
5
5
|
import { customElement, property } from "lit/decorators.js";
|
|
6
6
|
//#region src/components/polygon/polygon.styles.ts
|
|
7
|
+
var import_leaflet_src = /* @__PURE__ */ __toESM(require_leaflet_src(), 1);
|
|
7
8
|
var polygon_styles_default = css`
|
|
8
9
|
:host {
|
|
9
10
|
display: none;
|
|
@@ -41,7 +42,7 @@ let SigveloLeafletPolygon = class SigveloLeafletPolygon extends LitElement {
|
|
|
41
42
|
/** @internal */
|
|
42
43
|
_addPolygon() {
|
|
43
44
|
if (!this._mapEl?.map) return;
|
|
44
|
-
this._polygon =
|
|
45
|
+
this._polygon = import_leaflet_src.polygon(this.positions, {
|
|
45
46
|
fillColor: this.fillColor,
|
|
46
47
|
fillOpacity: this.fillOpacity,
|
|
47
48
|
color: this.strokeColor,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { n as __toESM, t as require_leaflet_src } from "./leaflet-src-DkjKLRUt.js";
|
|
1
2
|
import { t as __decorate } from "./decorate-DcF3lt7P.js";
|
|
2
3
|
import { findLeafletMap } from "./components/find-leaflet-map.js";
|
|
3
|
-
import * as L from "leaflet";
|
|
4
4
|
import { LitElement, css, html } from "lit";
|
|
5
5
|
import { customElement, property } from "lit/decorators.js";
|
|
6
6
|
//#region src/components/polyline/polyline.styles.ts
|
|
7
|
+
var import_leaflet_src = /* @__PURE__ */ __toESM(require_leaflet_src(), 1);
|
|
7
8
|
var polyline_styles_default = css`
|
|
8
9
|
:host {
|
|
9
10
|
display: none;
|
|
@@ -41,7 +42,7 @@ let SigveloLeafletPolyline = class SigveloLeafletPolyline extends LitElement {
|
|
|
41
42
|
/** @internal */
|
|
42
43
|
_addPolyline() {
|
|
43
44
|
if (!this._mapEl?.map) return;
|
|
44
|
-
this._polyline =
|
|
45
|
+
this._polyline = import_leaflet_src.polyline(this.positions, {
|
|
45
46
|
color: this.color,
|
|
46
47
|
weight: this.weight,
|
|
47
48
|
opacity: this.opacity,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { n as __toESM, t as require_leaflet_src } from "./leaflet-src-DkjKLRUt.js";
|
|
1
2
|
import { t as __decorate } from "./decorate-DcF3lt7P.js";
|
|
2
3
|
import { findLeafletMap } from "./components/find-leaflet-map.js";
|
|
3
|
-
import * as L from "leaflet";
|
|
4
4
|
import { LitElement, css, html } from "lit";
|
|
5
5
|
import { customElement, property } from "lit/decorators.js";
|
|
6
6
|
//#region src/components/scale-control/scale-control.styles.ts
|
|
7
|
+
var import_leaflet_src = /* @__PURE__ */ __toESM(require_leaflet_src(), 1);
|
|
7
8
|
var scale_control_styles_default = css`
|
|
8
9
|
:host {
|
|
9
10
|
display: none;
|
|
@@ -40,7 +41,7 @@ let SigveloLeafletScaleControl = class SigveloLeafletScaleControl extends LitEle
|
|
|
40
41
|
/** @internal */
|
|
41
42
|
_addControl() {
|
|
42
43
|
if (!this._mapEl?.map) return;
|
|
43
|
-
this._control =
|
|
44
|
+
this._control = import_leaflet_src.control.scale({
|
|
44
45
|
position: this.position,
|
|
45
46
|
metric: this.metric,
|
|
46
47
|
imperial: this.imperial,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { n as __toESM, t as require_leaflet_src } from "./leaflet-src-DkjKLRUt.js";
|
|
1
2
|
import { t as __decorate } from "./decorate-DcF3lt7P.js";
|
|
2
3
|
import { findLeafletMap } from "./components/find-leaflet-map.js";
|
|
3
|
-
import * as L from "leaflet";
|
|
4
4
|
import { LitElement, css, html } from "lit";
|
|
5
5
|
import { customElement, property } from "lit/decorators.js";
|
|
6
6
|
//#region src/components/tilelayer/tilelayer.styles.ts
|
|
7
|
+
var import_leaflet_src = /* @__PURE__ */ __toESM(require_leaflet_src(), 1);
|
|
7
8
|
var tilelayer_styles_default = css`
|
|
8
9
|
:host {
|
|
9
10
|
display: none;
|
|
@@ -41,7 +42,7 @@ let SigveloLeafletTilelayer = class SigveloLeafletTilelayer extends LitElement {
|
|
|
41
42
|
/** @internal */
|
|
42
43
|
_addLayer() {
|
|
43
44
|
if (!this._mapEl?.map || !this.url) return;
|
|
44
|
-
this._layer =
|
|
45
|
+
this._layer = import_leaflet_src.tileLayer(this.url, {
|
|
45
46
|
attribution: this.attribution,
|
|
46
47
|
minZoom: this.minZoom,
|
|
47
48
|
maxZoom: this.maxZoom,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcp-b/geo-leaflet",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Leaflet web components for Sigvelo, built with Lit.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"custom-elements",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@mcp-b/
|
|
37
|
-
"@mcp-b/
|
|
36
|
+
"@mcp-b/wc-support": "0.2.0",
|
|
37
|
+
"@mcp-b/geo-support": "0.2.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@custom-elements-manifest/analyzer": "^0.10.4",
|
package/dist/map-DzUl12tT.js
DELETED
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
import { t as __decorate } from "./decorate-DcF3lt7P.js";
|
|
2
|
-
import * as L from "leaflet";
|
|
3
|
-
import iconUrl from "leaflet/dist/images/marker-icon.png";
|
|
4
|
-
import { css, html, unsafeCSS } from "lit";
|
|
5
|
-
import { customElement, property, query } from "lit/decorators.js";
|
|
6
|
-
import { GeoMapElement } from "@mcp-b/geo-support/base/geo-map-element";
|
|
7
|
-
import { SigveloMapClickEvent, SigveloMapLoadEvent, SigveloMapMoveEndEvent, SigveloMapMoveEvent, SigveloMapZoomEndEvent, SigveloMapZoomEvent } from "@mcp-b/geo-support/events";
|
|
8
|
-
import leafletCss from "leaflet/dist/leaflet.css?raw";
|
|
9
|
-
import layersIconUrl from "leaflet/dist/images/layers.png";
|
|
10
|
-
import layersIcon2xUrl from "leaflet/dist/images/layers-2x.png";
|
|
11
|
-
//#region src/components/map/map.styles.ts
|
|
12
|
-
var map_styles_default = css`
|
|
13
|
-
:host {
|
|
14
|
-
display: block;
|
|
15
|
-
position: relative;
|
|
16
|
-
box-sizing: border-box;
|
|
17
|
-
min-height: 300px;
|
|
18
|
-
overflow: hidden;
|
|
19
|
-
border: 1px solid var(--sigvelo-color-neutral-border-muted, rgb(255 255 255 / 15%));
|
|
20
|
-
border-radius: var(--sigvelo-radius-md, 8px);
|
|
21
|
-
background: var(--sigvelo-color-surface-sunken, #171717);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.map-layout {
|
|
25
|
-
position: absolute;
|
|
26
|
-
inset: 0;
|
|
27
|
-
display: grid;
|
|
28
|
-
grid-template-rows: minmax(0, 1fr) auto;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.map-layout > .map-host {
|
|
32
|
-
position: relative;
|
|
33
|
-
inset: auto;
|
|
34
|
-
min-height: 0;
|
|
35
|
-
height: auto;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.leaflet-container {
|
|
39
|
-
border-radius: 0;
|
|
40
|
-
background: var(--sigvelo-color-surface-sunken, #171717);
|
|
41
|
-
font-family: inherit;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/*
|
|
45
|
-
* Leaflet ships its attribution link at #0078a8 on #333, which is 2.55:1
|
|
46
|
-
* against the surrounding text — below the 3:1 WCAG requires of a link
|
|
47
|
-
* distinguished by colour alone. This sheet is applied after Leaflet's, so
|
|
48
|
-
* underlining it satisfies the rule without depending on hue, and the
|
|
49
|
-
* control picks up the active theme instead of Leaflet's fixed palette.
|
|
50
|
-
*/
|
|
51
|
-
.attribution-footer {
|
|
52
|
-
display: flex;
|
|
53
|
-
box-sizing: border-box;
|
|
54
|
-
width: 100%;
|
|
55
|
-
min-width: 0;
|
|
56
|
-
justify-content: flex-end;
|
|
57
|
-
border-top: 1px solid var(--sigvelo-color-neutral-border-muted, rgb(255 255 255 / 15%));
|
|
58
|
-
color: var(--sigvelo-color-text-muted, #b4b4b4);
|
|
59
|
-
background: var(--sigvelo-color-surface, #181818);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.attribution-footer .leaflet-control-attribution {
|
|
63
|
-
float: none;
|
|
64
|
-
box-sizing: border-box;
|
|
65
|
-
width: 100%;
|
|
66
|
-
max-width: none;
|
|
67
|
-
margin: 0;
|
|
68
|
-
padding: 4px 8px;
|
|
69
|
-
border: 0;
|
|
70
|
-
border-radius: 0;
|
|
71
|
-
color: var(--sigvelo-color-text-muted, #b4b4b4);
|
|
72
|
-
background: transparent;
|
|
73
|
-
box-shadow: none;
|
|
74
|
-
font-size: 11px;
|
|
75
|
-
line-height: 1.35;
|
|
76
|
-
text-align: right;
|
|
77
|
-
white-space: normal;
|
|
78
|
-
pointer-events: auto;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.attribution-footer .leaflet-control-attribution a {
|
|
82
|
-
color: var(--sigvelo-color-primary-text, #ececec);
|
|
83
|
-
text-decoration: underline;
|
|
84
|
-
text-underline-offset: 2px;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.leaflet-container .leaflet-bar {
|
|
88
|
-
overflow: hidden;
|
|
89
|
-
border: 1px solid var(--sigvelo-color-neutral-border-muted, rgb(255 255 255 / 15%));
|
|
90
|
-
border-radius: var(--sigvelo-radius-sm, 4px);
|
|
91
|
-
box-shadow: 0 1px 4px rgb(0 0 0 / 25%);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.leaflet-container .leaflet-bar a,
|
|
95
|
-
.leaflet-container .leaflet-bar a:hover {
|
|
96
|
-
border-bottom-color: var(--sigvelo-color-neutral-border-muted, rgb(255 255 255 / 15%));
|
|
97
|
-
color: var(--sigvelo-color-text, #ececec);
|
|
98
|
-
background: var(--sigvelo-color-surface, #181818);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.leaflet-container .leaflet-bar a:hover {
|
|
102
|
-
background: var(--sigvelo-color-surface-raised, #282828);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.leaflet-container .leaflet-popup-content-wrapper,
|
|
106
|
-
.leaflet-container .leaflet-popup-tip {
|
|
107
|
-
color: #171717;
|
|
108
|
-
background: #fcfcfc;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.leaflet-container .leaflet-popup-close-button,
|
|
112
|
-
.leaflet-container .leaflet-popup-close-button:hover {
|
|
113
|
-
color: #595959;
|
|
114
|
-
}
|
|
115
|
-
`;
|
|
116
|
-
//#endregion
|
|
117
|
-
//#region src/components/map/map.ts
|
|
118
|
-
const leafletCssWithAssets = leafletCss.replace(/url\(images\/layers-2x\.png\)/g, `url(${layersIcon2xUrl})`).replace(/url\(images\/layers\.png\)/g, `url(${layersIconUrl})`).replace(/url\(images\/marker-icon\.png\)/g, `url(${iconUrl})`);
|
|
119
|
-
let SigveloLeafletMap = class SigveloLeafletMap extends GeoMapElement {
|
|
120
|
-
constructor(..._args) {
|
|
121
|
-
super(..._args);
|
|
122
|
-
this.zoomControl = true;
|
|
123
|
-
this.attributionControl = true;
|
|
124
|
-
this._map = null;
|
|
125
|
-
}
|
|
126
|
-
static {
|
|
127
|
-
this.styles = [
|
|
128
|
-
...GeoMapElement.styles,
|
|
129
|
-
unsafeCSS(leafletCssWithAssets),
|
|
130
|
-
map_styles_default
|
|
131
|
-
];
|
|
132
|
-
}
|
|
133
|
-
/** Access the underlying Leaflet map instance (after mapReady resolves). */
|
|
134
|
-
get map() {
|
|
135
|
-
return this._map;
|
|
136
|
-
}
|
|
137
|
-
createMap(container) {
|
|
138
|
-
this._map = L.map(container, {
|
|
139
|
-
center: [this.latitude, this.longitude],
|
|
140
|
-
zoom: this.zoom,
|
|
141
|
-
minZoom: this.minZoom,
|
|
142
|
-
maxZoom: this.maxZoom,
|
|
143
|
-
zoomControl: this.zoomControl,
|
|
144
|
-
attributionControl: this.attributionControl
|
|
145
|
-
});
|
|
146
|
-
if (this.attributionControl) {
|
|
147
|
-
const attribution = this._map.attributionControl.getContainer();
|
|
148
|
-
if (attribution && this.attributionFooter) this.attributionFooter.append(attribution);
|
|
149
|
-
}
|
|
150
|
-
this._map.on("click", (e) => {
|
|
151
|
-
this.dispatchEvent(new SigveloMapClickEvent({
|
|
152
|
-
lat: e.latlng.lat,
|
|
153
|
-
lng: e.latlng.lng
|
|
154
|
-
}, e.originalEvent));
|
|
155
|
-
});
|
|
156
|
-
this._map.on("move", () => {
|
|
157
|
-
if (!this._map) return;
|
|
158
|
-
const center = this._map.getCenter();
|
|
159
|
-
this._suppressExternalUpdate = true;
|
|
160
|
-
this.latitude = center.lat;
|
|
161
|
-
this.longitude = center.lng;
|
|
162
|
-
this._suppressExternalUpdate = false;
|
|
163
|
-
this.dispatchEvent(new SigveloMapMoveEvent({
|
|
164
|
-
lat: center.lat,
|
|
165
|
-
lng: center.lng
|
|
166
|
-
}));
|
|
167
|
-
});
|
|
168
|
-
this._map.on("moveend", () => {
|
|
169
|
-
if (!this._map) return;
|
|
170
|
-
const center = this._map.getCenter();
|
|
171
|
-
this.dispatchEvent(new SigveloMapMoveEndEvent({
|
|
172
|
-
lat: center.lat,
|
|
173
|
-
lng: center.lng
|
|
174
|
-
}));
|
|
175
|
-
});
|
|
176
|
-
this._map.on("zoom", () => {
|
|
177
|
-
if (!this._map) return;
|
|
178
|
-
const zoom = this._map.getZoom();
|
|
179
|
-
this._suppressExternalUpdate = true;
|
|
180
|
-
this.zoom = zoom;
|
|
181
|
-
this._suppressExternalUpdate = false;
|
|
182
|
-
this.dispatchEvent(new SigveloMapZoomEvent(zoom));
|
|
183
|
-
});
|
|
184
|
-
this._map.on("zoomend", () => {
|
|
185
|
-
if (!this._map) return;
|
|
186
|
-
this.dispatchEvent(new SigveloMapZoomEndEvent(this._map.getZoom()));
|
|
187
|
-
});
|
|
188
|
-
this._map.whenReady(() => {
|
|
189
|
-
this._resolveMapReady();
|
|
190
|
-
this.dispatchEvent(new SigveloMapLoadEvent());
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
destroyMap() {
|
|
194
|
-
this._map?.remove();
|
|
195
|
-
this._map = null;
|
|
196
|
-
}
|
|
197
|
-
updateView(changed) {
|
|
198
|
-
if (!this._map) return;
|
|
199
|
-
if (changed.has("latitude") || changed.has("longitude") || changed.has("zoom")) this._map.setView([this.latitude, this.longitude], this.zoom);
|
|
200
|
-
if (changed.has("minZoom")) this._map.setMinZoom(this.minZoom);
|
|
201
|
-
if (changed.has("maxZoom")) this._map.setMaxZoom(this.maxZoom);
|
|
202
|
-
}
|
|
203
|
-
invalidateSize() {
|
|
204
|
-
this._map?.invalidateSize();
|
|
205
|
-
}
|
|
206
|
-
flyTo(options) {
|
|
207
|
-
this._map?.flyTo([options.center.lat, options.center.lng], options.zoom, { duration: options.duration ? options.duration / 1e3 : void 0 });
|
|
208
|
-
}
|
|
209
|
-
fitBounds(options) {
|
|
210
|
-
this._map?.fitBounds([[options.bounds.south, options.bounds.west], [options.bounds.north, options.bounds.east]], {
|
|
211
|
-
padding: options.padding ? [options.padding, options.padding] : void 0,
|
|
212
|
-
maxZoom: options.maxZoom
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
render() {
|
|
216
|
-
return html`
|
|
217
|
-
<div class="map-layout">
|
|
218
|
-
<div class="map-host" part="map"></div>
|
|
219
|
-
${this.attributionControl ? html`<footer
|
|
220
|
-
class="attribution-footer"
|
|
221
|
-
part="attribution"
|
|
222
|
-
aria-label="Map attribution"
|
|
223
|
-
></footer>` : null}
|
|
224
|
-
</div>
|
|
225
|
-
<slot></slot>
|
|
226
|
-
`;
|
|
227
|
-
}
|
|
228
|
-
};
|
|
229
|
-
__decorate([property({
|
|
230
|
-
attribute: "zoom-control",
|
|
231
|
-
type: Boolean
|
|
232
|
-
})], SigveloLeafletMap.prototype, "zoomControl", void 0);
|
|
233
|
-
__decorate([property({
|
|
234
|
-
attribute: "attribution-control",
|
|
235
|
-
type: Boolean
|
|
236
|
-
})], SigveloLeafletMap.prototype, "attributionControl", void 0);
|
|
237
|
-
__decorate([query(".attribution-footer")], SigveloLeafletMap.prototype, "attributionFooter", void 0);
|
|
238
|
-
SigveloLeafletMap = __decorate([customElement("sigvelo-leaflet-map")], SigveloLeafletMap);
|
|
239
|
-
//#endregion
|
|
240
|
-
export { SigveloLeafletMap as t };
|