@florasync/leaflet-geokit 0.8.3 → 0.9.1

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.
Files changed (78) hide show
  1. package/ARCHITECTURE.md +195 -0
  2. package/CHANGELOG.md +8 -0
  3. package/README.md +146 -11
  4. package/custom-toolbar.html +165 -0
  5. package/dist/django/index.js +8993 -5090
  6. package/dist/django/index.js.map +1 -1
  7. package/dist/leaflet-geokit.es.js +21536 -5994
  8. package/dist/leaflet-geokit.es.js.map +1 -1
  9. package/dist/leaflet-geokit.external.es.js +18006 -2461
  10. package/dist/leaflet-geokit.external.es.js.map +1 -1
  11. package/dist/leaflet-geokit.umd.js +263 -60
  12. package/dist/leaflet-geokit.umd.js.map +1 -1
  13. package/dist/preact/index-DCKj0r6a.js +8545 -0
  14. package/dist/preact/index-DCKj0r6a.js.map +1 -0
  15. package/dist/preact/index.js +1 -1
  16. package/dist/preact-bundled/index.js +9002 -5089
  17. package/dist/preact-bundled/index.js.map +1 -1
  18. package/dist/react/index-DCKj0r6a.js +8545 -0
  19. package/dist/react/index-DCKj0r6a.js.map +1 -0
  20. package/dist/react/index.js +1 -1
  21. package/dist/react-bundled/index.js +9040 -5127
  22. package/dist/react-bundled/index.js.map +1 -1
  23. package/dist/types/components/LeafletDrawMapElement.d.ts +42 -3
  24. package/dist/types/django/index.d.ts +2 -2
  25. package/dist/types/external.d.ts +9 -3
  26. package/dist/types/index.d.ts +9 -3
  27. package/dist/types/lib/FeatureStore.d.ts +2 -2
  28. package/dist/types/lib/LayerRegistry.d.ts +19 -0
  29. package/dist/types/lib/MapController.d.ts +95 -5
  30. package/dist/types/lib/draw/L.Draw.Move.d.ts +1 -0
  31. package/dist/types/lib/draw/move-pointer.d.ts +12 -0
  32. package/dist/types/lib/layer-cake/LayerCakeManager.d.ts +10 -2
  33. package/dist/types/lib/layer-style-panel.d.ts +3 -0
  34. package/dist/types/lib/marker-icons.d.ts +1 -1
  35. package/dist/types/lib/providers.d.ts +64 -0
  36. package/dist/types/lib/snapping.d.ts +30 -0
  37. package/dist/types/lib/tool-buttons.d.ts +3 -1
  38. package/dist/types/lib/tool-capabilities.d.ts +27 -0
  39. package/dist/types/lib/toolbar-accessibility.d.ts +3 -0
  40. package/dist/types/lib/toolbar-layout.d.ts +14 -0
  41. package/dist/types/lib/toolbar-styles.d.ts +2 -0
  42. package/dist/types/preact/core.d.ts +2 -2
  43. package/dist/types/preact/index.d.ts +2 -2
  44. package/dist/types/preact-bundled/index.d.ts +3 -3
  45. package/dist/types/react/core.d.ts +2 -2
  46. package/dist/types/react/index.d.ts +2 -2
  47. package/dist/types/react-bundled/index.d.ts +3 -3
  48. package/dist/types/types/events.d.ts +15 -1
  49. package/dist/types/types/layers.d.ts +65 -0
  50. package/dist/types/types/public.d.ts +160 -5
  51. package/dist/types/utils/geojson-pipeline.d.ts +51 -0
  52. package/dist/types/utils/geojson.d.ts +15 -2
  53. package/dist/types/utils/grower-geometry.d.ts +107 -0
  54. package/docs/accessibility.md +142 -0
  55. package/docs/api-reference.md +249 -0
  56. package/docs/custom-toolbar.md +168 -0
  57. package/docs/diagnostics.md +216 -0
  58. package/docs/geojson-pipelines.md +145 -0
  59. package/docs/google-maps-adapter-spike.md +77 -0
  60. package/docs/grower-geometry.md +237 -0
  61. package/docs/grower-measurement.md +23 -0
  62. package/docs/integration-recipes.md +301 -0
  63. package/docs/layers.md +136 -0
  64. package/docs/providers.md +191 -0
  65. package/docs/release-verification.md +75 -0
  66. package/docs/shims/django.md +102 -0
  67. package/docs/shims/preact.md +98 -0
  68. package/docs/shims/react.md +98 -0
  69. package/docs/snapping-and-measurements.md +42 -0
  70. package/docs/tool-capabilities.md +131 -0
  71. package/docs/tool-lifecycle.md +124 -0
  72. package/docs/toolbar-layout.md +158 -0
  73. package/docs/toolbar-styling.md +118 -0
  74. package/package.json +35 -3
  75. package/dist/preact/index-BMfJn-mD.js +0 -4632
  76. package/dist/preact/index-BMfJn-mD.js.map +0 -1
  77. package/dist/react/index-BMfJn-mD.js +0 -4632
  78. package/dist/react/index-BMfJn-mD.js.map +0 -1
@@ -1,4632 +0,0 @@
1
- var Ge = Object.defineProperty;
2
- var He = (a, t, e) => t in a ? Ge(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
3
- var h = (a, t, e) => He(a, typeof t != "symbol" ? t + "" : t, e);
4
- import * as x from "leaflet";
5
- import "leaflet-draw";
6
- import "leaflet-ruler";
7
- const L = {
8
- Ready: "leaflet-draw:ready",
9
- Created: "leaflet-draw:created",
10
- Edited: "leaflet-draw:edited",
11
- Deleted: "leaflet-draw:deleted",
12
- Error: "leaflet-draw:error",
13
- Ingest: "leaflet-draw:ingest",
14
- Export: "leaflet-draw:export"
15
- }, q = {
16
- Status: "leaflet-geokit:status",
17
- Diagnostic: "leaflet-geokit:diagnostic"
18
- }, fe = {
19
- trace: 10,
20
- debug: 20,
21
- info: 30,
22
- warn: 40,
23
- error: 50
24
- };
25
- function Ve(a, t) {
26
- return a === "silent" ? !1 : fe[t] >= fe[a];
27
- }
28
- function Je() {
29
- try {
30
- return (/* @__PURE__ */ new Date()).toISOString();
31
- } catch {
32
- return "";
33
- }
34
- }
35
- function V(a, t = "debug", e = console) {
36
- let r = t;
37
- const o = (n) => (...s) => {
38
- try {
39
- if (!Ve(r, n)) return;
40
- const l = `[${Je()}][${a}][${n.toUpperCase()}]`, c = e[n];
41
- typeof c == "function" ? c(l, ...s) : e.log(l, ...s);
42
- } catch {
43
- }
44
- };
45
- return {
46
- get level() {
47
- return r;
48
- },
49
- setLevel(n) {
50
- r = n;
51
- },
52
- trace: o("trace"),
53
- debug: o("debug"),
54
- info: o("info"),
55
- warn: o("warn"),
56
- error: o("error"),
57
- child(n) {
58
- return V(`${a}:${n}`, r, e);
59
- }
60
- };
61
- }
62
- const Ze = '.leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{max-width:none!important;max-height:none!important;width:auto;padding:0}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;-moz-box-sizing:border-box;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-top,.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;-webkit-transition:opacity .2s linear;-moz-transition:opacity .2s linear;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1);-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1);transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{-webkit-transition:none;-moz-transition:none;transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{border:2px dotted #38f;background:#ffffff80}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:12px;font-size:.75rem;line-height:1.5}.leaflet-bar{box-shadow:0 1px 5px #000000a6;border-radius:4px}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:#000}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:700 18px Lucida Console,Monaco,monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{box-shadow:0 1px 5px #0006;background:#fff;border-radius:5px}.leaflet-control-layers-toggle{background-image:url(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);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce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+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{padding:6px 10px 6px 6px;color:#333;background:#fff}.leaflet-control-layers-scrollbar{overflow-y:scroll;overflow-x:hidden;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block;font-size:13px;font-size:1.08333em}.leaflet-control-layers-separator{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxy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ggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=)}.leaflet-container .leaflet-control-attribution{background:#fff;background:#fffc;margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{padding:0 5px;color:#333;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-attribution-flag{display:inline!important;vertical-align:baseline!important;width:1em;height:.6669em}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{border:2px solid #777;border-top:none;line-height:1.1;padding:2px 5px 1px;white-space:nowrap;-moz-box-sizing:border-box;box-sizing:border-box;background:#fffc;text-shadow:1px 1px #fff}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{border:2px solid rgba(0,0,0,.2);background-clip:padding-box}.leaflet-popup{position:absolute;text-align:center;margin-bottom:20px}.leaflet-popup-content-wrapper{padding:1px;text-align:left;border-radius:12px}.leaflet-popup-content{margin:13px 24px 13px 20px;line-height:1.3;font-size:13px;font-size:1.08333em;min-height:1px}.leaflet-popup-content p{margin:1.3em 0}.leaflet-popup-tip-container{width:40px;height:20px;position:absolute;left:50%;margin-top:-1px;margin-left:-20px;overflow:hidden;pointer-events:none}.leaflet-popup-tip{width:17px;height:17px;padding:1px;margin:-10px auto 0;pointer-events:auto;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;color:#333;box-shadow:0 3px 14px #0006}.leaflet-container a.leaflet-popup-close-button{position:absolute;top:0;right:0;border:none;text-align:center;width:24px;height:24px;font:16px/24px Tahoma,Verdana,sans-serif;color:#757575;text-decoration:none;background:transparent}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{width:24px;margin:0 auto;-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=.70710678,M12=.70710678,M21=-.70710678,M22=.70710678)}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{position:absolute;padding:6px;background-color:#fff;border:1px solid #fff;border-radius:3px;color:#222;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;box-shadow:0 1px 3px #0006}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{position:absolute;pointer-events:none;border:6px solid transparent;background:transparent;content:""}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{bottom:0;margin-bottom:-12px;border-top-color:#fff}.leaflet-tooltip-bottom:before{top:0;margin-top:-12px;margin-left:-6px;border-bottom-color:#fff}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{top:50%;margin-top:-6px}.leaflet-tooltip-left:before{right:0;margin-right:-12px;border-left-color:#fff}.leaflet-tooltip-right:before{left:0;margin-left:-12px;border-right-color:#fff}@media print{.leaflet-control{-webkit-print-color-adjust:exact;print-color-adjust:exact}}', je = `.leaflet-draw-section{position:relative}.leaflet-draw-toolbar{margin-top:12px}.leaflet-draw-toolbar-top{margin-top:0}.leaflet-draw-toolbar-notop a:first-child{border-top-right-radius:0}.leaflet-draw-toolbar-nobottom a:last-child{border-bottom-right-radius:0}.leaflet-draw-toolbar a{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAAeCAYAAACWuCNnAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAG7AAABuwBHnU4NQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAbvSURBVHic7dtdbBxXFQfw/9nZ3SRKwAP7UFFUQOoHqGnUoEAoNghX9tyxVcpD1X0J+WgiUQmpfUB5ACSgG1qJIKASqBIUIauqAbWseIlqb+bOWHVR6y0FKZBEqdIUQROIREGRx3FFvR/38ODZst3a3nE8Ywfv+T2t7hzdM3fle/bOnWtACCGEEEIIIYQQQgghhBBCCCGEEEIIIcRa0EbfgBDdFItFKwzDAa3175LuWylVAvBIR/MxrXUp6Vxx9dp4VyObVEdKKW591lonXgiVUg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u32FUXrLYvObViBQDM/MQqwi8knX8jEJHpHrXIGJNo8WDm1spph2VZgeu6+5RSX7YsK8D/Xnb8Psmcnebm5h7G4uS9ysxutOH8VQC70sy7UTb7eImImTnWlgkzUyaT6fr3v6qC1fGL8EytVjuQRrECANu2fwHg1TixzPyXNO5hvTHz6VWE/znJ3L7vzxBRa9PzDmb+FYBfArgjajvd39+f9vGGKwACZh5te6mwmc8KburxMvO5TCbzqW5xxWLRArDbsqyu8z32HtZSxSrNM0Hlcrnpum6JmZ+NEb4pHglrtdrz+Xz+AoBbu4Ser9fra37d3YEBfBvAkq+XmfmbpVIp9grwWnie9zSAp9PMcT3Z7OPNZrO/aTQaf1BKfbd9X7RTGIaHmPlcnPNYsVZYSikOw7AB4CAzj/f19e1fjwOMnueVEeMxJJfLbYqCNT093TDGHAGw0qHYBQBH0vj+Pc+bYOb3HFRk5nHf9yeTzgfgMhF9uEvMTQD+71/vR3pqvJOTk28AeBJAeXR09P1LxbiuuxfA9wB8LU6fsVdYrUOhtm0fTusxcAlMRN+KziUt5SqAM3v37r00OZnGfFp/QRC86DjOUCaTGWPm2zoun8fiIbuZtPLX6/UH8/n8rQDuippertfrD6aRKyqOR5VS81ji8Z+IbmfmgwB+mEb+9dZr4wWA/v7+R6rV6k+azeYpx3EezeVyJ7dv335lfn7+lkajcZCZDzPzYd/3/xSnv9gFq3UuaR2LFQDA87xAKVUB8BEAZ6N9nrNEdEZr/TcArLVOPG8aJ9jj8n3/pcHBwZ1btmx5519zmPl0vV5/Ie2V7fT09Nujo6Nus9kcA4CtW7ce1lq/nUYu27a/Mzs7CyI6gMVX/u/CzJeZ+Ue2bcc9pb1aXc8lJZms18YLANE2wkOu694N4OFGo3E8DMMPAHiDiCaY+ZOb4YCsEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhEjYfwGO+b5dFNs4OgAAAABJRU5ErkJggg==);background-image:linear-gradient(transparent,transparent),url("data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3csvg%20xmlns:dc='http://purl.org/dc/elements/1.1/'%20xmlns:cc='http://creativecommons.org/ns%23'%20xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23'%20xmlns:svg='http://www.w3.org/2000/svg'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd'%20xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape'%20viewBox='0%200%20600%2060'%20height='60'%20width='600'%20id='svg4225'%20version='1.1'%20inkscape:version='0.91%20r13725'%20sodipodi:docname='spritesheet.svg'%20inkscape:export-filename='/home/fpuga/development/upstream/icarto.Leaflet.draw/src/images/spritesheet-2x.png'%20inkscape:export-xdpi='90'%20inkscape:export-ydpi='90'%3e%3cmetadata%20id='metadata4258'%3e%3crdf:RDF%3e%3ccc:Work%20rdf:about=''%3e%3cdc:format%3eimage/svg+xml%3c/dc:format%3e%3cdc:type%20rdf:resource='http://purl.org/dc/dcmitype/StillImage'%20/%3e%3cdc:title%20/%3e%3c/cc:Work%3e%3c/rdf:RDF%3e%3c/metadata%3e%3cdefs%20id='defs4256'%20/%3e%3csodipodi:namedview%20pagecolor='%23ffffff'%20bordercolor='%23666666'%20borderopacity='1'%20objecttolerance='10'%20gridtolerance='10'%20guidetolerance='10'%20inkscape:pageopacity='0'%20inkscape:pageshadow='2'%20inkscape:window-width='1920'%20inkscape:window-height='1056'%20id='namedview4254'%20showgrid='false'%20inkscape:zoom='1.3101852'%20inkscape:cx='237.56928'%20inkscape:cy='7.2419621'%20inkscape:window-x='1920'%20inkscape:window-y='24'%20inkscape:window-maximized='1'%20inkscape:current-layer='svg4225'%20/%3e%3cg%20id='enabled'%20style='fill:%23464646;fill-opacity:1'%3e%3cg%20id='polyline'%20style='fill:%23464646;fill-opacity:1'%3e%3cpath%20d='m%2018,36%200,6%206,0%200,-6%20-6,0%20z%20m%204,4%20-2,0%200,-2%202,0%200,2%20z'%20id='path4229'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20d='m%2036,18%200,6%206,0%200,-6%20-6,0%20z%20m%204,4%20-2,0%200,-2%202,0%200,2%20z'%20id='path4231'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20d='m%2023.142,39.145%20-2.285,-2.29%2016,-15.998%202.285,2.285%20z'%20id='path4233'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3c/g%3e%3cpath%20id='polygon'%20d='M%20100,24.565%2097.904,39.395%2083.07,42%2076,28.773%2086.463,18%20Z'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20id='rectangle'%20d='m%20140,20%2020,0%200,20%20-20,0%20z'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20id='circle'%20d='m%20221,30%20c%200,6.078%20-4.926,11%20-11,11%20-6.074,0%20-11,-4.922%20-11,-11%200,-6.074%204.926,-11%2011,-11%206.074,0%2011,4.926%2011,11%20z'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20id='marker'%20d='m%20270,19%20c%20-4.971,0%20-9,4.029%20-9,9%200,4.971%205.001,12%209,14%204.001,-2%209,-9.029%209,-14%200,-4.971%20-4.029,-9%20-9,-9%20z%20m%200,12.5%20c%20-2.484,0%20-4.5,-2.014%20-4.5,-4.5%200,-2.484%202.016,-4.5%204.5,-4.5%202.485,0%204.5,2.016%204.5,4.5%200,2.486%20-2.015,4.5%20-4.5,4.5%20z'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cg%20id='edit'%20style='fill:%23464646;fill-opacity:1'%3e%3cpath%20d='m%20337,30.156%200,0.407%200,5.604%20c%200,1.658%20-1.344,3%20-3,3%20l%20-10,0%20c%20-1.655,0%20-3,-1.342%20-3,-3%20l%200,-10%20c%200,-1.657%201.345,-3%203,-3%20l%206.345,0%203.19,-3.17%20-9.535,0%20c%20-3.313,0%20-6,2.687%20-6,6%20l%200,10%20c%200,3.313%202.687,6%206,6%20l%2010,0%20c%203.314,0%206,-2.687%206,-6%20l%200,-8.809%20-3,2.968'%20id='path4240'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20d='m%20338.72,24.637%20-8.892,8.892%20-2.828,0%200,-2.829%208.89,-8.89%20z'%20id='path4242'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20d='m%20338.697,17.826%204,0%200,4%20-4,0%20z'%20transform='matrix(-0.70698336,-0.70723018,0.70723018,-0.70698336,567.55917,274.78273)'%20id='path4244'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3c/g%3e%3cg%20id='remove'%20style='fill:%23464646;fill-opacity:1'%3e%3cpath%20d='m%20381,42%2018,0%200,-18%20-18,0%200,18%20z%20m%2014,-16%202,0%200,14%20-2,0%200,-14%20z%20m%20-4,0%202,0%200,14%20-2,0%200,-14%20z%20m%20-4,0%202,0%200,14%20-2,0%200,-14%20z%20m%20-4,0%202,0%200,14%20-2,0%200,-14%20z'%20id='path4247'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20d='m%20395,20%200,-4%20-10,0%200,4%20-6,0%200,2%2022,0%200,-2%20-6,0%20z%20m%20-2,0%20-6,0%200,-2%206,0%200,2%20z'%20id='path4249'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3c/g%3e%3c/g%3e%3cg%20id='disabled'%20transform='translate(120,0)'%20style='fill:%23bbbbbb'%3e%3cuse%20xlink:href='%23edit'%20id='edit-disabled'%20x='0'%20y='0'%20width='100%25'%20height='100%25'%20/%3e%3cuse%20xlink:href='%23remove'%20id='remove-disabled'%20x='0'%20y='0'%20width='100%25'%20height='100%25'%20/%3e%3c/g%3e%3cpath%20style='fill:none;stroke:%23464646;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1'%20id='circle-3'%20d='m%20581.65725,30%20c%200,6.078%20-4.926,11%20-11,11%20-6.074,0%20-11,-4.922%20-11,-11%200,-6.074%204.926,-11%2011,-11%206.074,0%2011,4.926%2011,11%20z'%20inkscape:connector-curvature='0'%20/%3e%3c/svg%3e");background-repeat:no-repeat;background-size:300px 30px;background-clip:padding-box}.leaflet-retina .leaflet-draw-toolbar a{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAlgAAAA8CAYAAAC6nMS5AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAA16SURBVHic7d1/jBxneQfw7zNzvotdn+9sVQkxoRKoammBqqpbk6uT5mLfvHPn42yn1VFRVCEhoFH5IYpoSaUCKi1NcGkcfrbCVRFKEwG2aHLn83pmLvY2CTqT1AmCOBE0EOT4B0nBPw/snb2dp3/sLr6s77i923dud/a+H8ny7tzMo8f3eud99p133gGIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiFYGaXYCRETUPMYYrWe/MAzZX2QQ27d5OpqdABFROxgZGVlz5cqVrzuOc18QBJPNzofsYvvSYrVcgTVftZ2l6npgYODXHMc5oKoHHcfZHQTB2WbnRETpGRkZWVMoFA6IyO2qutX3/R1Z64TnO8fWOwLSzti+mSKDg4M3l0qlnSJyG4CbAFwP4ByAlwE8paoPX3fddcH4+PjP00yk5QqsrDPGvAZAHsBrReRNqvpeY8x/iMg9QRCcaXJ6ZIHv+xtUdReAHQBej/IHGABOAnhORMY6OjoempiYONe0JC3zPM84jjOqqrfi6r/3RQCPAdgXhmHUvOyaa3R01L1w4cJB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ggI9g4Ynv50XknkKh8JkMjly9wqFDh77j+/6oqo4BqD1xXRaRPw6CwMZl1GXjuu6XSqXSOwH8LoD1AMaMMecA1PtF53WV4wCUC+menp699jOlpWD7rhz5fP5Kf3//UFdX132q+l4Ad3d3d7/fGPN1EZlQ1e/19PS8dPbs2fWu694kIgOqOqqqm4Dy4rKlUumOw4cPN3KVYk7WVkE1xsx5aSBLT+duhDEmQrkSnssZlIeXnxWRY6p6PI7j41nveFeq4eHh9XEc7xSRnQBej6t3kp5EuWh+OI7jh+dYsDDTfN/frKrjAKpPmv9pkiS7JicnH29mXku1devWV3d0dBxAuRNeMhF5ulgsjqRxgk7DfOfqxWr1czvbtzGt3r5zGRwc7FPV3ap6y0L7ishPAHx63bp1e/bt2xenkQ8LLEuMMZtE5JCqfhfAMwCeSZLkO2vWrDk+NjbGyZHUFjzP2yginwcAVX1fVi99Vo2OjnaeP3/+3SLydgBvBNBd56GXAHxXVR/s7e3dm9YJOg0rqQNm+y5dFtp3HmKM2QxgF8qr9b8GwA0AzgH4MYBjIjJ28eLFkFeOiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIhWgv8Hnffz4dmwY9cAAAAASUVORK5CYII=);background-image:linear-gradient(transparent,transparent),url("data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3csvg%20xmlns:dc='http://purl.org/dc/elements/1.1/'%20xmlns:cc='http://creativecommons.org/ns%23'%20xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23'%20xmlns:svg='http://www.w3.org/2000/svg'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd'%20xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape'%20viewBox='0%200%20600%2060'%20height='60'%20width='600'%20id='svg4225'%20version='1.1'%20inkscape:version='0.91%20r13725'%20sodipodi:docname='spritesheet.svg'%20inkscape:export-filename='/home/fpuga/development/upstream/icarto.Leaflet.draw/src/images/spritesheet-2x.png'%20inkscape:export-xdpi='90'%20inkscape:export-ydpi='90'%3e%3cmetadata%20id='metadata4258'%3e%3crdf:RDF%3e%3ccc:Work%20rdf:about=''%3e%3cdc:format%3eimage/svg+xml%3c/dc:format%3e%3cdc:type%20rdf:resource='http://purl.org/dc/dcmitype/StillImage'%20/%3e%3cdc:title%20/%3e%3c/cc:Work%3e%3c/rdf:RDF%3e%3c/metadata%3e%3cdefs%20id='defs4256'%20/%3e%3csodipodi:namedview%20pagecolor='%23ffffff'%20bordercolor='%23666666'%20borderopacity='1'%20objecttolerance='10'%20gridtolerance='10'%20guidetolerance='10'%20inkscape:pageopacity='0'%20inkscape:pageshadow='2'%20inkscape:window-width='1920'%20inkscape:window-height='1056'%20id='namedview4254'%20showgrid='false'%20inkscape:zoom='1.3101852'%20inkscape:cx='237.56928'%20inkscape:cy='7.2419621'%20inkscape:window-x='1920'%20inkscape:window-y='24'%20inkscape:window-maximized='1'%20inkscape:current-layer='svg4225'%20/%3e%3cg%20id='enabled'%20style='fill:%23464646;fill-opacity:1'%3e%3cg%20id='polyline'%20style='fill:%23464646;fill-opacity:1'%3e%3cpath%20d='m%2018,36%200,6%206,0%200,-6%20-6,0%20z%20m%204,4%20-2,0%200,-2%202,0%200,2%20z'%20id='path4229'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20d='m%2036,18%200,6%206,0%200,-6%20-6,0%20z%20m%204,4%20-2,0%200,-2%202,0%200,2%20z'%20id='path4231'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20d='m%2023.142,39.145%20-2.285,-2.29%2016,-15.998%202.285,2.285%20z'%20id='path4233'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3c/g%3e%3cpath%20id='polygon'%20d='M%20100,24.565%2097.904,39.395%2083.07,42%2076,28.773%2086.463,18%20Z'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20id='rectangle'%20d='m%20140,20%2020,0%200,20%20-20,0%20z'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20id='circle'%20d='m%20221,30%20c%200,6.078%20-4.926,11%20-11,11%20-6.074,0%20-11,-4.922%20-11,-11%200,-6.074%204.926,-11%2011,-11%206.074,0%2011,4.926%2011,11%20z'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20id='marker'%20d='m%20270,19%20c%20-4.971,0%20-9,4.029%20-9,9%200,4.971%205.001,12%209,14%204.001,-2%209,-9.029%209,-14%200,-4.971%20-4.029,-9%20-9,-9%20z%20m%200,12.5%20c%20-2.484,0%20-4.5,-2.014%20-4.5,-4.5%200,-2.484%202.016,-4.5%204.5,-4.5%202.485,0%204.5,2.016%204.5,4.5%200,2.486%20-2.015,4.5%20-4.5,4.5%20z'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cg%20id='edit'%20style='fill:%23464646;fill-opacity:1'%3e%3cpath%20d='m%20337,30.156%200,0.407%200,5.604%20c%200,1.658%20-1.344,3%20-3,3%20l%20-10,0%20c%20-1.655,0%20-3,-1.342%20-3,-3%20l%200,-10%20c%200,-1.657%201.345,-3%203,-3%20l%206.345,0%203.19,-3.17%20-9.535,0%20c%20-3.313,0%20-6,2.687%20-6,6%20l%200,10%20c%200,3.313%202.687,6%206,6%20l%2010,0%20c%203.314,0%206,-2.687%206,-6%20l%200,-8.809%20-3,2.968'%20id='path4240'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20d='m%20338.72,24.637%20-8.892,8.892%20-2.828,0%200,-2.829%208.89,-8.89%20z'%20id='path4242'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20d='m%20338.697,17.826%204,0%200,4%20-4,0%20z'%20transform='matrix(-0.70698336,-0.70723018,0.70723018,-0.70698336,567.55917,274.78273)'%20id='path4244'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3c/g%3e%3cg%20id='remove'%20style='fill:%23464646;fill-opacity:1'%3e%3cpath%20d='m%20381,42%2018,0%200,-18%20-18,0%200,18%20z%20m%2014,-16%202,0%200,14%20-2,0%200,-14%20z%20m%20-4,0%202,0%200,14%20-2,0%200,-14%20z%20m%20-4,0%202,0%200,14%20-2,0%200,-14%20z%20m%20-4,0%202,0%200,14%20-2,0%200,-14%20z'%20id='path4247'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20d='m%20395,20%200,-4%20-10,0%200,4%20-6,0%200,2%2022,0%200,-2%20-6,0%20z%20m%20-2,0%20-6,0%200,-2%206,0%200,2%20z'%20id='path4249'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3c/g%3e%3c/g%3e%3cg%20id='disabled'%20transform='translate(120,0)'%20style='fill:%23bbbbbb'%3e%3cuse%20xlink:href='%23edit'%20id='edit-disabled'%20x='0'%20y='0'%20width='100%25'%20height='100%25'%20/%3e%3cuse%20xlink:href='%23remove'%20id='remove-disabled'%20x='0'%20y='0'%20width='100%25'%20height='100%25'%20/%3e%3c/g%3e%3cpath%20style='fill:none;stroke:%23464646;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1'%20id='circle-3'%20d='m%20581.65725,30%20c%200,6.078%20-4.926,11%20-11,11%20-6.074,0%20-11,-4.922%20-11,-11%200,-6.074%204.926,-11%2011,-11%206.074,0%2011,4.926%2011,11%20z'%20inkscape:connector-curvature='0'%20/%3e%3c/svg%3e")}.leaflet-draw a{display:block;text-align:center;text-decoration:none}.leaflet-draw a .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.leaflet-draw-actions{display:none;list-style:none;margin:0;padding:0;position:absolute;left:26px;top:0;white-space:nowrap}.leaflet-touch .leaflet-draw-actions{left:32px}.leaflet-right .leaflet-draw-actions{right:26px;left:auto}.leaflet-touch .leaflet-right .leaflet-draw-actions{right:32px;left:auto}.leaflet-draw-actions li{display:inline-block}.leaflet-draw-actions li:first-child a{border-left:0}.leaflet-draw-actions li:last-child a{-webkit-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.leaflet-right .leaflet-draw-actions li:last-child a{-webkit-border-radius:0;border-radius:0}.leaflet-right .leaflet-draw-actions li:first-child a{-webkit-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.leaflet-draw-actions a{background-color:#919187;border-left:1px solid #AAA;color:#fff;font:11px/19px Helvetica Neue,Arial,Helvetica,sans-serif;line-height:28px;text-decoration:none;padding-left:10px;padding-right:10px;height:28px}.leaflet-touch .leaflet-draw-actions a{font-size:12px;line-height:30px;height:30px}.leaflet-draw-actions-bottom{margin-top:0}.leaflet-draw-actions-top{margin-top:1px}.leaflet-draw-actions-top a,.leaflet-draw-actions-bottom a{height:27px;line-height:27px}.leaflet-draw-actions a:hover{background-color:#a0a098}.leaflet-draw-actions-top.leaflet-draw-actions-bottom a{height:26px;line-height:26px}.leaflet-draw-toolbar .leaflet-draw-draw-polyline{background-position:-2px -2px}.leaflet-touch .leaflet-draw-toolbar .leaflet-draw-draw-polyline{background-position:0 -1px}.leaflet-draw-toolbar .leaflet-draw-draw-polygon{background-position:-31px -2px}.leaflet-touch .leaflet-draw-toolbar .leaflet-draw-draw-polygon{background-position:-29px -1px}.leaflet-draw-toolbar .leaflet-draw-draw-rectangle{background-position:-62px -2px}.leaflet-touch .leaflet-draw-toolbar .leaflet-draw-draw-rectangle{background-position:-60px -1px}.leaflet-draw-toolbar .leaflet-draw-draw-circle{background-position:-92px -2px}.leaflet-touch .leaflet-draw-toolbar .leaflet-draw-draw-circle{background-position:-90px -1px}.leaflet-draw-toolbar .leaflet-draw-draw-marker{background-position:-122px -2px}.leaflet-touch .leaflet-draw-toolbar .leaflet-draw-draw-marker{background-position:-120px -1px}.leaflet-draw-toolbar .leaflet-draw-draw-circlemarker{background-position:-273px -2px}.leaflet-touch .leaflet-draw-toolbar .leaflet-draw-draw-circlemarker{background-position:-271px -1px}.leaflet-draw-toolbar .leaflet-draw-edit-edit{background-position:-152px -2px}.leaflet-touch .leaflet-draw-toolbar .leaflet-draw-edit-edit{background-position:-150px -1px}.leaflet-draw-toolbar .leaflet-draw-edit-remove{background-position:-182px -2px}.leaflet-touch .leaflet-draw-toolbar .leaflet-draw-edit-remove{background-position:-180px -1px}.leaflet-draw-toolbar .leaflet-draw-edit-edit.leaflet-disabled{background-position:-212px -2px}.leaflet-touch .leaflet-draw-toolbar .leaflet-draw-edit-edit.leaflet-disabled{background-position:-210px -1px}.leaflet-draw-toolbar .leaflet-draw-edit-remove.leaflet-disabled{background-position:-242px -2px}.leaflet-touch .leaflet-draw-toolbar .leaflet-draw-edit-remove.leaflet-disabled{background-position:-240px -2px}.leaflet-mouse-marker{background-color:#fff;cursor:crosshair}.leaflet-draw-tooltip{background:#363636;background:#00000080;border:1px solid transparent;-webkit-border-radius:4px;border-radius:4px;color:#fff;font:12px/18px Helvetica Neue,Arial,Helvetica,sans-serif;margin-left:20px;margin-top:-21px;padding:4px 8px;position:absolute;visibility:hidden;white-space:nowrap;z-index:6}.leaflet-draw-tooltip:before{border-right:6px solid black;border-right-color:#00000080;border-top:6px solid transparent;border-bottom:6px solid transparent;content:"";position:absolute;top:7px;left:-7px}.leaflet-error-draw-tooltip{background-color:#f2dede;border:1px solid #e6b6bd;color:#b94a48}.leaflet-error-draw-tooltip:before{border-right-color:#e6b6bd}.leaflet-draw-tooltip-single{margin-top:-12px}.leaflet-draw-tooltip-subtext{color:#f8d5e4}.leaflet-draw-guide-dash{font-size:1%;opacity:.6;position:absolute;width:5px;height:5px}.leaflet-edit-marker-selected{background-color:#fe57a11a;border:4px dashed rgba(254,87,161,.6);-webkit-border-radius:4px;border-radius:4px;box-sizing:content-box}.leaflet-edit-move{cursor:move}.leaflet-edit-resize{cursor:pointer}.leaflet-oldie .leaflet-draw-toolbar{border:1px solid #999}`, Ye = ".leaflet-ruler{height:35px;width:35px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QAAKqNIzIAAAAJcEhZcwAADdcAAA3XAUIom3gAAAAHdElNRQfhBQoMHg6McuYvAAABwklEQVQ4y43TP0jUYRgH8M/daQpqdujhnwShGiwyipCIoIgWxyIwrqEhnCQoGqKhpoYMg1qCQjg8TC2JCtSkjCgaKisIhyQUwpJssD9KZWRZg6d450/yGV54n/fzfd53eUOCaoNa5QpNGNPr9cKjUAatdsB++co0G1XiiHd+uqnTq8VzI874o9s2Ic1iiEpii9tmnJOdfkOldt/dU+HYolHnjdmpRNzbuVaNL86m4sXqNOrz3kMXHFKYMqd8VREGBToMifqLgwY1yNZirya5knaBqH16fJjNJiWEFSlxy4g980+pMuZkir/UJjLbrvNRPnINaLUygK/yQpuImHp47LOjuKJPOJA/1y4iZsAlyozLs8IO42L/4QlhGrSCy5oCeKH+dM59vVbL9sn6AP5MRzpnVKtN1viRxit1WRvEmVKFrQbTpoddNR3E+aYKuw1lPOapa0GcEf22KzOtejmcG1rkYdjEAn59KU5cDzjt+HI4BSZtVJTazfIsMQOmFAusLr/E53lniickJYIDNcaUL+JhMZPWBUdOeCCaweGOw5k0lFrv2uyRuBxPlLpoBtTK0p3mh+f+dKl6jX6LapRj6XrzD+1bmkFA/dTVAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE3LTA1LTEwVDEyOjMwOjE0KzAyOjAwUNH5TAAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNy0wNS0xMFQxMjozMDoxNCswMjowMCGMQfAAAAAZdEVYdFNvZnR3YXJlAHd3dy5pbmtzY2FwZS5vcmeb7jwaAAAAAElFTkSuQmCC);background-repeat:no-repeat;background-position:center}.leaflet-ruler:hover{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAA3NCSVQICAjb4U/gAAAACXBIWXMAAACmAAAApgHdff84AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAn9QTFRF////AAAAAAAAAAAAAAAAAAAzABcXABQUABIkDhwrAA0aAAwYABUgABQfABIbABAZAA8fABUcABMaABMfABIeABEcABAbABQeABMdABIdABEbABIbABIbABEdABEcABIcBxsoABEdABIdABIdABEcABMbABMdFBwgERofAhIbEhsfAhIdBxUeEhsgEBofAhMbAhMdBRMdAhIbAhIdAhMdCRceARIcDBgfDBgfDBcfDBcfFhwgDBceDBceCxceFCs5HTdGAxMcDxofGTFAHDRDHDVDHDVEHTZFDRkfEBofERogCh0oERsgARIcEhsfEhsgCh4pDCEsDRkfDRkfEBofBhQdDSMvDRgfDBgfCBUeBxUeDyUyECYzUDktPTAqCRceCRYeChYeDxkfEBkgLCgmWj4wCBYdW0AwGh4hHCAiHSAiTDctBhUdBxYdEBkfLyonMConBhUdJiUkLCclLSgmLigmOzApPTEpDBgfBRQdDBgfERsgWT8wBBMdCBYeChceQjMrSzctZEUyBBMdERsgXUAxXkExY0QzglQ5AxUfBxolSjcthlU6hlY7h1Y7AxMcSDUsSjYsd042g1Q5hlY6jVo8AhIcAxMcBBQdLEpcOVpvARIcAhIcBhQdDSIuEhsgJ0NUNS0oNi0oO11yTTgtUXmSUnqUXEAxXUExYEIyZUUzaEYzb0o1cEo1dEw2i1g8jFk8jcfskFs9mdX9mmA/mtf/pmZCqGdCsWxEvnJHxHVJxnZJyHdJzHlK0XxM031M139N3IFO3YJO4INP5IVQ5YZQ5oZQ6ohR7IlS7opS74tS8ItT841T9I1T9o5U949U+ZBV+pBV/ZJW/pJW/5NWIYcOagAAAJt0Uk5TAAECAwQFCw0OEhQVGBkcHyEkKCkqLTAzNUZLVFZZW2RnanJzeHl8f4uMjY6Pj5KVl52eoKGprKytrq+vsLGytLu9vb/BwsLDxcXP0NDS09bf4uPk5OXl5ufo6enq7O3u7+/x8fHy8/P09PT09fX19fX29vb29vb29/j4+Pj5+fn5+fn6+vr6+vr7/Pz8/Pz9/f39/f39/v7+/v7Td3FlAAABgklEQVQoU2NggAMRJU1DTWURBlQgqhWUND11Tfr05GBdMYQws8a07j2XVx2/cnLl5T0T5+ixQsX5/RrWr70CA+s2NPoLgMUlciddvnLl3PbslMysmi2ngXKTc/iA4uwRC1dfudRT76UtJy5lMHvHlSsni82ZgBLWbZdOHCuPlARpForvBYszA9ky1WeunC8y5YCI9125cqrEnJlbnoHBZ/6mK+0eTAjxUgtmbl99Bt6Ksxd2pXGDxRPg4kZMDIqxV6406cDFT8PEGRwnHLlYJQwSTwSJ51tCxRmiVuw7VAsRP7zkIEKcofnAlb0hEPWXls9AiDNUHriyMxwoPgVoToEVQpwhdNHuY/2imOIMZq1nr2QUgsVtkMUZZOOuXOmYiinOwF63/8QVsDgLd0wnFwMCOM3dBhK3ZeGOXjzLHklCIu8oRDxs8eaNXYJIMuplJ0HigYs3b906UwFJgtGzxY6FLWDe0mXLli3wVoEAaZAMjxoLA6eDu5urq4uziTEEqAIAvamx163e5EoAAAAASUVORK5CYII=)}.leaflet-ruler-clicked{height:35px;width:35px;background-repeat:no-repeat;background-position:center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAA3NCSVQICAjb4U/gAAAACXBIWXMAAACmAAAApgHdff84AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAn9QTFRF////AAAAAAAAAAAAAAAAAAAzABcXABQUABIkDhwrAA0aAAwY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/RrWr70CA+s2NPoLgMUlciddvnLl3PbslMysmi2ngXKTc/iA4uwRC1dfudRT76UtJy5lMHvHlSsni82ZgBLWbZdOHCuPlARpForvBYszA9ky1WeunC8y5YCI9125cqrEnJlbnoHBZ/6mK+0eTAjxUgtmbl99Bt6Ksxd2pXGDxRPg4kZMDIqxV6406cDFT8PEGRwnHLlYJQwSTwSJ51tCxRmiVuw7VAsRP7zkIEKcofnAlb0hEPWXls9AiDNUHriyMxwoPgVoToEVQpwhdNHuY/2imOIMZq1nr2QUgsVtkMUZZOOuXOmYiinOwF63/8QVsDgLd0wnFwMCOM3dBhK3ZeGOXjzLHklCIu8oRDxs8eaNXYJIMuplJ0HigYs3b906UwFJgtGzxY6FLWDe0mXLli3wVoEAaZAMjxoLA6eDu5urq4uziTEEqAIAvamx163e5EoAAAAASUVORK5CYII=);border-color:#7fff00!important}.leaflet-bar{background-color:#fff}.leaflet-control{cursor:pointer}.result-tooltip{background-color:#fff;border-width:medium;border-color:#de0000;font-size:smaller}.moving-tooltip{background-color:#ffffffb3;background-clip:padding-box;opacity:.5;border:dotted;border-color:red;font-size:smaller}.plus-length{padding-left:45px}", qe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsx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wmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC", We = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='430'%20height='430'%20style='width:100%25;height:100%25;transform:translate3d(0,0,0);content-visibility:visible'%20viewBox='0%200%20430%20430'%3e%3cdefs%3e%3cclipPath%20id='i'%3e%3cpath%20d='M0%200h430v430H0z'/%3e%3c/clipPath%3e%3cclipPath%20id='s'%3e%3cpath%20d='M0%200h430v430H0z'/%3e%3c/clipPath%3e%3cclipPath%20id='e'%3e%3cpath%20d='M0%200h430v430H0z'/%3e%3c/clipPath%3e%3cclipPath%20id='p'%3e%3cpath%20d='M0%200h430v430H0z'/%3e%3c/clipPath%3e%3cclipPath%20id='f'%3e%3cpath%20d='M0%200h430v430H0z'/%3e%3c/clipPath%3e%3cclipPath%20id='m'%3e%3cpath%20d='M0%200h430v430H0z'/%3e%3c/clipPath%3e%3cclipPath%20id='g'%3e%3cpath%20d='M0%200h430v430H0z'/%3e%3c/clipPath%3e%3cclipPath%20id='j'%3e%3cpath%20d='M0%200h430v430H0z'/%3e%3c/clipPath%3e%3cclipPath%20id='h'%3e%3cpath%20d='M0%200h430v430H0z'/%3e%3c/clipPath%3e%3cfilter%20id='t'%20width='300%25'%20height='300%25'%20x='-100%25'%20y='-100%25'%3e%3cfeGaussianBlur%20result='filter_result_0'/%3e%3c/filter%3e%3cfilter%20id='r'%20width='300%25'%20height='300%25'%20x='-100%25'%20y='-100%25'%3e%3cfeGaussianBlur%20result='filter_result_0'%20stdDeviation='52.5%2052.5'/%3e%3c/filter%3e%3cfilter%20id='n'%20width='300%25'%20height='300%25'%20x='-100%25'%20y='-100%25'%3e%3cfeGaussianBlur%20result='filter_result_0'/%3e%3c/filter%3e%3cfilter%20id='k'%20width='300%25'%20height='300%25'%20x='-100%25'%20y='-100%25'%3e%3cfeGaussianBlur%20result='filter_result_0'/%3e%3c/filter%3e%3cmask%20id='u'%20mask-type='alpha'%3e%3cuse%20xmlns:ns1='http://www.w3.org/1999/xlink'%20ns1:href='%23a'/%3e%3c/mask%3e%3cmask%20id='q'%20mask-type='alpha'%3e%3cuse%20xmlns:ns2='http://www.w3.org/1999/xlink'%20ns2:href='%23b'/%3e%3c/mask%3e%3cmask%20id='o'%20mask-type='alpha'%3e%3cuse%20xmlns:ns3='http://www.w3.org/1999/xlink'%20ns3:href='%23c'/%3e%3c/mask%3e%3cmask%20id='l'%20mask-type='alpha'%3e%3cuse%20xmlns:ns4='http://www.w3.org/1999/xlink'%20ns4:href='%23d'/%3e%3c/mask%3e%3cg%20id='a'%20fill-opacity='0'%20stroke-linecap='round'%20stroke-linejoin='round'%20clip-path='url(%23e)'%20style='display:none'%3e%3cpath%20class='secondary'%20style='display:none'/%3e%3cpath%20class='primary'%20style='display:none'/%3e%3c/g%3e%3cg%20id='b'%20fill-opacity='0'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='12'%20clip-path='url(%23f)'%20style='display:block'%3e%3cpath%20stroke='%2308A88A'%20d='M44.446-66.518a79.998%2079.998%200%200%200-101.012%209.952A79.998%2079.998%200%201%200%2056.569%2056.569%2080.005%2080.005%200%200%200%2073.91-30.615a80.001%2080.001%200%200%200-29.464-35.903z'%20class='secondary'%20style='display:block'%20transform='translate(215%20214)'/%3e%3cpath%20stroke='%23121331'%20d='m141.409%2025.241%208.727%205.041s0%200%200%200a22.3%2022.3%200%200%201%2010.411%2013.542%2022.32%2022.32%200%200%201-2.221%2016.937l-26.515%2045.924a22.325%2022.325%200%200%201-30.497%208.172l-8.754-5.059a143.414%20143.414%200%200%201-43.718%2025.286v10.108a22.302%2022.302%200%200%201-13.778%2020.612%2022.303%2022.303%200%200%201-8.539%201.696h-53.029a22.303%2022.303%200%200%201-15.779-6.531%2022.302%2022.302%200%200%201-6.537-15.777v-10.073a143.416%20143.416%200%200%201-43.719-25.285l-8.754%205.059a22.325%2022.325%200%200%201-30.497-8.172l-26.523-45.924a22.315%2022.315%200%200%201-2.238-16.943A22.31%2022.31%200%200%201-150.142%2030.3l8.727-5.041a145.097%20145.097%200%200%201%200-50.518l-8.727-5.041a22.294%2022.294%200%200%201-10.409-13.554%2022.306%2022.306%200%200%201%202.238-16.943l26.514-45.924a22.325%2022.325%200%200%201%2030.497-8.172l8.754%205.059a143.416%20143.416%200%200%201%2043.719-25.285v-10.073a22.302%2022.302%200%200%201%206.537-15.777%2022.3%2022.3%200%200%201%2015.779-6.531h53.02a22.307%2022.307%200%200%201%2022.317%2022.308v10.037a143.41%20143.41%200%200%201%2043.718%2025.285l8.754-5.059a22.325%2022.325%200%200%201%2030.497%208.172l26.515%2045.942a22.313%2022.313%200%200%201-1.618%2024.757%2022.294%2022.294%200%200%201-6.554%205.74l-8.727%205.041a145.097%20145.097%200%200%201%200%2050.518z'%20class='primary'%20style='display:block'%20transform='rotate(-120%20169.576%2045.095)'/%3e%3c/g%3e%3cg%20id='c'%20fill-opacity='0'%20stroke-linecap='round'%20stroke-linejoin='round'%20clip-path='url(%23g)'%20style='display:none'%3e%3cpath%20class='secondary'%20style='display:none'/%3e%3cpath%20class='primary'%20style='display:none'/%3e%3c/g%3e%3cg%20id='d'%20fill-opacity='0'%20stroke-linecap='round'%20stroke-linejoin='round'%20clip-path='url(%23h)'%20style='display:none'%3e%3cpath%20class='secondary'%20style='display:none'/%3e%3cpath%20class='primary'%20style='display:none'/%3e%3c/g%3e%3c/defs%3e%3cg%20clip-path='url(%23i)'%3e%3cg%20clip-path='url(%23j)'%20filter='url(%23k)'%20mask='url(%23l)'%20style='display:none'%3e%3cg%20class='design'%3e%3cpath%20class='primary'/%3e%3c/g%3e%3cg%20class='design'%3e%3cpath%20class='secondary'/%3e%3c/g%3e%3c/g%3e%3cg%20clip-path='url(%23m)'%20filter='url(%23n)'%20mask='url(%23o)'%20style='display:none'%3e%3cg%20class='design'%3e%3cpath%20class='primary'/%3e%3c/g%3e%3cg%20class='design'%3e%3cpath%20class='secondary'/%3e%3c/g%3e%3c/g%3e%3cg%20clip-path='url(%23p)'%20mask='url(%23q)'%20style='display:block'%3e%3cg%20filter='url(%23r)'%20transform='rotate(-94%20238.762%20-16.565)%20scale(2.4)'%3e%3cg%20class='design'%3e%3cpath%20fill='%234BE1EC'%20d='M0-250c137.975%200%20250%20112.025%20250%20250S137.975%20250%200%20250-250%20137.975-250%200-137.975-250%200-250z'%20class='primary'/%3e%3c/g%3e%3cg%20class='design'%3e%3cpath%20fill='%23CB5EEE'%20d='M113.242-295.384c97.478%200%20176.5%2079.022%20176.5%20176.5s-79.022%20176.5-176.5%20176.5c-43.948%200-74.396-34.057-105.29-60.631-37.631-32.369-71.21-62.338-71.21-115.869%200-97.478%2079.022-176.5%20176.5-176.5z'%20class='secondary'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20clip-path='url(%23s)'%20filter='url(%23t)'%20mask='url(%23u)'%20style='display:none'%3e%3cg%20class='design'%3e%3cpath%20class='primary'/%3e%3c/g%3e%3cg%20class='design'%3e%3cpath%20class='secondary'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", Le = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20width='800px'%20height='800px'%20viewBox='0%20-1.67%2047.336%2047.336'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group_42'%20data-name='Group%2042'%20transform='translate(-172.455%20-364.36)'%3e%3cpath%20id='Rectangle_17'%20data-name='Rectangle%2017'%20d='M4.351,0H40.984a4.351,4.351,0,0,1,4.351,4.351V22.117a1,1,0,0,1-1,1H1a1,1,0,0,1-1-1V4.351A4.351,4.351,0,0,1,4.351,0Z'%20transform='translate(173.455%20384.243)'%20fill='none'%20stroke='%23000000'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='2'/%3e%3cpath%20id='Path_90'%20data-name='Path%2090'%20d='M218.79,390.249a3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778,3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778,3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778,3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778,3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778,3.778,3.778,0,0,1-3.778,3.778h0a3.778,3.778,0,0,1-3.777-3.778'%20fill='none'%20stroke='%23000000'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='2'/%3e%3cg%20id='Group_41'%20data-name='Group%2041'%3e%3cpath%20id='Rectangle_18'%20data-name='Rectangle%2018'%20d='M4.351,0H26.473a4.351,4.351,0,0,1,4.351,4.351V17.883a1,1,0,0,1-1,1H1a1,1,0,0,1-1-1V4.351A4.351,4.351,0,0,1,4.351,0Z'%20transform='translate(180.71%20365.36)'%20fill='none'%20stroke='%23000000'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='2'/%3e%3cpath%20id='Path_91'%20data-name='Path%2091'%20d='M211.234,370.794a3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778,3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778,3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778,3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778'%20fill='none'%20stroke='%23000000'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='2'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e", Xe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAQAAABKfvVzAAAABG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klEQVQoU2NggAMRJU1DTWURBlQgqhWUND11Tfr05GBdMYQws8a07j2XVx2/cnLl5T0T5+ixQsX5/RrWr70CA+s2NPoLgMUlciddvnLl3PbslMysmi2ngXKTc/iA4uwRC1dfudRT76UtJy5lMHvHlSsni82ZgBLWbZdOHCuPlARpForvBYszA9ky1WeunC8y5YCI9125cqrEnJlbnoHBZ/6mK+0eTAjxUgtmbl99Bt6Ksxd2pXGDxRPg4kZMDIqxV6406cDFT8PEGRwnHLlYJQwSTwSJ51tCxRmiVuw7VAsRP7zkIEKcofnAlb0hEPWXls9AiDNUHriyMxwoPgVoToEVQpwhdNHuY/2imOIMZq1nr2QUgsVtkMUZZOOuXOmYiinOwF63/8QVsDgLd0wnFwMCOM3dBhK3ZeGOXjzLHklCIu8oRDxs8eaNXYJIMuplJ0HigYs3b906UwFJgtGzxY6FLWDe0mXLli3wVoEAaZAMjxoLA6eDu5urq4uziTEEqAIAvamx163e5EoAAAAASUVORK5CYII=";
63
- function et(a) {
64
- const t = "data-leaflet-styles";
65
- if (a.querySelector(`style[${t}]`)) return;
66
- const e = document.createElement("style");
67
- e.setAttribute(t, "true"), e.textContent = `
68
- /* --- Leaflet core CSS --- */
69
- ${Ze}
70
-
71
- /* --- Leaflet.draw CSS --- */
72
- ${je}
73
-
74
- /* --- Leaflet.ruler CSS --- */
75
- ${Ye}
76
-
77
- /* --- Fix Leaflet.ruler icons (broken relative paths in inlined CSS) --- */
78
- .leaflet-ruler {
79
- width: 30px !important; /* Match Leaflet Draw default size approx */
80
- height: 30px !important;
81
- background-color: #fff; /* Ensure visibility */
82
- background-image: url(${Xe}) !important;
83
- background-size: 16px 16px; /* Scale icon to fit */
84
- }
85
- .leaflet-ruler:hover,
86
- .leaflet-ruler-clicked {
87
- background-image: url(${$e}) !important;
88
- }
89
-
90
- /* --- Custom overrides for marker/handle sizes --- */
91
- .leaflet-draw-handle,
92
- .leaflet-editing-icon,
93
- .leaflet-draw-marker-icon {
94
- width: 12px !important;
95
- height: 12px !important;
96
- margin-left: -6px !important;
97
- margin-top: -6px !important;
98
- }
99
-
100
- /* --- Ruler settings control --- */
101
- .leaflet-ruler-settings-control {
102
- display: flex;
103
- flex-direction: column;
104
- }
105
- .leaflet-ruler-settings-button {
106
- width: 30px;
107
- height: 30px;
108
- border: none;
109
- background-color: #fff;
110
- background-repeat: no-repeat;
111
- background-position: center;
112
- background-size: 22px 22px;
113
- cursor: pointer;
114
- padding: 0;
115
- border-radius: 4px;
116
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
117
- background-image: url(${We});
118
- transition: background-color 0.15s ease, box-shadow 0.15s ease;
119
- }
120
- .leaflet-ruler-settings-button:hover {
121
- background-color: #f4f4f4;
122
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
123
- }
124
- .leaflet-ruler-settings-button:focus-visible {
125
- outline: 2px solid #2c7be5;
126
- outline-offset: 2px;
127
- }
128
-
129
- /* --- Measurement modal --- */
130
- .leaflet-ruler-modal-overlay {
131
- position: absolute;
132
- inset: 0;
133
- display: flex;
134
- align-items: center;
135
- justify-content: center;
136
- background: rgba(0, 0, 0, 0.4);
137
- z-index: 500;
138
- opacity: 0;
139
- pointer-events: none;
140
- transition: opacity 0.2s ease;
141
- padding: 16px;
142
- }
143
- .leaflet-ruler-modal-overlay.is-open {
144
- opacity: 1;
145
- pointer-events: auto;
146
- }
147
- .leaflet-ruler-modal {
148
- background: #fff;
149
- border-radius: 8px;
150
- width: min(320px, 100%);
151
- padding: 16px;
152
- box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
153
- }
154
- .leaflet-ruler-modal-title {
155
- margin: 0 0 8px;
156
- font-size: 16px;
157
- font-weight: 600;
158
- }
159
- .leaflet-ruler-modal-description {
160
- margin: 0 0 12px;
161
- font-size: 13px;
162
- color: #444;
163
- }
164
- .leaflet-ruler-modal-options {
165
- display: flex;
166
- flex-direction: column;
167
- gap: 8px;
168
- }
169
- .leaflet-ruler-modal-option {
170
- display: flex;
171
- gap: 8px;
172
- align-items: flex-start;
173
- font-size: 14px;
174
- }
175
- .leaflet-ruler-modal-option input[type="radio"] {
176
- margin-top: 4px;
177
- }
178
- .leaflet-ruler-modal-option span {
179
- line-height: 1.25;
180
- }
181
- .leaflet-ruler-modal-actions {
182
- margin-top: 16px;
183
- display: flex;
184
- justify-content: flex-end;
185
- }
186
- .leaflet-ruler-modal-close {
187
- border: none;
188
- background: #2c7be5;
189
- color: #fff;
190
- border-radius: 4px;
191
- padding: 6px 12px;
192
- cursor: pointer;
193
- font-size: 14px;
194
- }
195
- .leaflet-ruler-modal-close:hover {
196
- background: #1a56c2;
197
- }
198
-
199
- /* --- Layer Cake draw tool icon + manager UI --- */
200
- .leaflet-draw-toolbar a.leaflet-draw-draw-cake {
201
- background-image: url(${Le}) !important;
202
- background-size: 18px 18px !important;
203
- background-position: 50% 50% !important;
204
- background-repeat: no-repeat !important;
205
- background-color: #fff;
206
- }
207
-
208
- .layer-cake-controls__container {
209
- display: flex;
210
- gap: 6px;
211
- background: white;
212
- padding: 5px;
213
- border-radius: 4px;
214
- box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
215
- }
216
-
217
- .layer-cake-controls button {
218
- border: 1px solid #ccc;
219
- background: white;
220
- padding: 4px 8px;
221
- border-radius: 3px;
222
- font-size: 12px;
223
- cursor: pointer;
224
- }
225
-
226
- .layer-cake-controls button:hover {
227
- background: #f4f4f4;
228
- }
229
-
230
- /* --- Layer Cake measurement tooltips --- */
231
- .cake-label {
232
- background-color: rgba(255, 255, 255, 0.95) !important;
233
- border: 2px solid #8A2BE2 !important;
234
- border-radius: 4px !important;
235
- color: #333 !important;
236
- font-size: 13px !important;
237
- font-weight: 600 !important;
238
- padding: 4px 8px !important;
239
- white-space: nowrap !important;
240
- box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
241
- }
242
-
243
- .cake-label::before {
244
- border-right-color: #8A2BE2 !important;
245
- }
246
-
247
- /* --- Managed toolbar controls --- */
248
- [data-geokit-map-container][data-geokit-default-toolbar-hidden] .leaflet-draw-toolbar,
249
- [data-geokit-map-container][data-geokit-default-toolbar-hidden] .leaflet-ruler,
250
- [data-geokit-map-container][data-geokit-default-toolbar-hidden] .leaflet-ruler-settings-control {
251
- display: none !important;
252
- }
253
-
254
- .leaflet-geokit-toolbar-group {
255
- display: flex !important;
256
- flex-direction: column !important;
257
- gap: 6px !important;
258
- padding: 6px !important;
259
- border: 1px solid rgba(15, 23, 18, 0.16) !important;
260
- border-radius: 16px !important;
261
- background: rgba(255, 255, 255, 0.94) !important;
262
- backdrop-filter: blur(10px) !important;
263
- }
264
-
265
- .leaflet-geokit-toolbar-button {
266
- width: 44px !important;
267
- height: 44px !important;
268
- border: 1px solid rgba(15, 23, 18, 0.18) !important;
269
- border-radius: 12px !important;
270
- background: #fff !important;
271
- color: #1f5134 !important;
272
- box-shadow: 0 10px 24px rgba(15, 23, 18, 0.16) !important;
273
- transition:
274
- background 160ms ease,
275
- border-color 160ms ease,
276
- box-shadow 160ms ease,
277
- transform 160ms ease !important;
278
- }
279
-
280
- .leaflet-geokit-toolbar-button:hover,
281
- .leaflet-geokit-toolbar-button:focus-visible {
282
- background: #f0f8ed !important;
283
- border-color: #2f8f5f !important;
284
- box-shadow:
285
- 0 0 0 1px rgba(47, 143, 95, 0.35),
286
- 0 12px 26px rgba(15, 23, 18, 0.18) !important;
287
- transform: translateY(-1px) !important;
288
- }
289
-
290
- .leaflet-geokit-toolbar-button:focus-visible {
291
- outline: 2px solid #2f8f5f !important;
292
- outline-offset: 2px !important;
293
- }
294
-
295
- /* --- Move tool mode cursor styles --- */
296
- .leaflet-draw-move-mode {
297
- cursor: default !important;
298
- }
299
-
300
- .leaflet-draw-move-mode .leaflet-interactive {
301
- cursor: grab !important;
302
- }
303
-
304
- .leaflet-draw-move-mode .leaflet-interactive:active {
305
- cursor: grabbing !important;
306
- }
307
- `, a.appendChild(e);
308
- }
309
- function tt(a) {
310
- const t = "data-leaflet-custom-styles";
311
- if (a.querySelector(`style[${t}]`)) return;
312
- const e = document.createElement("style");
313
- e.setAttribute(t, "true"), e.textContent = `
314
- /* Ensure Layer Cake toolbar icon uses project asset instead of draw sprite sheet */
315
- .leaflet-draw-toolbar a.leaflet-draw-draw-cake {
316
- background-image: url(${Le}) !important;
317
- background-size: 18px 18px !important;
318
- background-position: 50% 50% !important;
319
- background-repeat: no-repeat !important;
320
- background-color: #fff;
321
- }
322
- `, a.appendChild(e);
323
- }
324
- function rt() {
325
- var a, t;
326
- (t = (a = x.Icon.Default).mergeOptions) == null || t.call(a, {
327
- iconRetinaUrl: qe,
328
- iconUrl: Ke,
329
- shadowUrl: Qe
330
- });
331
- }
332
- function ot(a) {
333
- const { root: t, skipStyles: e } = a;
334
- try {
335
- e || (et(t), rt()), tt(t);
336
- } catch {
337
- }
338
- }
339
- const M = [];
340
- for (let a = 0; a < 256; ++a)
341
- M.push((a + 256).toString(16).slice(1));
342
- function at(a, t = 0) {
343
- return (M[a[t + 0]] + M[a[t + 1]] + M[a[t + 2]] + M[a[t + 3]] + "-" + M[a[t + 4]] + M[a[t + 5]] + "-" + M[a[t + 6]] + M[a[t + 7]] + "-" + M[a[t + 8]] + M[a[t + 9]] + "-" + M[a[t + 10]] + M[a[t + 11]] + M[a[t + 12]] + M[a[t + 13]] + M[a[t + 14]] + M[a[t + 15]]).toLowerCase();
344
- }
345
- let K;
346
- const it = new Uint8Array(16);
347
- function nt() {
348
- if (!K) {
349
- if (typeof crypto == "undefined" || !crypto.getRandomValues)
350
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
351
- K = crypto.getRandomValues.bind(crypto);
352
- }
353
- return K(it);
354
- }
355
- const st = typeof crypto != "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto), ge = { randomUUID: st };
356
- function de(a, t, e) {
357
- var o, i, n;
358
- if (ge.randomUUID && !a)
359
- return ge.randomUUID();
360
- a = a || {};
361
- const r = (n = (i = a.random) != null ? i : (o = a.rng) == null ? void 0 : o.call(a)) != null ? n : nt();
362
- if (r.length < 16)
363
- throw new Error("Random bytes length must be >= 16");
364
- return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, at(r);
365
- }
366
- function J(a) {
367
- var e, r;
368
- const t = (r = a.id) != null ? r : (e = a.properties) == null ? void 0 : e.id;
369
- if (t != null)
370
- return String(t);
371
- }
372
- const lt = /^(.*)::(\d+)$/;
373
- function me(a) {
374
- const t = J(a);
375
- if (!t) return null;
376
- const e = lt.exec(t);
377
- return e ? {
378
- baseId: e[1],
379
- childIndex: Number(e[2]),
380
- feature: a
381
- } : null;
382
- }
383
- function ct(a, t) {
384
- const e = t && typeof t == "object" ? { ...t } : {};
385
- return e.id = a, e;
386
- }
387
- function dt(a, t) {
388
- const e = [...t].sort((s, l) => s.childIndex - l.childIndex), r = e[0].feature, o = ct(a, r.properties), i = e.map((s) => s.feature.geometry).filter((s) => s != null);
389
- let n;
390
- return i.length === 0 ? n = {
391
- type: "GeometryCollection",
392
- geometries: []
393
- } : i.length === 1 ? n = i[0] : i.every((s) => s.type === "Point") ? n = {
394
- type: "MultiPoint",
395
- coordinates: i.map((s) => s.coordinates)
396
- } : i.every((s) => s.type === "LineString") ? n = {
397
- type: "MultiLineString",
398
- coordinates: i.map((s) => s.coordinates)
399
- } : i.every((s) => s.type === "Polygon") ? n = {
400
- type: "MultiPolygon",
401
- coordinates: i.map((s) => s.coordinates)
402
- } : n = {
403
- type: "GeometryCollection",
404
- geometries: i
405
- }, {
406
- type: "Feature",
407
- id: a,
408
- properties: o,
409
- geometry: n
410
- };
411
- }
412
- function ut(a, t) {
413
- const e = (r) => {
414
- switch (r.type) {
415
- case "Point":
416
- t(r.coordinates);
417
- break;
418
- case "MultiPoint":
419
- case "LineString":
420
- for (const o of r.coordinates) t(o);
421
- break;
422
- case "MultiLineString":
423
- case "Polygon":
424
- for (const o of r.coordinates)
425
- for (const i of o) t(i);
426
- break;
427
- case "MultiPolygon":
428
- for (const o of r.coordinates)
429
- for (const i of o)
430
- for (const n of i) t(n);
431
- break;
432
- case "GeometryCollection":
433
- for (const o of r.geometries) e(o);
434
- break;
435
- }
436
- };
437
- e(a);
438
- }
439
- function ht(a) {
440
- const t = a.geometry;
441
- if (!t) return null;
442
- let e = 1 / 0, r = 1 / 0, o = -1 / 0, i = -1 / 0, n = !1;
443
- return ut(t, (s) => {
444
- const [l, c] = s;
445
- typeof l != "number" || typeof c != "number" || (n = !0, l < e && (e = l), c < r && (r = c), l > o && (o = l), c > i && (i = c));
446
- }), n ? [e, r, o, i] : null;
447
- }
448
- function pt(a) {
449
- let t = 1 / 0, e = 1 / 0, r = -1 / 0, o = -1 / 0, i = !1;
450
- for (const n of a.features) {
451
- const s = ht(n);
452
- s && (i = !0, t = Math.min(t, s[0]), e = Math.min(e, s[1]), r = Math.max(r, s[2]), o = Math.max(o, s[3]));
453
- }
454
- return i ? [t, e, r, o] : null;
455
- }
456
- function ft(a) {
457
- const [t, e, r, o] = a;
458
- return [
459
- [e, t],
460
- [o, r]
461
- ];
462
- }
463
- function gt(a) {
464
- var e;
465
- const t = [];
466
- for (const r of a.features) {
467
- if (!r || r.type !== "Feature") continue;
468
- const o = (e = r.properties) != null ? e : {}, i = J(r), n = (l, c) => {
469
- const d = o && typeof o == "object" ? { ...o } : {}, u = i !== void 0 ? `${i}::${c}` : void 0;
470
- return u !== void 0 && (d.id = u), {
471
- type: "Feature",
472
- id: u,
473
- properties: d,
474
- geometry: l
475
- };
476
- }, s = r.geometry;
477
- if (s)
478
- switch (s.type) {
479
- case "MultiPolygon":
480
- for (const [l, c] of s.coordinates.entries())
481
- t.push(
482
- n({ type: "Polygon", coordinates: c }, l)
483
- );
484
- break;
485
- case "MultiLineString":
486
- for (const [l, c] of s.coordinates.entries())
487
- t.push(
488
- n(
489
- { type: "LineString", coordinates: c },
490
- l
491
- )
492
- );
493
- break;
494
- case "MultiPoint":
495
- for (const [l, c] of s.coordinates.entries())
496
- t.push(
497
- n({ type: "Point", coordinates: c }, l)
498
- );
499
- break;
500
- case "GeometryCollection":
501
- for (const [l, c] of s.geometries.entries())
502
- t.push(n(c, l));
503
- break;
504
- default:
505
- t.push(r);
506
- break;
507
- }
508
- }
509
- return { type: "FeatureCollection", features: t };
510
- }
511
- function mt(a, t = {}) {
512
- var n;
513
- if (((n = t.adapter) != null ? n : "editing") !== "source") return a;
514
- const r = /* @__PURE__ */ new Map();
515
- for (const s of a.features) {
516
- const l = me(s);
517
- if (!l) continue;
518
- const c = r.get(l.baseId);
519
- c ? c.push(l) : r.set(l.baseId, [l]);
520
- }
521
- if (r.size === 0) return a;
522
- const o = /* @__PURE__ */ new Set(), i = [];
523
- for (const s of a.features) {
524
- const l = me(s);
525
- if (!l) {
526
- i.push(s);
527
- continue;
528
- }
529
- o.has(l.baseId) || (o.add(l.baseId), i.push(
530
- dt(l.baseId, r.get(l.baseId))
531
- ));
532
- }
533
- return {
534
- type: "FeatureCollection",
535
- features: i
536
- };
537
- }
538
- function Me(a) {
539
- return (a == null ? void 0 : a.type) === "Polygon";
540
- }
541
- function Ce(a) {
542
- return (a == null ? void 0 : a.type) === "MultiPolygon";
543
- }
544
- function yt(a) {
545
- const t = a.geometry;
546
- return t ? Me(t) ? [t.coordinates] : Ce(t) ? t.coordinates : [] : [];
547
- }
548
- function bt(a, t) {
549
- var o, i;
550
- const e = [];
551
- for (const n of a) {
552
- const s = yt(n);
553
- s.length > 0 && e.push(...s);
554
- }
555
- if (e.length === 0) return null;
556
- const r = (i = t != null ? t : (o = a[0]) == null ? void 0 : o.properties) != null ? i : {};
557
- return e.length === 1 ? {
558
- type: "Feature",
559
- properties: { ...r },
560
- geometry: {
561
- type: "Polygon",
562
- coordinates: e[0]
563
- }
564
- } : {
565
- type: "Feature",
566
- properties: { ...r },
567
- geometry: {
568
- type: "MultiPolygon",
569
- coordinates: e
570
- }
571
- };
572
- }
573
- class At {
574
- constructor(t = V("feature-store", "debug")) {
575
- h(this, "log");
576
- h(this, "features");
577
- this.log = t, this.features = /* @__PURE__ */ new Map();
578
- }
579
- size() {
580
- return this.features.size;
581
- }
582
- has(t) {
583
- return this.features.has(t);
584
- }
585
- get(t) {
586
- return this.features.get(t);
587
- }
588
- /**
589
- * Add features to the store; returns the assigned/normalized ids in order.
590
- */
591
- add(t) {
592
- var i, n, s, l;
593
- const e = [], r = (n = (i = performance.now) == null ? void 0 : i.call(performance)) != null ? n : Date.now();
594
- for (const c of t.features) {
595
- const d = this.ensureId(c), u = { ...c, id: d };
596
- this.features.set(d, u), e.push(d);
597
- }
598
- const o = ((l = (s = performance.now) == null ? void 0 : s.call(performance)) != null ? l : Date.now()) - r;
599
- return this.log.debug("add", {
600
- count: t.features.length,
601
- ids: e,
602
- elapsedMs: Math.round(o)
603
- }), e;
604
- }
605
- /**
606
- * Update a feature by id. If the feature does not exist, this is a no-op.
607
- * The provided feature will overwrite the stored one with the given id.
608
- */
609
- update(t, e) {
610
- if (!this.features.has(t)) {
611
- this.log.warn("update:missing", { id: t });
612
- return;
613
- }
614
- const r = { ...e, id: t };
615
- this.features.set(t, r), this.log.debug("update", { id: t });
616
- }
617
- /**
618
- * Remove a feature by id. No-op if missing.
619
- */
620
- remove(t) {
621
- this.features.delete(t) ? this.log.debug("remove", { id: t }) : this.log.warn("remove:missing", { id: t });
622
- }
623
- /**
624
- * Clear all features.
625
- */
626
- clear() {
627
- const t = this.features.size;
628
- this.features.clear(), this.log.debug("clear", { count: t });
629
- }
630
- /**
631
- * Export snapshot as FeatureCollection.
632
- */
633
- toFeatureCollection() {
634
- return {
635
- type: "FeatureCollection",
636
- features: Array.from(this.features.values())
637
- };
638
- }
639
- /**
640
- * Compute bounds for current data as [[south, west], [north, east]] or null if empty.
641
- */
642
- bounds() {
643
- const t = this.toFeatureCollection();
644
- if (t.features.length === 0) return null;
645
- const e = pt(t);
646
- return e ? ft(e) : null;
647
- }
648
- /**
649
- * Ensure the feature has an id; returns the resolved id.
650
- */
651
- ensureId(t) {
652
- const e = J(t);
653
- if (e) return String(e);
654
- const r = de();
655
- return t.id = r, t.properties && typeof t.properties == "object" && (t.properties.id = r), r;
656
- }
657
- }
658
- const Z = {
659
- polygon: {
660
- selectors: ["a.leaflet-draw-draw-polygon"],
661
- dataTool: "polygon"
662
- },
663
- polyline: {
664
- selectors: ["a.leaflet-draw-draw-polyline"],
665
- dataTool: "polyline"
666
- },
667
- rectangle: {
668
- selectors: ["a.leaflet-draw-draw-rectangle"],
669
- dataTool: "rectangle"
670
- },
671
- circle: {
672
- selectors: ["a.leaflet-draw-draw-circle"],
673
- dataTool: "circle"
674
- },
675
- marker: {
676
- selectors: ["a.leaflet-draw-draw-marker"],
677
- dataTool: "marker"
678
- },
679
- layerCake: {
680
- selectors: ["a.leaflet-draw-draw-cake"],
681
- dataTool: "layer-cake"
682
- },
683
- move: {
684
- selectors: ["a.leaflet-draw-draw-move"],
685
- dataTool: "move"
686
- },
687
- select: {
688
- selectors: [],
689
- dataTool: "select"
690
- },
691
- edit: {
692
- selectors: ["a.leaflet-draw-edit-edit"],
693
- dataTool: "edit"
694
- },
695
- delete: {
696
- selectors: ["a.leaflet-draw-edit-remove"],
697
- dataTool: "delete"
698
- },
699
- ruler: {
700
- selectors: [".leaflet-ruler", "a.leaflet-ruler"],
701
- dataTool: "ruler"
702
- },
703
- measurementSettings: {
704
- selectors: [".leaflet-ruler-settings-button"],
705
- dataTool: "measurement-settings"
706
- },
707
- layerStyle: {
708
- selectors: [],
709
- dataTool: "layer-style"
710
- },
711
- save: {
712
- selectors: [],
713
- dataTool: "save"
714
- }
715
- }, vt = Object.keys(Z), _e = "leaflet-geokit-tool-button-icon", Ie = ".leaflet-geokit-cake-icon, .leaflet-geokit-move-icon", wt = "[data-geokit-managed-toolbar='true']", xt = "[data-geokit-tool-popover='true']", kt = "[data-geokit-tool][aria-expanded='true']", te = /* @__PURE__ */ new WeakMap(), re = /* @__PURE__ */ new WeakMap(), oe = /* @__PURE__ */ new WeakMap();
716
- function Q(a, t, e = {}) {
717
- R(a);
718
- for (const r of vt) {
719
- const o = Z[r];
720
- for (const i of Et(a, o.selectors)) {
721
- i.setAttribute("data-geokit-tool", o.dataTool), Lt(i);
722
- const n = t == null ? void 0 : t[r];
723
- n && Mt(i, n, r), Te(i, r, {
724
- source: "leaflet-toolbar",
725
- activate: !1,
726
- onTrigger: e.onTrigger
727
- });
728
- }
729
- }
730
- Bt(a, t, e);
731
- }
732
- function Et(a, t) {
733
- const e = /* @__PURE__ */ new Set();
734
- for (const r of t)
735
- a.querySelectorAll(r).forEach((o) => {
736
- e.add(o);
737
- });
738
- return [...e];
739
- }
740
- function Lt(a) {
741
- const t = te.get(a);
742
- t && (a.removeEventListener("click", t), te.delete(a)), delete a.__geokitToolButtonConfig;
743
- const e = j(a.dataset.geokitToolButtonClass);
744
- e.length > 0 && a.classList.remove(...e), delete a.dataset.geokitToolButtonClass, a.removeAttribute("data-geokit-custom-tool-button"), a.dataset.geokitOriginalTitle !== void 0 && ye(a, "title", a.dataset.geokitOriginalTitle), a.dataset.geokitOriginalAriaLabel !== void 0 && ye(
745
- a,
746
- "aria-label",
747
- a.dataset.geokitOriginalAriaLabel
748
- ), a.dataset.geokitOriginalStyleBackgroundImage !== void 0 && ae(
749
- a,
750
- "background-image",
751
- a.dataset.geokitOriginalStyleBackgroundImage,
752
- a.dataset.geokitOriginalStyleBackgroundImagePriority
753
- ), a.dataset.geokitOriginalStylePosition !== void 0 && ae(
754
- a,
755
- "position",
756
- a.dataset.geokitOriginalStylePosition,
757
- a.dataset.geokitOriginalStylePositionPriority
758
- ), Array.from(a.children).forEach((r) => {
759
- r instanceof HTMLElement && r.dataset.geokitToolButtonIcon === "true" && r.remove();
760
- }), a.querySelectorAll(Ie).forEach((r) => {
761
- r.hidden = !1;
762
- }), a.removeAttribute("aria-expanded");
763
- }
764
- function ye(a, t, e) {
765
- e ? a.setAttribute(t, e) : a.removeAttribute(t);
766
- }
767
- function ae(a, t, e, r) {
768
- e ? a.style.setProperty(t, e, r) : a.style.removeProperty(t);
769
- }
770
- function Mt(a, t, e) {
771
- var i;
772
- Ct(a), a.__geokitToolButtonConfig = t, a.setAttribute("data-geokit-custom-tool-button", "true"), t.title && a.setAttribute("title", t.title);
773
- const r = (i = t.ariaLabel) != null ? i : t.title;
774
- r && a.setAttribute("aria-label", r);
775
- const o = j(t.className);
776
- o.length > 0 && (a.classList.add(...o), a.dataset.geokitToolButtonClass = o.join(" ")), t.iconUrl ? U(a, t, { tool: e }) : (t.iconHtml || t.renderIcon) && U(a, t, { tool: e });
777
- }
778
- function Ct(a) {
779
- var t, e;
780
- a.dataset.geokitOriginalTitle === void 0 && (a.dataset.geokitOriginalTitle = (t = a.getAttribute("title")) != null ? t : ""), a.dataset.geokitOriginalAriaLabel === void 0 && (a.dataset.geokitOriginalAriaLabel = (e = a.getAttribute("aria-label")) != null ? e : ""), a.dataset.geokitOriginalStyleBackgroundImage === void 0 && (a.dataset.geokitOriginalStyleBackgroundImage = a.style.getPropertyValue("background-image"), a.dataset.geokitOriginalStyleBackgroundImagePriority = a.style.getPropertyPriority("background-image")), a.dataset.geokitOriginalStylePosition === void 0 && (a.dataset.geokitOriginalStylePosition = a.style.getPropertyValue("position"), a.dataset.geokitOriginalStylePositionPriority = a.style.getPropertyPriority("position"));
781
- }
782
- function j(a) {
783
- return a ? a.split(/\s+/).map((t) => t.trim()).filter(Boolean) : [];
784
- }
785
- function _t(a) {
786
- return !!(a.iconUrl || a.iconHtml || a.renderIcon);
787
- }
788
- function U(a, t, e = {}) {
789
- var l, c;
790
- const [r, o] = It(t.iconSize);
791
- a.style.setProperty("background-image", "none", "important"), a.style.setProperty("position", "relative", "important"), a.querySelectorAll(Ie).forEach((d) => {
792
- d.hidden = !0;
793
- });
794
- const i = document.createElement("span");
795
- i.className = _e, i.dataset.geokitToolButtonIcon = "true", i.setAttribute("aria-hidden", "true"), i.style.setProperty("position", "absolute", "important"), i.style.setProperty("display", "block", "important"), i.style.setProperty("left", "50%", "important"), i.style.setProperty("top", "50%", "important"), i.style.setProperty("width", `${r}px`, "important"), i.style.setProperty("height", `${o}px`, "important"), i.style.setProperty("transform", "translate(-50%, -50%)", "important"), i.style.setProperty("pointer-events", "none", "important");
796
- const n = (c = t.renderIcon) == null ? void 0 : c.call(t, {
797
- tool: (l = e.tool) != null ? l : "polygon",
798
- groupId: e.groupId,
799
- button: a
800
- });
801
- if (n instanceof HTMLElement || typeof SVGElement != "undefined" && n instanceof SVGElement)
802
- i.appendChild(n);
803
- else if (typeof n == "string" && n.trim())
804
- i.innerHTML = n, be(i);
805
- else if (t.iconHtml)
806
- i.innerHTML = t.iconHtml, be(i);
807
- else if (t.iconUrl) {
808
- const d = document.createElement("img");
809
- d.src = t.iconUrl, d.alt = "", d.decoding = "async", d.draggable = !1, d.style.setProperty("display", "block", "important"), d.style.setProperty("width", "100%", "important"), d.style.setProperty("height", "100%", "important"), d.style.setProperty("object-fit", "contain", "important"), i.appendChild(d);
810
- }
811
- a.appendChild(i);
812
- }
813
- function be(a) {
814
- const t = a.firstElementChild;
815
- t && (t.style.setProperty("display", "block", "important"), t.style.setProperty("width", "100%", "important"), t.style.setProperty("height", "100%", "important"), t.style.setProperty("color", "currentColor", "important"));
816
- }
817
- function It(a) {
818
- const t = a == null ? void 0 : a[0], e = a == null ? void 0 : a[1];
819
- return typeof t == "number" && Number.isFinite(t) && t > 0 && typeof e == "number" && Number.isFinite(e) && e > 0 ? [t, e] : [18, 18];
820
- }
821
- function Te(a, t, e) {
822
- const r = (o) => {
823
- var s;
824
- const i = Tt(a), n = St(a);
825
- i != null && i.popover ? zt(a, t, i, {
826
- container: n,
827
- groupId: e.groupId
828
- }) : R(n), (s = e.onTrigger) == null || s.call(e, t, {
829
- source: e.source,
830
- groupId: e.groupId,
831
- activate: e.activate
832
- }), e.activate && (o.preventDefault(), o.stopPropagation());
833
- };
834
- a.addEventListener("click", r), te.set(a, r);
835
- }
836
- function Tt(a) {
837
- const t = a.__geokitToolButtonConfig;
838
- if (t) return t;
839
- const e = a.dataset.geokitToolButtonConfig;
840
- if (!e) return null;
841
- try {
842
- return JSON.parse(e);
843
- } catch {
844
- return null;
845
- }
846
- }
847
- function St(a) {
848
- var e;
849
- const t = a.closest("[data-geokit-map-container]");
850
- return (e = t != null ? t : a.parentElement) != null ? e : a;
851
- }
852
- function Bt(a, t, e) {
853
- var i;
854
- a.setAttribute("data-geokit-map-container", "true"), a.querySelectorAll(wt).forEach((n) => n.remove());
855
- const r = (i = e.toolbarGroups) != null ? i : [], o = r.some(
856
- (n) => (n == null ? void 0 : n.hideDefaultToolbar) !== !1
857
- );
858
- Ot(a, o), r.forEach((n) => {
859
- var c;
860
- if (!(n != null && n.id) || !Array.isArray(n.tools) || n.tools.length === 0)
861
- return;
862
- const s = document.createElement("div");
863
- s.dataset.geokitManagedToolbar = "true", s.dataset.geokitToolbarGroup = n.id, s.className = "leaflet-geokit-toolbar-group leaflet-bar", s.setAttribute("role", "toolbar"), s.setAttribute("aria-label", (c = n.ariaLabel) != null ? c : n.id), Pt(s, n.position, n.offset);
864
- const l = j(n.className);
865
- l.length > 0 && s.classList.add(...l), n.tools.forEach((d, u) => {
866
- const p = Dt(d, n, u, t == null ? void 0 : t[d]);
867
- Te(p, d, {
868
- source: "toolbar",
869
- activate: !0,
870
- groupId: n.id,
871
- onTrigger: e.onTrigger
872
- }), s.appendChild(p);
873
- }), a.appendChild(s);
874
- });
875
- }
876
- function Ot(a, t) {
877
- a.toggleAttribute("data-geokit-default-toolbar-hidden", t), a.querySelectorAll(
878
- ".leaflet-draw-toolbar, .leaflet-ruler, .leaflet-ruler-settings-control"
879
- ).forEach((e) => {
880
- t ? (e.dataset.geokitOriginalDisplay === void 0 && (e.dataset.geokitOriginalDisplay = e.style.display, e.dataset.geokitOriginalDisplayPriority = e.style.getPropertyPriority("display")), e.style.setProperty("display", "none", "important")) : e.dataset.geokitOriginalDisplay !== void 0 && (ae(
881
- e,
882
- "display",
883
- e.dataset.geokitOriginalDisplay,
884
- e.dataset.geokitOriginalDisplayPriority
885
- ), delete e.dataset.geokitOriginalDisplay, delete e.dataset.geokitOriginalDisplayPriority);
886
- });
887
- }
888
- function Dt(a, t, e, r) {
889
- var s, l, c, d, u;
890
- const o = document.createElement("button");
891
- o.type = "button", o.dataset.geokitTool = (l = (s = Z[a]) == null ? void 0 : s.dataTool) != null ? l : a, o.dataset.geokitToolbarGroup = t.id, o.dataset.geokitToolbarPosition = (c = t.position) != null ? c : "topright", o.dataset.geokitToolInstance = Ft(
892
- t.id,
893
- a,
894
- e
895
- ), o.className = "leaflet-geokit-toolbar-button", o.style.setProperty("display", "block", "important"), o.style.setProperty("width", "34px", "important"), o.style.setProperty("height", "34px", "important"), o.style.setProperty("padding", "0", "important"), o.style.setProperty("border", "0", "important"), o.style.setProperty("border-bottom", "1px solid #ccc", "important"), o.style.setProperty("background", "#fff", "important"), o.style.setProperty("cursor", "pointer", "important"), o.style.setProperty("position", "relative", "important");
896
- const i = (d = r == null ? void 0 : r.title) != null ? d : Se(a);
897
- o.title = i, o.setAttribute("aria-label", (u = r == null ? void 0 : r.ariaLabel) != null ? u : i);
898
- const n = j(r == null ? void 0 : r.className);
899
- if (n.length > 0 && o.classList.add(...n), r && (o.__geokitToolButtonConfig = r, _t(r) && U(o, r, { tool: a, groupId: t.id })), !o.querySelector(`.${_e}`)) {
900
- const p = {
901
- iconHtml: Gt(a),
902
- iconSize: [20, 20]
903
- };
904
- U(o, p, { tool: a, groupId: t.id });
905
- }
906
- return o;
907
- }
908
- function Pt(a, t = "topright", e) {
909
- const [r, o] = Ht(e);
910
- a.style.setProperty("position", "absolute", "important"), a.style.setProperty("z-index", "1000", "important"), a.style.setProperty("background", "#fff", "important"), a.style.setProperty(
911
- "box-shadow",
912
- "0 1px 5px rgba(0,0,0,0.35)",
913
- "important"
914
- );
915
- const [i, n] = t.startsWith("bottom") ? ["bottom", t.endsWith("right") ? "right" : "left"] : ["top", t.endsWith("right") ? "right" : "left"];
916
- a.style.setProperty(i, `${o}px`, "important"), a.style.setProperty(n, `${r}px`, "important");
917
- }
918
- function zt(a, t, e, r) {
919
- var s, l, c, d, u, p, g, m;
920
- if (!e.popover) return;
921
- R(r.container);
922
- const o = document.createElement("div");
923
- if (o.dataset.geokitToolPopover = "true", o.dataset.geokitTool = (l = (s = Z[t]) == null ? void 0 : s.dataTool) != null ? l : t, a.dataset.geokitToolInstance && (o.dataset.geokitToolInstance = a.dataset.geokitToolInstance), r.groupId && (o.dataset.geokitToolbarGroup = r.groupId), o.setAttribute("role", "dialog"), o.setAttribute(
924
- "aria-label",
925
- (d = (c = e.popover.ariaLabel) != null ? c : e.popover.title) != null ? d : Se(t)
926
- ), o.style.setProperty("position", "absolute", "important"), o.style.setProperty("z-index", "10001", "important"), o.style.setProperty("max-width", "260px", "important"), o.style.setProperty("padding", "10px 12px", "important"), o.style.setProperty(
927
- "border",
928
- "1px solid rgba(0,0,0,0.22)",
929
- "important"
930
- ), o.style.setProperty("border-radius", "8px", "important"), o.style.setProperty("background", "#fff", "important"), o.style.setProperty(
931
- "box-shadow",
932
- "0 8px 24px rgba(0,0,0,0.24)",
933
- "important"
934
- ), o.style.setProperty("font", "13px system-ui, sans-serif", "important"), o.style.setProperty("line-height", "1.35", "important"), e.popover.title) {
935
- const f = document.createElement("strong");
936
- f.textContent = e.popover.title, f.style.setProperty("display", "block", "important"), f.style.setProperty("margin-bottom", "4px", "important"), o.appendChild(f);
937
- }
938
- if (e.popover.body) {
939
- const f = document.createElement("div");
940
- f.textContent = e.popover.body, o.appendChild(f);
941
- }
942
- if (e.popover.html) {
943
- const f = document.createElement("div");
944
- f.innerHTML = e.popover.html, o.appendChild(f);
945
- }
946
- const i = (p = (u = e.popover).render) == null ? void 0 : p.call(u, {
947
- tool: t,
948
- groupId: r.groupId,
949
- button: a,
950
- popover: o
951
- }), n = typeof DocumentFragment != "undefined" && i instanceof DocumentFragment;
952
- if (i instanceof HTMLElement || n)
953
- o.appendChild(i);
954
- else if (typeof i == "string" && i.trim()) {
955
- const f = document.createElement("div");
956
- f.innerHTML = i, o.appendChild(f);
957
- }
958
- r.container.appendChild(o), Rt(r.container, a, o), a.setAttribute("aria-expanded", "true"), oe.set(o, {
959
- tool: t,
960
- groupId: r.groupId,
961
- button: a,
962
- config: e
963
- }), Ut(r.container, a, o), (m = (g = e.popover).onOpen) == null || m.call(g, {
964
- tool: t,
965
- groupId: r.groupId,
966
- button: a,
967
- popover: o
968
- });
969
- }
970
- function Rt(a, t, e) {
971
- const r = a.getBoundingClientRect(), o = t.getBoundingClientRect(), i = Math.max(
972
- 8,
973
- Math.min(
974
- o.left - r.left,
975
- r.width - e.offsetWidth - 8
976
- )
977
- ), n = Math.max(
978
- 8,
979
- Math.min(
980
- o.bottom - r.top + 8,
981
- r.height - e.offsetHeight - 8
982
- )
983
- );
984
- e.style.setProperty("left", `${i}px`, "important"), e.style.setProperty("top", `${n}px`, "important");
985
- }
986
- function Ut(a, t, e) {
987
- const r = (n) => {
988
- n.key === "Escape" && R(a);
989
- }, o = (n) => {
990
- const s = n.target;
991
- s instanceof Node && (e.contains(s) || t.contains(s) || R(a));
992
- };
993
- document.addEventListener("keydown", r, !0);
994
- const i = window.setTimeout(() => {
995
- e.isConnected && document.addEventListener("pointerdown", o, !0);
996
- }, 0);
997
- re.set(e, {
998
- keydown: r,
999
- pointerdown: o,
1000
- pointerdownTimer: i
1001
- });
1002
- }
1003
- function R(a) {
1004
- a.querySelectorAll(xt).forEach((t) => {
1005
- var o, i, n;
1006
- const e = oe.get(t);
1007
- e == null || e.button.removeAttribute("aria-expanded"), e || (o = Nt(a, t)) == null || o.removeAttribute(
1008
- "aria-expanded"
1009
- );
1010
- const r = re.get(t);
1011
- r && (window.clearTimeout(r.pointerdownTimer), document.removeEventListener("keydown", r.keydown, !0), document.removeEventListener(
1012
- "pointerdown",
1013
- r.pointerdown,
1014
- !0
1015
- ), re.delete(t)), t.remove(), e && ((n = (i = e.config.popover) == null ? void 0 : i.onClose) == null || n.call(i, {
1016
- tool: e.tool,
1017
- groupId: e.groupId,
1018
- button: e.button,
1019
- popover: t
1020
- }), oe.delete(t));
1021
- });
1022
- }
1023
- function Nt(a, t) {
1024
- const e = a.querySelectorAll(
1025
- kt
1026
- );
1027
- for (const r of e)
1028
- if (t.dataset.geokitToolInstance && r.dataset.geokitToolInstance === t.dataset.geokitToolInstance || r.dataset.geokitTool === t.dataset.geokitTool && r.dataset.geokitToolbarGroup === t.dataset.geokitToolbarGroup)
1029
- return r;
1030
- return null;
1031
- }
1032
- function Ft(a, t, e) {
1033
- return `${a}:${t}:${e}`;
1034
- }
1035
- function Se(a) {
1036
- return {
1037
- polygon: "Draw polygon",
1038
- polyline: "Draw line",
1039
- rectangle: "Draw rectangle",
1040
- circle: "Draw circle",
1041
- marker: "Place marker",
1042
- layerCake: "Draw layer cake",
1043
- move: "Move feature",
1044
- select: "Select feature",
1045
- edit: "Edit features",
1046
- delete: "Delete features",
1047
- ruler: "Measure distance",
1048
- measurementSettings: "Measurement settings",
1049
- layerStyle: "Layer style",
1050
- save: "Save map geometry"
1051
- }[a];
1052
- }
1053
- function Gt(a) {
1054
- const t = "currentColor", e = "none";
1055
- return {
1056
- polygon: `<svg viewBox="0 0 24 24" fill="${e}" stroke="${t}" stroke-width="1.8" stroke-linejoin="round"><path d="M5.5 7.2 9.2 4.8 18.5 8.3 16.1 18.2 6.3 15.7Z"/><circle cx="5.5" cy="7.2" r="1.2" fill="currentColor"/><circle cx="18.5" cy="8.3" r="1.2" fill="currentColor"/><circle cx="16.1" cy="18.2" r="1.2" fill="currentColor"/></svg>`,
1057
- polyline: `<svg viewBox="0 0 24 24" fill="${e}" stroke="${t}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4.8 16.7 9.2 9.5 14.4 13.1 19 6.1"/><circle cx="4.8" cy="16.7" r="1.3" fill="currentColor"/><circle cx="14.4" cy="13.1" r="1.3" fill="currentColor"/><circle cx="19" cy="6.1" r="1.3" fill="currentColor"/></svg>`,
1058
- rectangle: `<svg viewBox="0 0 24 24" fill="${e}" stroke="${t}" stroke-width="1.8"><rect x="5.5" y="6.5" width="13" height="11" rx="2"/><path d="M8.5 10h7"/></svg>`,
1059
- circle: `<svg viewBox="0 0 24 24" fill="${e}" stroke="${t}" stroke-width="1.8"><circle cx="12" cy="12" r="6.8"/><circle cx="12" cy="12" r="2" fill="currentColor"/></svg>`,
1060
- marker: `<svg viewBox="0 0 24 24" fill="${e}" stroke="${t}" stroke-width="1.7" stroke-linejoin="round"><path d="M12 3.4a6 6 0 0 0-6 6c0 4.2 4.5 9.4 5.6 10.5a.6.6 0 0 0 .8 0C13.5 18.8 18 13.6 18 9.4a6 6 0 0 0-6-6Z"/><circle cx="12" cy="9.5" r="2.1" fill="currentColor" stroke="none"/></svg>`,
1061
- layerCake: `<svg viewBox="0 0 24 24" fill="${e}" stroke="${t}" stroke-width="1.7" stroke-linecap="round"><ellipse cx="12" cy="7.6" rx="6.8" ry="2.7"/><path d="M5.2 11c1.3 1.2 3.8 2 6.8 2s5.5-.8 6.8-2M6.3 15c1.3.9 3.3 1.5 5.7 1.5s4.4-.6 5.7-1.5"/></svg>`,
1062
- move: `<svg viewBox="0 0 24 24" fill="${e}" stroke="${t}" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M12 4v16M4 12h16M12 4l-2 2M12 4l2 2M20 12l-2-2M20 12l-2 2M12 20l-2-2M12 20l2-2M4 12l2-2M4 12l2 2"/></svg>`,
1063
- select: `<svg viewBox="0 0 24 24" fill="${e}" stroke="${t}" stroke-width="1.8" stroke-linejoin="round"><path d="M6 4.8 18.5 12 13 13.4 10.2 19Z"/></svg>`,
1064
- edit: `<svg viewBox="0 0 24 24" fill="${e}" stroke="${t}" stroke-width="1.7" stroke-linejoin="round"><path d="m6 17.8 3.5-.7 7.7-7.7-2.8-2.8-7.7 7.7Z"/><path d="m12.9 7.9 2.8 2.8"/></svg>`,
1065
- delete: `<svg viewBox="0 0 24 24" fill="${e}" stroke="${t}" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M7.5 8.2h9l-.8 10a1.7 1.7 0 0 1-1.7 1.5h-4a1.7 1.7 0 0 1-1.7-1.5Z"/><path d="M9.5 8.2V6.8c0-.7.6-1.3 1.3-1.3h2.4c.7 0 1.3.6 1.3 1.3v1.4M10.5 11.5v4.8M13.5 11.5v4.8"/></svg>`,
1066
- ruler: `<svg viewBox="0 0 24 24" fill="${e}" stroke="${t}" stroke-width="1.7" stroke-linejoin="round"><path d="M5.2 17.8 17.8 5.2l1.7 1.7L6.9 19.5H5.2Z"/><path d="m12.2 8 1.5 1.5M9.9 10.3l1.5 1.5M7.6 12.6l1.5 1.5"/></svg>`,
1067
- measurementSettings: `<svg viewBox="0 0 24 24" fill="${e}" stroke="${t}" stroke-width="1.6" stroke-linecap="round"><circle cx="12" cy="12" r="3.2"/><path d="M12 4.8v2M12 17.2v2M4.8 12h2M17.2 12h2M7 7l1.4 1.4M15.6 15.6 17 17M17 7l-1.4 1.4M8.4 15.6 7 17"/></svg>`,
1068
- layerStyle: '<svg viewBox="0 0 24 24" fill="none"><path d="M5 6h14v3H5z" fill="currentColor" opacity=".9"/><path d="M5 11h14v3H5z" fill="currentColor" opacity=".65"/><path d="M5 16h14v3H5z" fill="currentColor" opacity=".4"/></svg>',
1069
- save: `<svg viewBox="0 0 24 24" fill="${e}" stroke="${t}" stroke-width="1.8" stroke-linejoin="round" stroke-linecap="round"><path d="M5.5 4.8h11.2l1.8 1.8v12.6h-13Z"/><path d="M8 4.8v5h7v-5M8.2 19.2v-5.4h7.6v5.4"/><path d="M10 16.4h4"/></svg>`
1070
- }[a];
1071
- }
1072
- function Ht(a) {
1073
- const t = a == null ? void 0 : a[0], e = a == null ? void 0 : a[1];
1074
- return typeof t == "number" && Number.isFinite(t) && t >= 0 && typeof e == "number" && Number.isFinite(e) && e >= 0 ? [t, e] : [10, 10];
1075
- }
1076
- const Ae = /* @__PURE__ */ new WeakSet();
1077
- function Vt(a = x) {
1078
- var r;
1079
- if (Ae.has(a)) return;
1080
- const t = a.DrawToolbar;
1081
- if (!((r = t == null ? void 0 : t.prototype) != null && r.getModeHandlers)) return;
1082
- const e = t.prototype.getModeHandlers;
1083
- t.prototype.getModeHandlers = function(o) {
1084
- var n, s, l, c;
1085
- const i = e.call(this, o);
1086
- if ((n = this.options) != null && n.cake) {
1087
- const d = (s = a.Draw) == null ? void 0 : s.Cake;
1088
- if (!d) return i;
1089
- i.push({
1090
- enabled: !0,
1091
- handler: new d(o, this.options.cake),
1092
- title: "Draw Layer Cake (Subtractive Zones)"
1093
- });
1094
- }
1095
- if ((l = this.options) != null && l.move) {
1096
- const d = (c = a.Draw) == null ? void 0 : c.Move;
1097
- if (!d) return i;
1098
- i.push({
1099
- enabled: !0,
1100
- handler: new d(o, this.options.move),
1101
- title: "Move/Translate Features"
1102
- });
1103
- }
1104
- return i;
1105
- }, Ae.add(a);
1106
- }
1107
- const G = class G extends x.Draw.Circle {
1108
- constructor(t, e) {
1109
- super(t, e), this.type = G.TYPE;
1110
- }
1111
- addHooks() {
1112
- super.addHooks();
1113
- const t = this._tooltip;
1114
- t != null && t.updateContent && t.updateContent({
1115
- text: "Click and drag to draw the Layer Cake base",
1116
- subtext: "Release mouse to finish base layer"
1117
- });
1118
- }
1119
- };
1120
- h(G, "TYPE", "cake");
1121
- let N = G;
1122
- x.Draw.Cake = N;
1123
- function Jt(a) {
1124
- const t = a.Draw;
1125
- if (!t || t.Cake) return;
1126
- const r = class r extends t.Circle {
1127
- constructor(i, n) {
1128
- super(i, n), this.type = r.TYPE;
1129
- }
1130
- addHooks() {
1131
- super.addHooks();
1132
- const i = this._tooltip;
1133
- i != null && i.updateContent && i.updateContent({
1134
- text: "Click and drag to draw the Layer Cake base",
1135
- subtext: "Release mouse to finish base layer"
1136
- });
1137
- }
1138
- };
1139
- h(r, "TYPE", "cake");
1140
- let e = r;
1141
- t.Cake = e;
1142
- }
1143
- const H = class H extends x.Draw.Feature {
1144
- constructor(e, r) {
1145
- super(e, r);
1146
- h(this, "_featureGroup");
1147
- h(this, "_selectedLayer", null);
1148
- h(this, "_originalLatLngs", null);
1149
- h(this, "_dragStartLatLng", null);
1150
- h(this, "_isDragging", !1);
1151
- h(this, "_pendingMove", null);
1152
- this.type = H.TYPE, this._featureGroup = (r == null ? void 0 : r.featureGroup) || new x.FeatureGroup();
1153
- }
1154
- enable() {
1155
- this._enabled || super.enable();
1156
- }
1157
- disable() {
1158
- this._enabled && (this._cleanupDragging(), super.disable());
1159
- }
1160
- addHooks() {
1161
- const e = this._map;
1162
- if (!e) return;
1163
- x.DomUtil.addClass(e.getContainer(), "leaflet-draw-move-mode"), this._featureGroup.eachLayer((o) => {
1164
- this._enableLayerHover(o);
1165
- });
1166
- const r = this._tooltip;
1167
- r != null && r.updateContent && r.updateContent({
1168
- text: "Click and drag a feature to move it",
1169
- subtext: ""
1170
- });
1171
- }
1172
- removeHooks() {
1173
- const e = this._map;
1174
- e && (x.DomUtil.removeClass(e.getContainer(), "leaflet-draw-move-mode"), this._featureGroup.eachLayer((r) => {
1175
- this._disableLayerHover(r);
1176
- }), this._cleanupDragging());
1177
- }
1178
- _enableLayerHover(e) {
1179
- e.on && (e.on("mouseover", this._onLayerMouseOver, this), e.on("mouseout", this._onLayerMouseOut, this), e.on("mousedown", this._onLayerMouseDown, this));
1180
- }
1181
- _disableLayerHover(e) {
1182
- e.off && (e.off("mouseover", this._onLayerMouseOver, this), e.off("mouseout", this._onLayerMouseOut, this), e.off("mousedown", this._onLayerMouseDown, this));
1183
- }
1184
- _onLayerMouseOver(e) {
1185
- if (this._isDragging) return;
1186
- const r = e.target;
1187
- if (r.getElement) {
1188
- const o = r.getElement();
1189
- o && (o.style.cursor = "grab");
1190
- } else r._path && (r._path.style.cursor = "grab");
1191
- }
1192
- _onLayerMouseOut(e) {
1193
- if (this._isDragging) return;
1194
- const r = e.target;
1195
- if (r.getElement) {
1196
- const o = r.getElement();
1197
- o && (o.style.cursor = "");
1198
- } else r._path && (r._path.style.cursor = "");
1199
- }
1200
- _onLayerMouseDown(e) {
1201
- if (this._isDragging) return;
1202
- x.DomEvent.stopPropagation(e.originalEvent), x.DomEvent.preventDefault(e.originalEvent);
1203
- const r = e.target;
1204
- if (this._selectedLayer = r, this._isDragging = !0, this._dragStartLatLng = e.latlng, this._storeOriginalLatLngs(r), r.getElement) {
1205
- const i = r.getElement();
1206
- i && (i.style.cursor = "grabbing");
1207
- } else r._path && (r._path.style.cursor = "grabbing");
1208
- this._map.on("mousemove", this._onMouseMove, this), this._map.on("mouseup", this._onMouseUp, this);
1209
- const o = r.toGeoJSON();
1210
- this._pendingMove = {
1211
- layer: r,
1212
- originalGeoJSON: o,
1213
- newGeoJSON: o
1214
- // Will be updated on mouseup
1215
- };
1216
- }
1217
- _storeOriginalLatLngs(e) {
1218
- e.getLatLng ? this._originalLatLngs = e.getLatLng() : e.getLatLngs && (this._originalLatLngs = JSON.parse(
1219
- JSON.stringify(e.getLatLngs())
1220
- ));
1221
- }
1222
- _onMouseMove(e) {
1223
- if (!this._isDragging || !this._selectedLayer || !this._dragStartLatLng)
1224
- return;
1225
- const r = this._selectedLayer, o = {
1226
- lat: e.latlng.lat - this._dragStartLatLng.lat,
1227
- lng: e.latlng.lng - this._dragStartLatLng.lng
1228
- };
1229
- if (r.setLatLng) {
1230
- const i = x.latLng(
1231
- this._originalLatLngs.lat + o.lat,
1232
- this._originalLatLngs.lng + o.lng
1233
- );
1234
- r.setLatLng(i);
1235
- } else if (r.setLatLngs) {
1236
- const i = this._offsetLatLngs(this._originalLatLngs, o);
1237
- r.setLatLngs(i);
1238
- }
1239
- }
1240
- _offsetLatLngs(e, r) {
1241
- return e instanceof x.LatLng || e.lat !== void 0 && e.lng !== void 0 ? x.latLng(e.lat + r.lat, e.lng + r.lng) : Array.isArray(e) ? e.map((o) => this._offsetLatLngs(o, r)) : e;
1242
- }
1243
- _onMouseUp(e) {
1244
- var o, i;
1245
- if (!this._isDragging || !this._selectedLayer) return;
1246
- this._pendingMove && (this._pendingMove.newGeoJSON = this._selectedLayer.toGeoJSON());
1247
- const r = this._selectedLayer;
1248
- if (r.getElement) {
1249
- const n = r.getElement();
1250
- n && (n.style.cursor = "grab");
1251
- } else r._path && (r._path.style.cursor = "grab");
1252
- this._map.fire("draw:moveend", {
1253
- layer: this._selectedLayer,
1254
- originalGeoJSON: (o = this._pendingMove) == null ? void 0 : o.originalGeoJSON,
1255
- newGeoJSON: (i = this._pendingMove) == null ? void 0 : i.newGeoJSON
1256
- }), this._map.off("mousemove", this._onMouseMove, this), this._map.off("mouseup", this._onMouseUp, this), this._isDragging = !1;
1257
- }
1258
- _cleanupDragging() {
1259
- if (this._selectedLayer) {
1260
- const e = this._selectedLayer;
1261
- if (e.getElement) {
1262
- const r = e.getElement();
1263
- r && (r.style.cursor = "");
1264
- } else e._path && (e._path.style.cursor = "");
1265
- }
1266
- this._map.off("mousemove", this._onMouseMove, this), this._map.off("mouseup", this._onMouseUp, this), this._selectedLayer = null, this._originalLatLngs = null, this._dragStartLatLng = null, this._isDragging = !1, this._pendingMove = null;
1267
- }
1268
- /**
1269
- * Confirm the pending move and dispatch the final event.
1270
- */
1271
- confirmMove() {
1272
- this._pendingMove && (this._map.fire("draw:moveconfirmed", {
1273
- layer: this._pendingMove.layer,
1274
- originalGeoJSON: this._pendingMove.originalGeoJSON,
1275
- newGeoJSON: this._pendingMove.newGeoJSON
1276
- }), this._cleanupDragging());
1277
- }
1278
- /**
1279
- * Cancel the pending move and revert the layer to its original position.
1280
- */
1281
- cancelMove() {
1282
- if (!this._pendingMove) return;
1283
- const e = this._pendingMove.layer;
1284
- e.setLatLng && this._originalLatLngs ? e.setLatLng(this._originalLatLngs) : e.setLatLngs && this._originalLatLngs && e.setLatLngs(this._originalLatLngs), this._cleanupDragging();
1285
- }
1286
- /**
1287
- * Check if there's a pending move awaiting confirmation.
1288
- */
1289
- hasPendingMove() {
1290
- return this._pendingMove !== null;
1291
- }
1292
- };
1293
- h(H, "TYPE", "move");
1294
- let ie = H;
1295
- x.Draw.Move = ie;
1296
- function Zt(a) {
1297
- const t = a.Draw;
1298
- if (!t || t.Move) return;
1299
- const r = class r extends t.Feature {
1300
- constructor(n, s) {
1301
- super(n, s);
1302
- h(this, "_featureGroup");
1303
- h(this, "_selectedLayer", null);
1304
- h(this, "_originalLatLngs", null);
1305
- h(this, "_dragStartLatLng", null);
1306
- h(this, "_isDragging", !1);
1307
- h(this, "_pendingMove", null);
1308
- this.type = r.TYPE, this._featureGroup = (s == null ? void 0 : s.featureGroup) || new x.FeatureGroup();
1309
- }
1310
- enable() {
1311
- this._enabled || super.enable();
1312
- }
1313
- disable() {
1314
- this._enabled && (this._cleanupDragging(), super.disable());
1315
- }
1316
- addHooks() {
1317
- const n = this._map;
1318
- if (!n) return;
1319
- a.DomUtil.addClass(n.getContainer(), "leaflet-draw-move-mode"), this._featureGroup.eachLayer((l) => {
1320
- this._enableLayerHover(l);
1321
- });
1322
- const s = this._tooltip;
1323
- s != null && s.updateContent && s.updateContent({
1324
- text: "Click and drag a feature to move it",
1325
- subtext: ""
1326
- });
1327
- }
1328
- removeHooks() {
1329
- const n = this._map;
1330
- n && (a.DomUtil.removeClass(n.getContainer(), "leaflet-draw-move-mode"), this._featureGroup.eachLayer((s) => {
1331
- this._disableLayerHover(s);
1332
- }), this._cleanupDragging());
1333
- }
1334
- _enableLayerHover(n) {
1335
- n.on && (n.on("mouseover", this._onLayerMouseOver, this), n.on("mouseout", this._onLayerMouseOut, this), n.on("mousedown", this._onLayerMouseDown, this));
1336
- }
1337
- _disableLayerHover(n) {
1338
- n.off && (n.off("mouseover", this._onLayerMouseOver, this), n.off("mouseout", this._onLayerMouseOut, this), n.off("mousedown", this._onLayerMouseDown, this));
1339
- }
1340
- _onLayerMouseOver(n) {
1341
- if (this._isDragging) return;
1342
- const s = n.target;
1343
- if (s.getElement) {
1344
- const l = s.getElement();
1345
- l && (l.style.cursor = "grab");
1346
- } else s._path && (s._path.style.cursor = "grab");
1347
- }
1348
- _onLayerMouseOut(n) {
1349
- if (this._isDragging) return;
1350
- const s = n.target;
1351
- if (s.getElement) {
1352
- const l = s.getElement();
1353
- l && (l.style.cursor = "");
1354
- } else s._path && (s._path.style.cursor = "");
1355
- }
1356
- _onLayerMouseDown(n) {
1357
- if (this._isDragging) return;
1358
- a.DomEvent.stopPropagation(n.originalEvent), a.DomEvent.preventDefault(n.originalEvent);
1359
- const s = n.target;
1360
- if (this._selectedLayer = s, this._isDragging = !0, this._dragStartLatLng = n.latlng, this._storeOriginalLatLngs(s), s.getElement) {
1361
- const c = s.getElement();
1362
- c && (c.style.cursor = "grabbing");
1363
- } else s._path && (s._path.style.cursor = "grabbing");
1364
- this._map.on("mousemove", this._onMouseMove, this), this._map.on("mouseup", this._onMouseUp, this);
1365
- const l = s.toGeoJSON();
1366
- this._pendingMove = {
1367
- layer: s,
1368
- originalGeoJSON: l,
1369
- newGeoJSON: l
1370
- };
1371
- }
1372
- _storeOriginalLatLngs(n) {
1373
- n.getLatLng ? this._originalLatLngs = n.getLatLng() : n.getLatLngs && (this._originalLatLngs = JSON.parse(
1374
- JSON.stringify(n.getLatLngs())
1375
- ));
1376
- }
1377
- _onMouseMove(n) {
1378
- if (!this._isDragging || !this._selectedLayer || !this._dragStartLatLng)
1379
- return;
1380
- const s = this._selectedLayer, l = {
1381
- lat: n.latlng.lat - this._dragStartLatLng.lat,
1382
- lng: n.latlng.lng - this._dragStartLatLng.lng
1383
- };
1384
- if (s.setLatLng) {
1385
- const c = a.latLng(
1386
- this._originalLatLngs.lat + l.lat,
1387
- this._originalLatLngs.lng + l.lng
1388
- );
1389
- s.setLatLng(c);
1390
- } else if (s.setLatLngs) {
1391
- const c = this._offsetLatLngs(this._originalLatLngs, l);
1392
- s.setLatLngs(c);
1393
- }
1394
- }
1395
- _offsetLatLngs(n, s) {
1396
- return n instanceof a.LatLng || n.lat !== void 0 && n.lng !== void 0 ? a.latLng(n.lat + s.lat, n.lng + s.lng) : Array.isArray(n) ? n.map((l) => this._offsetLatLngs(l, s)) : n;
1397
- }
1398
- _onMouseUp(n) {
1399
- var l, c;
1400
- if (!this._isDragging || !this._selectedLayer) return;
1401
- this._pendingMove && (this._pendingMove.newGeoJSON = this._selectedLayer.toGeoJSON());
1402
- const s = this._selectedLayer;
1403
- if (s.getElement) {
1404
- const d = s.getElement();
1405
- d && (d.style.cursor = "grab");
1406
- } else s._path && (s._path.style.cursor = "grab");
1407
- this._map.fire("draw:moveend", {
1408
- layer: this._selectedLayer,
1409
- originalGeoJSON: (l = this._pendingMove) == null ? void 0 : l.originalGeoJSON,
1410
- newGeoJSON: (c = this._pendingMove) == null ? void 0 : c.newGeoJSON
1411
- }), this._map.off("mousemove", this._onMouseMove, this), this._map.off("mouseup", this._onMouseUp, this), this._isDragging = !1;
1412
- }
1413
- _cleanupDragging() {
1414
- if (this._selectedLayer) {
1415
- const n = this._selectedLayer;
1416
- if (n.getElement) {
1417
- const s = n.getElement();
1418
- s && (s.style.cursor = "");
1419
- } else n._path && (n._path.style.cursor = "");
1420
- }
1421
- this._map.off("mousemove", this._onMouseMove, this), this._map.off("mouseup", this._onMouseUp, this), this._selectedLayer = null, this._originalLatLngs = null, this._dragStartLatLng = null, this._isDragging = !1, this._pendingMove = null;
1422
- }
1423
- confirmMove() {
1424
- this._pendingMove && (this._map.fire("draw:moveconfirmed", {
1425
- layer: this._pendingMove.layer,
1426
- originalGeoJSON: this._pendingMove.originalGeoJSON,
1427
- newGeoJSON: this._pendingMove.newGeoJSON
1428
- }), this._cleanupDragging());
1429
- }
1430
- cancelMove() {
1431
- if (!this._pendingMove) return;
1432
- const n = this._pendingMove.layer;
1433
- n.setLatLng && this._originalLatLngs ? n.setLatLng(this._originalLatLngs) : n.setLatLngs && this._originalLatLngs && n.setLatLngs(this._originalLatLngs), this._cleanupDragging();
1434
- }
1435
- hasPendingMove() {
1436
- return this._pendingMove !== null;
1437
- }
1438
- };
1439
- h(r, "TYPE", "move");
1440
- let e = r;
1441
- t.Move = e;
1442
- }
1443
- const jt = 63710088e-1;
1444
- function W(a) {
1445
- return a * Math.PI / 180;
1446
- }
1447
- function ve(a) {
1448
- return a * 180 / Math.PI;
1449
- }
1450
- function Yt(a, t, e) {
1451
- const r = t / jt, o = W(e), i = W(a.lat), n = W(a.lng), s = Math.sin(i), l = Math.cos(i), c = Math.sin(r), d = Math.cos(r), u = s * d + l * c * Math.cos(o), p = Math.asin(u), g = Math.sin(o) * c * l, m = d - s * u, f = n + Math.atan2(g, m);
1452
- return { lat: ve(p), lng: ve(f) };
1453
- }
1454
- function qt(a) {
1455
- let t = 0;
1456
- for (let e = 0; e < a.length - 1; e++) {
1457
- const [r, o] = a[e], [i, n] = a[e + 1];
1458
- t += r * n - i * o;
1459
- }
1460
- return t / 2;
1461
- }
1462
- function ne(a) {
1463
- const t = a[0], e = a.at(-1);
1464
- return !t || !e || t[0] === e[0] && t[1] === e[1] ? a : [...a, t];
1465
- }
1466
- function se(a, t) {
1467
- const e = ne(a);
1468
- if (qt(e) < 0 === t) return e;
1469
- const i = [...e].reverse();
1470
- return ne(i);
1471
- }
1472
- function le(a, t, e) {
1473
- if (e < 4) throw new Error("steps must be >= 4");
1474
- const r = [];
1475
- for (let o = 0; o < e; o++) {
1476
- const i = o / e * 360, n = Yt(a, t, i);
1477
- r.push([n.lng, n.lat]);
1478
- }
1479
- return ne(r);
1480
- }
1481
- function Kt(a) {
1482
- const { id: t, center: e, radiusMeters: r, layerIndex: o, steps: i } = a, n = se(le(e, r, i), !1);
1483
- return {
1484
- type: "Feature",
1485
- properties: {
1486
- id: t,
1487
- layer_index: o,
1488
- radius_outer: r,
1489
- type: "core",
1490
- _meta: {
1491
- lat: e.lat,
1492
- lng: e.lng,
1493
- radius: r
1494
- }
1495
- },
1496
- geometry: { type: "Polygon", coordinates: [n] }
1497
- };
1498
- }
1499
- function Qt(a) {
1500
- const {
1501
- id: t,
1502
- center: e,
1503
- radiusOuterMeters: r,
1504
- radiusInnerMeters: o,
1505
- layerIndex: i,
1506
- steps: n
1507
- } = a, s = se(
1508
- le(e, r, n),
1509
- !1
1510
- ), l = se(
1511
- le(e, o, n),
1512
- !0
1513
- );
1514
- return {
1515
- type: "Feature",
1516
- properties: {
1517
- id: t,
1518
- layer_index: i,
1519
- radius_outer: r,
1520
- type: "ring",
1521
- _meta: {
1522
- lat: e.lat,
1523
- lng: e.lng,
1524
- radius: r
1525
- }
1526
- },
1527
- geometry: { type: "Polygon", coordinates: [s, l] }
1528
- };
1529
- }
1530
- function Wt(a) {
1531
- const { circles: t, steps: e = 64 } = a, r = [...t].sort((i, n) => i.getRadius() - n.getRadius()), o = [];
1532
- return r.forEach((i, n) => {
1533
- const s = i.getLatLng(), l = i.getRadius(), c = de();
1534
- if (n === 0) {
1535
- o.push(
1536
- Kt({ id: c, center: s, radiusMeters: l, layerIndex: n, steps: e })
1537
- );
1538
- return;
1539
- }
1540
- const u = r[n - 1].getRadius();
1541
- o.push(
1542
- Qt({
1543
- id: c,
1544
- center: s,
1545
- radiusOuterMeters: l,
1546
- radiusInnerMeters: u,
1547
- layerIndex: n,
1548
- steps: e
1549
- })
1550
- );
1551
- }), { type: "FeatureCollection", features: o };
1552
- }
1553
- function P(a) {
1554
- a.preventDefault(), a.stopPropagation();
1555
- }
1556
- function Xt(a) {
1557
- var c, d;
1558
- const { root: t, addButtonId: e, saveButtonId: r, onAddRing: o, onSave: i } = a, n = (c = t.querySelector) == null ? void 0 : c.call(t, `#${e}`), s = (d = t.querySelector) == null ? void 0 : d.call(t, `#${r}`);
1559
- if (!n || !s) return;
1560
- const l = "data-cake-controls-bound";
1561
- if (!(n.hasAttribute(l) || s.hasAttribute(l))) {
1562
- n.setAttribute(l, "true"), s.setAttribute(l, "true");
1563
- for (const u of [n, s])
1564
- u.addEventListener("pointerdown", P), u.addEventListener("mousedown", P), u.addEventListener("touchstart", P);
1565
- n.addEventListener("click", (u) => {
1566
- P(u), o();
1567
- }), s.addEventListener("click", (u) => {
1568
- P(u), i();
1569
- });
1570
- }
1571
- }
1572
- function $t(a) {
1573
- var e;
1574
- const t = (e = a.options) != null ? e : {};
1575
- t.original || (t.original = { ...t }), t.editing || (t.editing = { ...t });
1576
- }
1577
- function z(a, t) {
1578
- if (t === "imperial") {
1579
- const e = a * 3.28084;
1580
- return e >= 5280 ? `${(e / 5280).toFixed(2)} mi` : `${Math.round(e)} ft`;
1581
- }
1582
- return a >= 1e3 ? `${(a / 1e3).toFixed(2)} km` : `${Math.round(a)} m`;
1583
- }
1584
- class er {
1585
- constructor(t, e, r, o = "metric") {
1586
- h(this, "map");
1587
- h(this, "layers", []);
1588
- h(this, "controlsGroup");
1589
- h(this, "onSave");
1590
- h(this, "sessionId", de().slice(0, 8));
1591
- h(this, "baseCircleOptions");
1592
- h(this, "detachMapListeners", []);
1593
- h(this, "renderScheduled", !1);
1594
- h(this, "measurementSystem");
1595
- this.map = t, this.onSave = r, this.measurementSystem = o, this.controlsGroup = x.layerGroup().addTo(t), this.baseCircleOptions = { ...e.options }, delete this.baseCircleOptions.editing, delete this.baseCircleOptions.original, this.addLayer(e), this.installEditEventBridges(), this.renderControls();
1596
- }
1597
- installEditEventBridges() {
1598
- var d, u, p, g, m, f, A, v;
1599
- const t = x, e = (u = (d = t == null ? void 0 : t.Draw) == null ? void 0 : d.Event) == null ? void 0 : u.EDITMOVE, r = (g = (p = t == null ? void 0 : t.Draw) == null ? void 0 : p.Event) == null ? void 0 : g.EDITRESIZE, o = (f = (m = t == null ? void 0 : t.Draw) == null ? void 0 : m.Event) == null ? void 0 : f.EDITSTART, i = (v = (A = t == null ? void 0 : t.Draw) == null ? void 0 : A.Event) == null ? void 0 : v.EDITSTOP;
1600
- if (!e || !r) return;
1601
- const n = (y) => {
1602
- const b = y == null ? void 0 : y.layer;
1603
- b && this.layers.includes(b) && this.syncCenters(b);
1604
- }, s = (y) => {
1605
- const b = y == null ? void 0 : y.layer;
1606
- b && this.layers.includes(b) && (this.updateLabels(b), this.requestRenderControls());
1607
- }, l = (y) => {
1608
- var k;
1609
- const b = y == null ? void 0 : y.layer;
1610
- if (!b || !this.layers.includes(b)) return;
1611
- const w = b;
1612
- ((k = w.getTooltip) == null ? void 0 : k.call(w)) && this.updateLabels(w);
1613
- }, c = () => {
1614
- this.layers.forEach((y) => {
1615
- var w;
1616
- const b = (w = y.getTooltip) == null ? void 0 : w.call(y);
1617
- b && (y.setTooltipContent(
1618
- z(y.getRadius(), this.measurementSystem)
1619
- ), b.options.offset = [10, 0], b.options.direction = "right", y.closeTooltip(), y.openTooltip());
1620
- });
1621
- };
1622
- this.map.on(e, n), this.map.on(r, s), o && (this.map.on(o, l), this.detachMapListeners.push(() => this.map.off(o, l))), i && (this.map.on(i, c), this.detachMapListeners.push(() => this.map.off(i, c))), this.detachMapListeners.push(() => this.map.off(e, n)), this.detachMapListeners.push(() => this.map.off(r, s));
1623
- }
1624
- requestRenderControls() {
1625
- if (this.renderScheduled) return;
1626
- this.renderScheduled = !0, (typeof requestAnimationFrame == "function" ? requestAnimationFrame : (e) => setTimeout(() => e(0), 0))(() => {
1627
- this.renderScheduled = !1, this.renderControls();
1628
- });
1629
- }
1630
- addLayer(t) {
1631
- this.layers.push(t), t.addTo(this.map), t.bindTooltip(
1632
- z(t.getRadius(), this.measurementSystem),
1633
- {
1634
- permanent: !0,
1635
- direction: "right",
1636
- className: "cake-label",
1637
- offset: [10, 0]
1638
- }
1639
- );
1640
- const e = t.editing;
1641
- setTimeout(() => {
1642
- var r, o, i, n, s;
1643
- try {
1644
- if ((r = t.redraw) == null || r.call(t), $t(t), (o = e == null ? void 0 : e.enabled) != null && o.call(e)) {
1645
- (i = e.updateMarkers) == null || i.call(e), this.requestRenderControls();
1646
- return;
1647
- }
1648
- (n = e == null ? void 0 : e.enable) == null || n.call(e), (s = e == null ? void 0 : e.updateMarkers) == null || s.call(e), this.requestRenderControls();
1649
- } catch {
1650
- }
1651
- }, 0);
1652
- }
1653
- addRing() {
1654
- if (this.layers.length >= 10) return;
1655
- const t = this.getLargestCircle();
1656
- if (!t) return;
1657
- const e = t.getRadius() * 1.5, r = x.circle(t.getLatLng(), {
1658
- ...this.baseCircleOptions,
1659
- radius: e
1660
- });
1661
- this.addLayer(r), this.renderControls();
1662
- }
1663
- save() {
1664
- const t = Wt({ circles: this.layers });
1665
- this.onSave(t), this.destroy();
1666
- }
1667
- getLargestCircle() {
1668
- return this.layers.length === 0 ? null : this.layers.reduce(
1669
- (t, e) => t.getRadius() > e.getRadius() ? t : e
1670
- );
1671
- }
1672
- syncCenters(t) {
1673
- const e = t.getLatLng();
1674
- this.layers.forEach((r) => {
1675
- var o, i, n;
1676
- r !== t && (r.setLatLng(e), (o = r.redraw) == null || o.call(r), (n = (i = r.editing) == null ? void 0 : i.updateMarkers) == null || n.call(i));
1677
- }), this.requestRenderControls();
1678
- }
1679
- /**
1680
- * Update the label for the active circle being resized.
1681
- * Shows both total radius and delta (ring width) from the next smaller circle.
1682
- * Positions the tooltip on the left side to avoid toolbar interference.
1683
- */
1684
- updateLabels(t) {
1685
- var n;
1686
- const e = t.getRadius();
1687
- let r = z(e, this.measurementSystem);
1688
- const o = this.layers.filter(
1689
- (s) => s !== t && s.getRadius() < e
1690
- );
1691
- if (o.length > 0) {
1692
- const s = o.reduce(
1693
- (d, u) => d.getRadius() > u.getRadius() ? d : u
1694
- ), l = e - s.getRadius(), c = z(l, this.measurementSystem);
1695
- r = `${z(e, this.measurementSystem)} (+${c})`;
1696
- }
1697
- const i = (n = t.getTooltip) == null ? void 0 : n.call(t);
1698
- if (i) {
1699
- t.setTooltipContent(r);
1700
- const l = t.getBounds().getSouthWest();
1701
- l.lat = t.getLatLng().lat, i.options.direction = "left", i.options.offset = [-10, 0], i.setLatLng(l), t.closeTooltip(), t.openTooltip();
1702
- }
1703
- }
1704
- renderControls() {
1705
- this.controlsGroup.clearLayers();
1706
- const t = this.getLargestCircle();
1707
- if (!t) return;
1708
- const r = t.getBounds().getNorthEast(), o = `cake-add-${this.sessionId}`, i = `cake-save-${this.sessionId}`, n = x.divIcon({
1709
- className: "layer-cake-controls",
1710
- html: `
1711
- <div class="layer-cake-controls__container">
1712
- <button id="${o}" type="button">➕ Ring</button>
1713
- <button id="${i}" type="button" class="layer-cake-controls__save">💾 Save</button>
1714
- </div>
1715
- `,
1716
- iconSize: [140, 40],
1717
- iconAnchor: [-10, 20]
1718
- });
1719
- x.marker(r, {
1720
- icon: n,
1721
- interactive: !0,
1722
- keyboard: !1,
1723
- bubblingMouseEvents: !1
1724
- }).addTo(this.controlsGroup), setTimeout(() => {
1725
- const s = this.map.getContainer();
1726
- Xt({
1727
- root: s,
1728
- addButtonId: o,
1729
- saveButtonId: i,
1730
- onAddRing: () => this.addRing(),
1731
- onSave: () => this.save()
1732
- });
1733
- }, 0);
1734
- }
1735
- destroy() {
1736
- this.detachMapListeners.forEach((t) => {
1737
- try {
1738
- t();
1739
- } catch {
1740
- }
1741
- }), this.detachMapListeners = [], this.layers.forEach((t) => this.map.removeLayer(t)), this.layers = [], this.controlsGroup.clearLayers(), this.map.removeLayer(this.controlsGroup);
1742
- }
1743
- }
1744
- const tr = `<?xml version="1.0" encoding="utf-8"?>
1745
- \r<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
1746
- <svg width="800px" height="800px" viewBox="0 -1.67 47.336 47.336" xmlns="http://www.w3.org/2000/svg">\r
1747
- <g id="Group_42" data-name="Group 42" transform="translate(-172.455 -364.36)">\r
1748
- <path id="Rectangle_17" data-name="Rectangle 17" d="M4.351,0H40.984a4.351,4.351,0,0,1,4.351,4.351V22.117a1,1,0,0,1-1,1H1a1,1,0,0,1-1-1V4.351A4.351,4.351,0,0,1,4.351,0Z" transform="translate(173.455 384.243)" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>\r
1749
- <path id="Path_90" data-name="Path 90" d="M218.79,390.249a3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778,3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778,3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778,3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778,3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778,3.778,3.778,0,0,1-3.778,3.778h0a3.778,3.778,0,0,1-3.777-3.778" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>\r
1750
- <g id="Group_41" data-name="Group 41">\r
1751
- <path id="Rectangle_18" data-name="Rectangle 18" d="M4.351,0H26.473a4.351,4.351,0,0,1,4.351,4.351V17.883a1,1,0,0,1-1,1H1a1,1,0,0,1-1-1V4.351A4.351,4.351,0,0,1,4.351,0Z" transform="translate(180.71 365.36)" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>\r
1752
- <path id="Path_91" data-name="Path 91" d="M211.234,370.794a3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778,3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778,3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778,3.778,3.778,0,0,1-3.778,3.778h0a3.779,3.779,0,0,1-3.778-3.778" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>\r
1753
- </g>\r
1754
- </g>\r
1755
- </svg>`, rr = `<?xml version="1.0" encoding="utf-8"?>
1756
- <!-- Four-way directional arrow icon for move tool -->
1757
- <svg width="800px" height="800px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
1758
- <g fill="none" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
1759
- <!-- Up arrow -->
1760
- <path d="M12 2 L12 22"/>
1761
- <path d="M12 2 L9 5"/>
1762
- <path d="M12 2 L15 5"/>
1763
- <!-- Down arrow -->
1764
- <path d="M12 22 L9 19"/>
1765
- <path d="M12 22 L15 19"/>
1766
- <!-- Left arrow -->
1767
- <path d="M2 12 L22 12"/>
1768
- <path d="M2 12 L5 9"/>
1769
- <path d="M2 12 L5 15"/>
1770
- <!-- Right arrow -->
1771
- <path d="M22 12 L19 9"/>
1772
- <path d="M22 12 L19 15"/>
1773
- </g>
1774
- </svg>
1775
- `, Be = 6378137, S = 6356752314245e-6, T = 1 / 298.257223563, or = Math.PI / 180, ar = 180 / Math.PI, F = 1e9;
1776
- function ir(a) {
1777
- const t = BigInt(Math.round(a * F));
1778
- return Number(t) / F;
1779
- }
1780
- function B(a) {
1781
- return ir(a) * or;
1782
- }
1783
- function we(a) {
1784
- const t = a * ar % 360;
1785
- return t < 0 ? t + 360 : t;
1786
- }
1787
- function ce(a) {
1788
- const t = BigInt(Math.round(a * F));
1789
- return Number(t) / F;
1790
- }
1791
- function nr(a, t, e, r) {
1792
- const o = sr(a, t, e, r);
1793
- if (o.converged)
1794
- return {
1795
- meters: ce(o.distanceMeters),
1796
- bearingDegrees: we(o.bearingRad),
1797
- algorithm: "vincenty",
1798
- iterations: o.iterations
1799
- };
1800
- const i = lr(a, t, e, r);
1801
- return {
1802
- meters: ce(i.distanceMeters),
1803
- bearingDegrees: we(i.bearingRad),
1804
- algorithm: "karney",
1805
- iterations: o.iterations
1806
- };
1807
- }
1808
- function sr(a, t, e, r) {
1809
- const o = B(a), i = B(e), n = B(r - t), s = Math.atan((1 - T) * Math.tan(o)), l = Math.atan((1 - T) * Math.tan(i)), c = Math.sin(s), d = Math.cos(s), u = Math.sin(l), p = Math.cos(l);
1810
- let g = n, m = 0, f = 0;
1811
- const A = 200;
1812
- let v = 0, y = 0, b = 0, w = 0, E = 0;
1813
- for (; Math.abs(g - m) > 1e-12 && f < A; ) {
1814
- const ue = Math.sin(g), he = Math.cos(g);
1815
- if (v = Math.sqrt(
1816
- (p * ue) ** 2 + (d * u - c * p * he) ** 2
1817
- ), v === 0)
1818
- return {
1819
- distanceMeters: 0,
1820
- bearingRad: 0,
1821
- iterations: f,
1822
- converged: !0
1823
- };
1824
- y = c * u + d * p * he, b = Math.atan2(v, y);
1825
- const pe = d * p * ue / v;
1826
- w = 1 - pe ** 2, E = w === 0 ? 0 : y - 2 * c * u / w;
1827
- const Y = T / 16 * w * (4 + T * (4 - 3 * w));
1828
- m = g, g = n + (1 - Y) * T * pe * (b + Y * v * (E + Y * y * (-1 + 2 * E ** 2))), f += 1;
1829
- }
1830
- if (f >= A)
1831
- return {
1832
- distanceMeters: Number.NaN,
1833
- bearingRad: 0,
1834
- iterations: f,
1835
- converged: !1
1836
- };
1837
- const k = (Be ** 2 - S ** 2) / S ** 2 * w, C = 1 + k / 16384 * (4096 + k * (-768 + k * (320 - 175 * k))), _ = k / 1024 * (256 + k * (-128 + k * (74 - 47 * k))), D = _ * v * (E + _ / 4 * (y * (-1 + 2 * E ** 2) - _ / 6 * E * (-3 + 4 * v ** 2) * (-3 + 4 * E ** 2))), Ne = S * C * (b - D), Fe = Math.atan2(
1838
- p * Math.sin(g),
1839
- d * u - c * p * Math.cos(g)
1840
- );
1841
- return {
1842
- distanceMeters: Ne,
1843
- bearingRad: Fe,
1844
- iterations: f,
1845
- converged: !0
1846
- };
1847
- }
1848
- function lr(a, t, e, r) {
1849
- const o = B(a), i = B(e), n = B(r - t), s = Math.atan((1 - T) * Math.tan(o)), l = Math.atan((1 - T) * Math.tan(i)), c = Math.sin(s), d = Math.cos(s), u = Math.sin(l), p = Math.cos(l), g = Math.sqrt(
1850
- (p * Math.sin(n)) ** 2 + (d * u - c * p * Math.cos(n)) ** 2
1851
- ), m = c * u + d * p * Math.cos(n), f = Math.atan2(g, m);
1852
- if (f === 0)
1853
- return { distanceMeters: 0, bearingRad: 0 };
1854
- const v = 1 - (d * p * Math.sin(n) / Math.sin(f)) ** 2, y = v === 0 ? 0 : m - 2 * c * u / v, b = (Be ** 2 - S ** 2) / S ** 2 * v, w = 1 + b / 16384 * (4096 + b * (-768 + b * (320 - 175 * b))), E = b / 1024 * (256 + b * (-128 + b * (74 - 47 * b))), k = E * g * (y + E / 4 * (m * (-1 + 2 * y ** 2) - E / 6 * y * (-3 + 4 * g ** 2) * (-3 + 4 * y ** 2))), C = S * w * (f - k), _ = Math.atan2(
1855
- p * Math.sin(n),
1856
- d * u - c * p * Math.cos(n)
1857
- );
1858
- return { distanceMeters: C, bearingRad: _ };
1859
- }
1860
- const cr = {
1861
- position: "topleft",
1862
- circleMarker: {
1863
- color: "red",
1864
- radius: 2
1865
- },
1866
- lineStyle: {
1867
- color: "red",
1868
- dashArray: "1,6"
1869
- },
1870
- angleUnit: {
1871
- display: "°",
1872
- decimal: 2,
1873
- factor: null,
1874
- label: "Bearing:"
1875
- }
1876
- }, dr = {
1877
- display: "km",
1878
- decimal: 2,
1879
- factor: null,
1880
- label: "Distance (km):"
1881
- }, ur = {
1882
- display: "mi",
1883
- decimal: 2,
1884
- factor: 0.621371,
1885
- label: "Distance (mi):"
1886
- };
1887
- function hr(a) {
1888
- const t = a === "imperial" ? { ...ur } : { ...dr };
1889
- return {
1890
- ...cr,
1891
- lengthUnit: t
1892
- };
1893
- }
1894
- const pr = {
1895
- metric: "Meters / Kilometers",
1896
- imperial: "Feet / Miles"
1897
- };
1898
- function X(a, t = {}) {
1899
- var i, n;
1900
- const e = !!((i = a == null ? void 0 : a.Control) != null && i.Draw), r = !!a.draw, o = e && r;
1901
- return o || (n = t.onError) == null || n.call(
1902
- t,
1903
- "Leaflet.draw is not available on the provided Leaflet instance"
1904
- ), o;
1905
- }
1906
- let xe = !1;
1907
- const fr = {
1908
- polygon: "tool:polygon:created",
1909
- polyline: "tool:polyline:created",
1910
- rectangle: "tool:rectangle:created",
1911
- circle: "tool:circle:created",
1912
- marker: "tool:marker:created"
1913
- };
1914
- class gr {
1915
- constructor(t) {
1916
- h(this, "container");
1917
- h(this, "logger");
1918
- h(this, "options");
1919
- // Active Leaflet namespace (injected or bundled fallback)
1920
- h(this, "L");
1921
- // Data store (id-centric)
1922
- h(this, "store");
1923
- // Leaflet entities
1924
- h(this, "map", null);
1925
- h(this, "tileLayer", null);
1926
- h(this, "drawnItems", null);
1927
- // Keep 'any' here to avoid type friction across different @types/leaflet-draw versions
1928
- h(this, "drawControl", null);
1929
- h(this, "rulerControl", null);
1930
- h(this, "measurementControl", null);
1931
- h(this, "measurementSystem", "metric");
1932
- h(this, "measurementModalOverlay", null);
1933
- h(this, "measurementModalDialog", null);
1934
- h(this, "measurementModalRadios", {});
1935
- h(this, "measurementModalKeydownHandler", null);
1936
- // Detacher for our polygon close-on-first-vertex patch
1937
- h(this, "detachPolygonFinishPatch", null);
1938
- // Context menu for vertex deletion
1939
- h(this, "vertexMenuEl", null);
1940
- h(this, "vertexMenuCleanup", null);
1941
- h(this, "vertexEditSurfaceCleanup", null);
1942
- h(this, "activeCakeSession", null);
1943
- // Move tool UI elements
1944
- h(this, "moveConfirmationUI", null);
1945
- h(this, "activeMoveHandler", null);
1946
- h(this, "markerIconConfig", null);
1947
- h(this, "markerIcon", null);
1948
- h(this, "toolButtonConfig", null);
1949
- h(this, "toolbarGroups", null);
1950
- var e, r, o, i;
1951
- this.options = t, this.container = t.container, this.logger = ((e = t.logger) != null ? e : V("controller", "debug")).child(
1952
- "map"
1953
- ), this.L = this.resolveLeaflet(t), this.store = new At(this.logger.child("store")), this.setMarkerIconConfig((r = t.markerIconConfig) != null ? r : null, {
1954
- reapplyExistingLayers: !1,
1955
- syncDrawControl: !1
1956
- }), this.toolButtonConfig = (o = t.toolButtonConfig) != null ? o : null, this.toolbarGroups = (i = t.toolbarGroups) != null ? i : null, this.logger.debug("ctor", {
1957
- config: t.map,
1958
- controls: t.controls,
1959
- readOnly: t.readOnly,
1960
- useExternalLeaflet: t.useExternalLeaflet
1961
- }), Jt(this.L), Zt(this.L), Vt(this.L);
1962
- }
1963
- emitToolEvent(t, e) {
1964
- var o, i;
1965
- try {
1966
- (i = (o = this.options.toolHooks) == null ? void 0 : o[t]) == null || i.call(o, e);
1967
- } catch (n) {
1968
- this._error(`tool hook failed: ${t}`, n);
1969
- }
1970
- const r = this.options.toolEventEmitter;
1971
- if (r)
1972
- try {
1973
- if (typeof r.emit == "function") {
1974
- r.emit(t, e);
1975
- return;
1976
- }
1977
- typeof r.dispatchEvent == "function" && r.dispatchEvent(
1978
- new CustomEvent(t, {
1979
- detail: e
1980
- })
1981
- );
1982
- } catch (n) {
1983
- this._error(`tool emitter failed: ${t}`, n);
1984
- }
1985
- }
1986
- setToolObservers(t) {
1987
- this.options.toolHooks = t.toolHooks, this.options.toolEventEmitter = t.toolEventEmitter;
1988
- }
1989
- setMarkerIconConfig(t, e = {}) {
1990
- const { reapplyExistingLayers: r = !0, syncDrawControl: o = !0 } = e;
1991
- this.options.markerIconConfig = t, this.markerIconConfig = t, this.markerIcon = this.createMarkerIcon(t), o && this.syncDrawMarkerOptions(), r && this.reapplyMarkerIconsToExistingLayers();
1992
- }
1993
- setToolButtonConfig(t) {
1994
- this.options.toolButtonConfig = t != null ? t : null, this.toolButtonConfig = t != null ? t : null, this.applyToolButtonCustomizations();
1995
- }
1996
- setToolbarGroups(t) {
1997
- this.options.toolbarGroups = t != null ? t : null, this.toolbarGroups = t != null ? t : null, this.applyToolButtonCustomizations();
1998
- }
1999
- activateTool(t, e = {}) {
2000
- var o, i, n;
2001
- const r = (o = e.source) != null ? o : "api";
2002
- try {
2003
- if (t === "select")
2004
- return this.deactivateTool({ source: r, groupId: e.groupId });
2005
- if (t === "save") {
2006
- const l = this.store.toFeatureCollection();
2007
- return (n = (i = this.options.callbacks) == null ? void 0 : i.onSaved) == null || n.call(i, {
2008
- geoJSON: l,
2009
- featureCount: l.features.length
2010
- }), this.emitToolEvent("tool:save", {
2011
- geoJSON: l,
2012
- featureCount: l.features.length
2013
- }), this.emitToolTrigger({
2014
- tool: t,
2015
- source: r,
2016
- groupId: e.groupId,
2017
- handled: !0
2018
- }), !0;
2019
- }
2020
- if (t === "layerStyle")
2021
- return this.emitToolTrigger({
2022
- tool: t,
2023
- source: r,
2024
- groupId: e.groupId,
2025
- handled: !0
2026
- }), !0;
2027
- if (t === "measurementSettings")
2028
- return this.toggleMeasurementModal(!0), this.emitToolTrigger({
2029
- tool: t,
2030
- source: r,
2031
- groupId: e.groupId,
2032
- handled: !0
2033
- }), !0;
2034
- if (t === "ruler") {
2035
- const l = this.triggerRulerTool();
2036
- return this.emitToolTrigger({
2037
- tool: t,
2038
- source: r,
2039
- groupId: e.groupId,
2040
- handled: l,
2041
- error: l ? void 0 : "Ruler control is not available"
2042
- }), l;
2043
- }
2044
- const s = this.findLeafletDrawHandler(t);
2045
- return !s || typeof s.enable != "function" ? (this.emitToolTrigger({
2046
- tool: t,
2047
- source: r,
2048
- groupId: e.groupId,
2049
- handled: !1,
2050
- error: `Tool "${t}" is not available on this map`
2051
- }), !1) : (s.enable(), this.emitToolTrigger({
2052
- tool: t,
2053
- source: r,
2054
- groupId: e.groupId,
2055
- handled: !0
2056
- }), !0);
2057
- } catch (s) {
2058
- const l = `Failed to activate tool "${t}"`;
2059
- return this._error(l, s), this.emitToolTrigger({
2060
- tool: t,
2061
- source: r,
2062
- groupId: e.groupId,
2063
- handled: !1,
2064
- error: s instanceof Error ? s.message : l
2065
- }), !1;
2066
- }
2067
- }
2068
- triggerTool(t, e = {}) {
2069
- return this.activateTool(t, e);
2070
- }
2071
- deactivateTool(t = {}) {
2072
- var r;
2073
- const e = (r = t.source) != null ? r : "api";
2074
- try {
2075
- return this.disableActiveToolHandlers(), this.toggleMeasurementModal(!1), this.emitToolTrigger({
2076
- tool: "select",
2077
- source: e,
2078
- groupId: t.groupId,
2079
- handled: !0
2080
- }), !0;
2081
- } catch (o) {
2082
- const i = "Failed to deactivate active map tools";
2083
- return this._error(i, o), this.emitToolTrigger({
2084
- tool: "select",
2085
- source: e,
2086
- groupId: t.groupId,
2087
- handled: !1,
2088
- error: o instanceof Error ? o.message : i
2089
- }), !1;
2090
- }
2091
- }
2092
- resolveLeaflet(t) {
2093
- if (!t.useExternalLeaflet)
2094
- return x;
2095
- if (t.leaflet && X(t.leaflet))
2096
- return this.logger.debug("leaflet-runtime:external-injected"), t.leaflet;
2097
- const r = globalThis.L;
2098
- return r && X(r) ? (this.logger.debug("leaflet-runtime:external-global"), r) : (this.logger.warn("leaflet-runtime:external-fallback-bundled", {
2099
- message: "External Leaflet requested but Draw APIs were missing; falling back to bundled Leaflet/Draw"
2100
- }), x);
2101
- }
2102
- // ---------------- Lifecycle ----------------
2103
- async init() {
2104
- var e, r, o, i, n, s;
2105
- const t = (r = (e = performance.now) == null ? void 0 : e.call(performance)) != null ? r : Date.now();
2106
- try {
2107
- await this.destroy();
2108
- const {
2109
- latitude: l,
2110
- longitude: c,
2111
- zoom: d,
2112
- minZoom: u,
2113
- maxZoom: p,
2114
- tileUrl: g,
2115
- tileAttribution: m,
2116
- preferCanvas: f = !0,
2117
- // Default to Canvas rendering for better performance
2118
- useExternalLeaflet: A
2119
- } = this.options.map, v = [l, c], y = this.L;
2120
- A && X(y, {
2121
- onError: (C) => this.logger.warn("external-leaflet-missing-draw", { message: C })
2122
- }), this.map = y.map(this.container, {
2123
- zoomControl: !0,
2124
- minZoom: u,
2125
- preferCanvas: f
2126
- }).setView(v, d), this.setTileLayer(
2127
- {
2128
- urlTemplate: g,
2129
- attribution: m != null ? m : "",
2130
- maxZoom: p
2131
- },
2132
- {
2133
- onTileError: (C) => {
2134
- var _, D;
2135
- (D = (_ = this.options.callbacks) == null ? void 0 : _.onTileError) == null || D.call(_, C);
2136
- }
2137
- }
2138
- ), this.drawnItems = y.featureGroup().addTo(this.map);
2139
- const b = this.buildDrawOptions(
2140
- this.options.controls,
2141
- !!this.options.readOnly
2142
- ), w = y.Control.Draw;
2143
- this.drawControl = new w(b), this.map.addControl(this.drawControl), this.applyLayerCakeToolbarIcon(), this.applyMoveToolbarIcon(), this.restoreVisibleLayersFromStore(), this.options.controls.ruler && (this.logger.debug("init:ruler", {
2144
- available: typeof y.control.ruler == "function"
2145
- }), typeof y.control.ruler == "function" ? (this.addRulerControl(), this.installMeasurementSettingsControl()) : this.logger.warn("init:ruler:missing", {
2146
- msg: "L.control.ruler is not defined"
2147
- })), this.applyToolButtonCustomizations(), this.patchLeafletDrawBugs(), this.installPolygonFinishPatch(), this.installVertexEditSurfaceMenu(), this.map.invalidateSize(), setTimeout(() => {
2148
- var C;
2149
- try {
2150
- (C = this.map) == null || C.invalidateSize();
2151
- } catch {
2152
- }
2153
- }, 0), this.bindDrawEvents();
2154
- const E = ((i = (o = performance.now) == null ? void 0 : o.call(performance)) != null ? i : Date.now()) - t;
2155
- this.logger.debug("init:ready", { elapsedMs: Math.round(E) });
2156
- const k = this.store.bounds();
2157
- (s = (n = this.options.callbacks) == null ? void 0 : n.onReady) == null || s.call(n, k ? { bounds: k } : {});
2158
- } catch (l) {
2159
- this._error("Failed to initialize Leaflet map", l, {
2160
- code: "map_init_failed",
2161
- recoverable: !1
2162
- });
2163
- }
2164
- }
2165
- async destroy() {
2166
- var t, e, r, o;
2167
- try {
2168
- Q(this.container, null, { toolbarGroups: null }), this.map && (this.map.off(), this.map.remove());
2169
- } catch (i) {
2170
- this._error("Failed to remove Leaflet map", i);
2171
- }
2172
- try {
2173
- (t = this.detachPolygonFinishPatch) == null || t.call(this);
2174
- } catch {
2175
- }
2176
- this.detachPolygonFinishPatch = null;
2177
- try {
2178
- (e = this.vertexMenuCleanup) == null || e.call(this);
2179
- } catch {
2180
- }
2181
- this.vertexMenuEl = null, this.vertexMenuCleanup = null;
2182
- try {
2183
- (r = this.vertexEditSurfaceCleanup) == null || r.call(this);
2184
- } catch {
2185
- }
2186
- this.vertexEditSurfaceCleanup = null;
2187
- try {
2188
- this.hideMoveConfirmationUI();
2189
- } catch {
2190
- }
2191
- this.drawControl = null, this.rulerControl = null, this.measurementControl = null, this.removeMeasurementModal(), this.drawnItems = null, this.tileLayer = null;
2192
- try {
2193
- (o = this.activeCakeSession) == null || o.destroy();
2194
- } catch {
2195
- }
2196
- this.activeCakeSession = null, this.map = null;
2197
- }
2198
- // ---------------- Public API (data) ----------------
2199
- async getGeoJSON() {
2200
- return this.store.toFeatureCollection();
2201
- }
2202
- async exportGeoJSON(t = {}) {
2203
- return mt(await this.getGeoJSON(), t);
2204
- }
2205
- async importGeoJSON(t, e = {}) {
2206
- var s;
2207
- if (!this.map || !this.drawnItems) return [];
2208
- const r = (s = e.behavior) != null ? s : "replace";
2209
- r === "replace" && await this.clearLayers();
2210
- const o = gt(t), i = this.store.add(o), n = this.createGeoJSONLayers(o);
2211
- return this.addGeoJSONLayersToDrawnItems(n), this.logger.debug("importGeoJSON", {
2212
- behavior: r,
2213
- count: o.features.length,
2214
- ids: i
2215
- }), e.fitToData && await this.fitBoundsToData(), i;
2216
- }
2217
- async loadGeoJSON(t, e = !1) {
2218
- await this.importGeoJSON(t, {
2219
- behavior: "replace",
2220
- fitToData: e
2221
- });
2222
- }
2223
- async clearLayers() {
2224
- this.drawnItems && this.drawnItems.clearLayers(), this.store.clear();
2225
- }
2226
- async addFeatures(t) {
2227
- return this.importGeoJSON(t, { behavior: "add" });
2228
- }
2229
- async updateFeature(t, e) {
2230
- if (!this.store.has(t)) {
2231
- this.logger.warn("updateFeature:missing", { id: t });
2232
- return;
2233
- }
2234
- if (this.store.update(t, e), !this.drawnItems) return;
2235
- this.drawnItems.eachLayer((o) => {
2236
- o._fid === t && this.drawnItems.removeLayer(o);
2237
- }), this.createGeoJSONLayers({
2238
- type: "FeatureCollection",
2239
- features: [{ ...e, id: t }]
2240
- }).eachLayer((o) => {
2241
- o._fid = t, this.drawnItems.addLayer(o), this.installVertexContextMenu(o);
2242
- });
2243
- }
2244
- async removeFeature(t) {
2245
- this.drawnItems && this.drawnItems.eachLayer((e) => {
2246
- e._fid === t && this.drawnItems.removeLayer(e);
2247
- }), this.store.remove(t);
2248
- }
2249
- // ---------------- Public API (map) ----------------
2250
- async fitBoundsToData(t = 0.05) {
2251
- if (!this.map) return;
2252
- const e = this.store.bounds();
2253
- if (!e) return;
2254
- const r = e, o = this.L.latLngBounds(r);
2255
- if (t > 0) {
2256
- const i = o.getSouthWest(), n = o.getNorthEast(), s = (n.lat - i.lat) * t, l = (n.lng - i.lng) * t, c = this.L.latLngBounds(
2257
- this.L.latLng(i.lat - s, i.lng - l),
2258
- this.L.latLng(n.lat + s, n.lng + l)
2259
- );
2260
- this.map.fitBounds(c);
2261
- } else
2262
- this.map.fitBounds(o);
2263
- }
2264
- async fitBounds(t, e = 0.05) {
2265
- if (!this.map) return;
2266
- const r = this.L.latLngBounds(t);
2267
- if (e > 0) {
2268
- const o = r.getSouthWest(), i = r.getNorthEast(), n = (i.lat - o.lat) * e, s = (i.lng - o.lng) * e, l = this.L.latLngBounds(
2269
- this.L.latLng(o.lat - n, o.lng - s),
2270
- this.L.latLng(i.lat + n, i.lng + s)
2271
- );
2272
- this.map.fitBounds(l);
2273
- } else
2274
- this.map.fitBounds(r);
2275
- }
2276
- async setView(t, e, r) {
2277
- this.map && this.map.setView([t, e], r != null ? r : this.map.getZoom());
2278
- }
2279
- setTileLayer(t, e) {
2280
- if (!this.map) {
2281
- this.logger.warn("setTileLayer called before map initialization", {
2282
- urlTemplate: t.urlTemplate
2283
- });
2284
- return;
2285
- }
2286
- this.logger.debug("tile-layer:switch", {
2287
- urlTemplate: t.urlTemplate,
2288
- attribution: t.attribution,
2289
- maxZoom: t.maxZoom,
2290
- subdomains: t.subdomains
2291
- }), this.tileLayer && (this.map.removeLayer(this.tileLayer), this.tileLayer = null);
2292
- const r = {
2293
- attribution: t.attribution,
2294
- minZoom: this.options.map.minZoom,
2295
- maxZoom: t.maxZoom
2296
- };
2297
- t.subdomains !== void 0 ? r.subdomains = t.subdomains : t.urlTemplate.includes("{s}") && (r.subdomains = ["a", "b", "c"]);
2298
- const o = this.L.tileLayer(
2299
- t.urlTemplate,
2300
- r
2301
- );
2302
- let i = !1;
2303
- o.on("tileerror", (n) => {
2304
- var s;
2305
- this.logger.error("tile-layer:error", { error: n }), i || (i = !0, (s = e == null ? void 0 : e.onTileError) == null || s.call(e, n));
2306
- }), o.addTo(this.map), this.tileLayer = o;
2307
- }
2308
- /**
2309
- * Merge all visible polygon features into a single polygon feature.
2310
- * This removes the original features and adds a new feature with the merged geometry.
2311
- *
2312
- * @param options Optional configuration for the merge operation
2313
- * @returns The ID of the newly created merged feature, or null if no polygons to merge
2314
- */
2315
- async mergeVisiblePolygons(t) {
2316
- if (!this.map || !this.drawnItems) return null;
2317
- const r = (await this.getGeoJSON()).features.filter((s) => {
2318
- const l = s.geometry;
2319
- return l && (Me(l) || Ce(l));
2320
- });
2321
- if (r.length <= 1) {
2322
- if (r.length === 1) {
2323
- const s = r[0].id;
2324
- return s ? String(s) : null;
2325
- }
2326
- return null;
2327
- }
2328
- const o = bt(r, t == null ? void 0 : t.properties);
2329
- if (!o) return null;
2330
- const i = [];
2331
- for (const s of r) {
2332
- const l = s.id;
2333
- l && i.push(String(l));
2334
- }
2335
- for (const s of i)
2336
- await this.removeFeature(s);
2337
- const [n] = await this.addFeatures({
2338
- type: "FeatureCollection",
2339
- features: [o]
2340
- });
2341
- return n || null;
2342
- }
2343
- setRulerUnits(t) {
2344
- if (this.measurementSystem === t) return;
2345
- const e = this.measurementSystem;
2346
- this.measurementSystem = t, this.logger.debug("ruler:units", { system: t }), this.emitToolEvent("tool:ruler:units-changed", {
2347
- previous: e,
2348
- current: t
2349
- }), this.syncMeasurementModalState(), this.rebuildRulerControl();
2350
- }
2351
- // ---------------- Internals ----------------
2352
- buildDrawOptions(t, e) {
2353
- var i;
2354
- const r = {
2355
- polygon: t.polygon ? {
2356
- allowIntersection: (i = this.options.map.polygonAllowIntersection) != null ? i : !1,
2357
- // Disallow self-intersections by default
2358
- showArea: !0,
2359
- // Display area tooltip while drawing
2360
- shapeOptions: {
2361
- color: "#3388ff"
2362
- // Default shape color
2363
- }
2364
- } : !1,
2365
- polyline: t.polyline ? {
2366
- shapeOptions: {
2367
- color: "#3388ff"
2368
- }
2369
- } : !1,
2370
- rectangle: t.rectangle ? {
2371
- shapeOptions: {
2372
- color: "#3388ff"
2373
- }
2374
- } : !1,
2375
- circle: t.circle ? {
2376
- shapeOptions: {
2377
- color: "#3388ff"
2378
- }
2379
- } : !1,
2380
- cake: t.cake ? {
2381
- shapeOptions: {
2382
- color: "#8A2BE2",
2383
- // Violet color for distinction
2384
- fillOpacity: 0.2
2385
- }
2386
- } : !1,
2387
- marker: t.marker ? this.buildMarkerDrawOptions() : !1,
2388
- move: t.move ? {
2389
- featureGroup: this.drawnItems
2390
- } : !1
2391
- };
2392
- let o = {
2393
- featureGroup: this.drawnItems
2394
- };
2395
- return t.edit ? t.delete === !1 && (o.remove = !1) : o = !1, e ? {
2396
- draw: !1,
2397
- edit: !1
2398
- } : { draw: r, edit: o };
2399
- }
2400
- buildMarkerDrawOptions() {
2401
- return this.markerIcon ? { icon: this.markerIcon } : {};
2402
- }
2403
- createMarkerIcon(t) {
2404
- return t ? this.L.icon({
2405
- iconUrl: t.iconUrl,
2406
- iconRetinaUrl: t.iconRetinaUrl,
2407
- shadowUrl: t.shadowUrl,
2408
- iconSize: t.iconSize,
2409
- iconAnchor: t.iconAnchor,
2410
- popupAnchor: t.popupAnchor
2411
- }) : null;
2412
- }
2413
- createDefaultMarkerIcon() {
2414
- var e;
2415
- const t = (e = this.L.Icon) == null ? void 0 : e.Default;
2416
- return t ? new t() : null;
2417
- }
2418
- createGeoJSONLayers(t) {
2419
- return this.L.geoJSON(t, {
2420
- pointToLayer: (e, r) => this.markerIcon ? this.L.marker(r, { icon: this.markerIcon }) : this.L.marker(r),
2421
- onEachFeature: (e, r) => {
2422
- const o = J(e);
2423
- o && (r._fid = o);
2424
- }
2425
- });
2426
- }
2427
- addGeoJSONLayersToDrawnItems(t) {
2428
- this.drawnItems && t.eachLayer((e) => {
2429
- this.drawnItems.addLayer(e), this.installVertexContextMenu(e);
2430
- });
2431
- }
2432
- restoreVisibleLayersFromStore() {
2433
- if (!this.drawnItems)
2434
- return;
2435
- const t = this.store.toFeatureCollection();
2436
- if (t.features.length === 0)
2437
- return;
2438
- const e = this.createGeoJSONLayers(t);
2439
- this.addGeoJSONLayersToDrawnItems(e);
2440
- }
2441
- syncDrawMarkerOptions() {
2442
- var r, o, i, n;
2443
- const t = this.drawControl;
2444
- if (!t)
2445
- return;
2446
- const e = this.buildMarkerDrawOptions();
2447
- (r = t.options) != null || (t.options = {}), (i = (o = t.options).draw) != null || (o.draw = {}), t.options.draw.marker = e, (n = t.setDrawingOptions) == null || n.call(t, { marker: e });
2448
- }
2449
- reapplyMarkerIconsToExistingLayers() {
2450
- if (!this.drawnItems)
2451
- return;
2452
- const t = this.markerIcon ? null : this.createDefaultMarkerIcon();
2453
- this.drawnItems.eachLayer((e) => {
2454
- if (!(typeof (e == null ? void 0 : e.setIcon) != "function" || typeof (e == null ? void 0 : e.getLatLng) != "function")) {
2455
- if (this.markerIcon) {
2456
- e.setIcon(this.markerIcon);
2457
- return;
2458
- }
2459
- t && e.setIcon(t);
2460
- }
2461
- });
2462
- }
2463
- applyToolButtonCustomizations() {
2464
- Q(this.container, this.toolButtonConfig, {
2465
- toolbarGroups: this.toolbarGroups,
2466
- onTrigger: (t, e) => {
2467
- if (e.activate) {
2468
- this.activateTool(t, {
2469
- source: e.source,
2470
- groupId: e.groupId
2471
- });
2472
- return;
2473
- }
2474
- this.emitToolTrigger({
2475
- tool: t,
2476
- source: e.source,
2477
- groupId: e.groupId,
2478
- handled: !0
2479
- });
2480
- }
2481
- }), setTimeout(() => {
2482
- Q(this.container, this.toolButtonConfig, {
2483
- toolbarGroups: this.toolbarGroups,
2484
- onTrigger: (t, e) => {
2485
- if (e.activate) {
2486
- this.activateTool(t, {
2487
- source: e.source,
2488
- groupId: e.groupId
2489
- });
2490
- return;
2491
- }
2492
- this.emitToolTrigger({
2493
- tool: t,
2494
- source: e.source,
2495
- groupId: e.groupId,
2496
- handled: !0
2497
- });
2498
- }
2499
- });
2500
- }, 0);
2501
- }
2502
- emitToolTrigger(t) {
2503
- var e, r;
2504
- (r = (e = this.options.callbacks) == null ? void 0 : e.onToolTrigger) == null || r.call(e, {
2505
- ...t,
2506
- timestamp: Date.now()
2507
- });
2508
- }
2509
- findLeafletDrawHandler(t) {
2510
- var n, s, l, c, d, u, p, g, m, f;
2511
- const e = {
2512
- polygon: "polygon",
2513
- polyline: "polyline",
2514
- rectangle: "rectangle",
2515
- circle: "circle",
2516
- marker: "marker",
2517
- layerCake: "cake",
2518
- move: "move"
2519
- }, r = {
2520
- edit: "edit",
2521
- delete: "remove"
2522
- }, o = e[t];
2523
- if (o)
2524
- return (d = (c = (l = (s = (n = this.drawControl) == null ? void 0 : n._toolbars) == null ? void 0 : s.draw) == null ? void 0 : l._modes) == null ? void 0 : c[o]) == null ? void 0 : d.handler;
2525
- const i = r[t];
2526
- return i ? (f = (m = (g = (p = (u = this.drawControl) == null ? void 0 : u._toolbars) == null ? void 0 : p.edit) == null ? void 0 : g._modes) == null ? void 0 : m[i]) == null ? void 0 : f.handler : null;
2527
- }
2528
- disableActiveToolHandlers() {
2529
- var e;
2530
- const t = (e = this.drawControl) == null ? void 0 : e._toolbars;
2531
- t && Object.values(t).forEach((r) => {
2532
- var o;
2533
- Object.values((o = r == null ? void 0 : r._modes) != null ? o : {}).forEach((i) => {
2534
- const n = i == null ? void 0 : i.handler;
2535
- n && typeof n.disable == "function" && n.disable();
2536
- });
2537
- });
2538
- }
2539
- triggerRulerTool() {
2540
- const t = this.rulerControl;
2541
- if (typeof (t == null ? void 0 : t._toggleMeasure) == "function")
2542
- return t._toggleMeasure(), !0;
2543
- const e = this.container.querySelector(".leaflet-ruler");
2544
- return e ? (e.click(), !0) : !1;
2545
- }
2546
- applyLayerCakeToolbarIcon() {
2547
- if (!this.container) return;
2548
- const t = () => {
2549
- const e = this.container.querySelector(
2550
- "a.leaflet-draw-draw-cake"
2551
- );
2552
- if (!e) return;
2553
- e.style.setProperty("background-image", "none", "important"), e.style.setProperty("background-color", "#fff", "important"), e.style.setProperty("position", "relative", "important");
2554
- let r = e.querySelector(
2555
- ".leaflet-geokit-cake-icon"
2556
- );
2557
- r || (r = document.createElement("span"), r.className = "leaflet-geokit-cake-icon", r.setAttribute("aria-hidden", "true"), e.appendChild(r)), r.style.setProperty("position", "absolute", "important"), r.style.setProperty("display", "block", "important"), r.style.setProperty("left", "50%", "important"), r.style.setProperty("top", "50%", "important"), r.style.setProperty("width", "18px", "important"), r.style.setProperty("height", "18px", "important"), r.style.setProperty("transform", "translate(-50%, -50%)", "important"), r.style.setProperty("pointer-events", "none", "important"), r.firstElementChild || (r.innerHTML = tr);
2558
- const o = r.firstElementChild;
2559
- o && (o.style.setProperty("width", "100%", "important"), o.style.setProperty("height", "100%", "important"), o.style.setProperty("display", "block", "important"));
2560
- };
2561
- t(), setTimeout(t, 0);
2562
- }
2563
- applyMoveToolbarIcon() {
2564
- if (!this.container) return;
2565
- const t = () => {
2566
- const e = this.container.querySelector(
2567
- "a.leaflet-draw-draw-move"
2568
- );
2569
- if (!e) return;
2570
- e.style.setProperty("background-image", "none", "important"), e.style.setProperty("background-color", "#fff", "important"), e.style.setProperty("position", "relative", "important");
2571
- let r = e.querySelector(
2572
- ".leaflet-geokit-move-icon"
2573
- );
2574
- r || (r = document.createElement("span"), r.className = "leaflet-geokit-move-icon", r.setAttribute("aria-hidden", "true"), e.appendChild(r)), r.style.setProperty("position", "absolute", "important"), r.style.setProperty("display", "block", "important"), r.style.setProperty("left", "50%", "important"), r.style.setProperty("top", "50%", "important"), r.style.setProperty("width", "18px", "important"), r.style.setProperty("height", "18px", "important"), r.style.setProperty("transform", "translate(-50%, -50%)", "important"), r.style.setProperty("pointer-events", "none", "important"), r.firstElementChild || (r.innerHTML = rr);
2575
- const o = r.firstElementChild;
2576
- o && (o.style.setProperty("width", "100%", "important"), o.style.setProperty("height", "100%", "important"), o.style.setProperty("display", "block", "important"));
2577
- };
2578
- t(), setTimeout(t, 0);
2579
- }
2580
- /* c8 ignore start */
2581
- addRulerControl() {
2582
- if (!this.map) return;
2583
- this.installRulerPrecisionPatch();
2584
- const t = hr(this.measurementSystem);
2585
- this.rulerControl = this.L.control.ruler(t), this.map.addControl(this.rulerControl);
2586
- }
2587
- installRulerPrecisionPatch() {
2588
- if (xe) return;
2589
- const t = this.L.Control.Ruler;
2590
- if (!t || typeof t != "function") return;
2591
- const e = t.prototype, r = e._calculateBearingAndDistance;
2592
- if (typeof r != "function") return;
2593
- const o = this.logger;
2594
- e._calculateBearingAndDistance = function() {
2595
- var n, s, l;
2596
- r.call(this);
2597
- try {
2598
- const c = this._clickedLatLong, d = (n = this._movingLatLong) != null ? n : this._clickedLatLong;
2599
- if (!c || !d) return;
2600
- const { meters: u, bearingDegrees: p } = nr(
2601
- c.lat,
2602
- c.lng,
2603
- d.lat,
2604
- d.lng
2605
- ), g = u / 1e3, m = typeof ((l = (s = this.options) == null ? void 0 : s.lengthUnit) == null ? void 0 : l.factor) == "number" ? this.options.lengthUnit.factor : 1, f = ce(g * m);
2606
- this._result = this._result || {}, this._result.Distance = f, this._result.Bearing = p, this._result.meters = u;
2607
- } catch (c) {
2608
- o == null || o.warn("ruler:precision-patch", c);
2609
- }
2610
- }, xe = !0;
2611
- }
2612
- rebuildRulerControl() {
2613
- if (!(!this.map || !this.options.controls.ruler)) {
2614
- if (this.rulerControl) {
2615
- try {
2616
- this.map.removeControl(this.rulerControl);
2617
- } catch (t) {
2618
- this.logger.warn("ruler:remove-failed", t);
2619
- }
2620
- this.rulerControl = null;
2621
- }
2622
- this.addRulerControl();
2623
- }
2624
- }
2625
- /* c8 ignore next */
2626
- installMeasurementSettingsControl() {
2627
- if (!this.map || this.measurementControl) return;
2628
- const t = this, e = this.L.Control.extend({
2629
- options: { position: "topleft" },
2630
- onAdd() {
2631
- const r = t.L.DomUtil.create(
2632
- "div",
2633
- "leaflet-bar leaflet-ruler-settings-control"
2634
- ), o = t.L.DomUtil.create(
2635
- "button",
2636
- "leaflet-ruler-settings-button",
2637
- r
2638
- );
2639
- return o.type = "button", o.title = "Measurement settings", o.setAttribute("aria-label", "Measurement settings"), o.addEventListener("click", (i) => {
2640
- i.preventDefault(), i.stopPropagation(), t.toggleMeasurementModal(!0);
2641
- }), t.L.DomEvent.disableClickPropagation(r), t.L.DomEvent.disableScrollPropagation(r), r;
2642
- }
2643
- });
2644
- this.measurementControl = new e(), this.map.addControl(this.measurementControl);
2645
- }
2646
- /* c8 ignore next */
2647
- ensureMeasurementModal() {
2648
- if (this.measurementModalOverlay) return this.measurementModalOverlay;
2649
- if (typeof document == "undefined")
2650
- throw new Error("Measurement modal requires a browser environment");
2651
- const t = document.createElement("div");
2652
- t.className = "leaflet-ruler-modal-overlay", t.setAttribute("aria-hidden", "true");
2653
- const e = document.createElement("div");
2654
- e.className = "leaflet-ruler-modal", e.setAttribute("role", "dialog"), e.setAttribute("aria-modal", "true"), e.tabIndex = -1, t.addEventListener("click", (l) => {
2655
- l.target === t && this.toggleMeasurementModal(!1);
2656
- });
2657
- const r = document.createElement("h2");
2658
- r.className = "leaflet-ruler-modal-title", r.textContent = "Measurement Units", e.appendChild(r);
2659
- const o = document.createElement("p");
2660
- o.className = "leaflet-ruler-modal-description", o.textContent = "Choose how the measurement tool reports distances.", e.appendChild(o);
2661
- const i = document.createElement("div");
2662
- i.className = "leaflet-ruler-modal-options", e.appendChild(i), ["metric", "imperial"].forEach((l) => {
2663
- const c = document.createElement("label");
2664
- c.className = "leaflet-ruler-modal-option";
2665
- const d = document.createElement("input");
2666
- d.type = "radio", d.name = "leaflet-ruler-units", d.value = l, d.addEventListener("change", () => {
2667
- d.checked && this.setRulerUnits(l);
2668
- });
2669
- const u = document.createElement("span");
2670
- u.textContent = pr[l], c.appendChild(d), c.appendChild(u), i.appendChild(c), this.measurementModalRadios[l] = d;
2671
- });
2672
- const n = document.createElement("div");
2673
- n.className = "leaflet-ruler-modal-actions";
2674
- const s = document.createElement("button");
2675
- return s.type = "button", s.className = "leaflet-ruler-modal-close", s.textContent = "Close", s.addEventListener("click", () => this.toggleMeasurementModal(!1)), n.appendChild(s), e.appendChild(n), t.appendChild(e), this.container.appendChild(t), this.measurementModalOverlay = t, this.measurementModalDialog = e, this.syncMeasurementModalState(), t;
2676
- }
2677
- /* c8 ignore next */
2678
- toggleMeasurementModal(t) {
2679
- var r;
2680
- if (!t) {
2681
- this.measurementModalOverlay && (this.measurementModalOverlay.classList.remove("is-open"), this.measurementModalOverlay.setAttribute("aria-hidden", "true")), this.detachMeasurementModalKeydown();
2682
- return;
2683
- }
2684
- const e = this.ensureMeasurementModal();
2685
- e.classList.add("is-open"), e.setAttribute("aria-hidden", "false"), this.syncMeasurementModalState(), this.attachMeasurementModalKeydown(), (r = this.measurementModalDialog) == null || r.focus();
2686
- }
2687
- syncMeasurementModalState() {
2688
- for (const [t, e] of Object.entries(this.measurementModalRadios))
2689
- e && (e.checked = t === this.measurementSystem);
2690
- }
2691
- /* c8 ignore next */
2692
- removeMeasurementModal() {
2693
- this.measurementModalOverlay && this.measurementModalOverlay.remove(), this.measurementModalOverlay = null, this.measurementModalDialog = null, this.measurementModalRadios = {}, this.detachMeasurementModalKeydown();
2694
- }
2695
- /* c8 ignore next */
2696
- attachMeasurementModalKeydown() {
2697
- this.measurementModalKeydownHandler || typeof document == "undefined" || (this.measurementModalKeydownHandler = (t) => {
2698
- t.key === "Escape" && this.toggleMeasurementModal(!1);
2699
- }, document.addEventListener("keydown", this.measurementModalKeydownHandler));
2700
- }
2701
- /* c8 ignore next */
2702
- detachMeasurementModalKeydown() {
2703
- !this.measurementModalKeydownHandler || typeof document == "undefined" || (document.removeEventListener(
2704
- "keydown",
2705
- this.measurementModalKeydownHandler
2706
- ), this.measurementModalKeydownHandler = null);
2707
- }
2708
- /* c8 ignore end */
2709
- /**
2710
- * Workaround: In some environments (notably within Shadow DOM), clicking the first vertex
2711
- * to close a polygon can be unreliable due to event retargeting/hit testing.
2712
- * This patch listens for map clicks while the polygon draw handler is enabled and,
2713
- * if the click is within a small pixel radius of the first vertex, it triggers finishShape().
2714
- */
2715
- installPolygonFinishPatch() {
2716
- var n, s, l, c, d;
2717
- if (!this.map || !this.drawControl) return;
2718
- try {
2719
- (n = this.detachPolygonFinishPatch) == null || n.call(this);
2720
- } catch {
2721
- }
2722
- this.detachPolygonFinishPatch = null;
2723
- const t = this.map, e = (l = (s = this.drawControl) == null ? void 0 : s._toolbars) == null ? void 0 : l.draw;
2724
- if (!e || !!!((d = (c = e._modes) == null ? void 0 : c.polygon) != null && d.handler)) return;
2725
- const o = 10, i = (u) => {
2726
- var p, g, m, f, A, v, y, b;
2727
- try {
2728
- const w = (g = (p = e._modes) == null ? void 0 : p.polygon) == null ? void 0 : g.handler;
2729
- if (!w || !w._enabled) return;
2730
- const E = w._markers;
2731
- if (!Array.isArray(E) || E.length < 3) return;
2732
- const k = (f = (m = E[0]) == null ? void 0 : m.getLatLng) == null ? void 0 : f.call(m);
2733
- if (!k) return;
2734
- const C = t.latLngToContainerPoint(k), _ = t.latLngToContainerPoint(u.latlng);
2735
- Math.hypot(C.x - _.x, C.y - _.y) <= o && typeof w._finishShape == "function" && ((v = (A = u.originalEvent) == null ? void 0 : A.preventDefault) == null || v.call(A), (b = (y = u.originalEvent) == null ? void 0 : y.stopPropagation) == null || b.call(y), w._finishShape());
2736
- } catch (w) {
2737
- this._error("polygon-finish-patch", w);
2738
- }
2739
- };
2740
- t.on("click", i), this.detachPolygonFinishPatch = () => {
2741
- try {
2742
- t.off("click", i);
2743
- } catch {
2744
- }
2745
- };
2746
- }
2747
- patchLeafletDrawBugs() {
2748
- var t, e, r, o, i;
2749
- try {
2750
- const n = this.L, s = n.GeometryUtil;
2751
- if (!s) return;
2752
- const l = {
2753
- km: 2,
2754
- ha: 2,
2755
- m: 0,
2756
- mi: 2,
2757
- ac: 2,
2758
- yd: 0,
2759
- ft: 0,
2760
- nm: 2
2761
- }, c = (e = (t = s.formattedNumber) == null ? void 0 : t.bind(s)) != null ? e : ((d, u) => Number(d).toFixed(u));
2762
- s.readableArea = (d, u, p) => {
2763
- var f;
2764
- const g = (f = n.Util) != null && f.extend ? n.Util.extend({}, l, p || {}) : { ...l, ...p || {} };
2765
- let m;
2766
- if (u) {
2767
- let A = ["ha", "m"];
2768
- const v = typeof u;
2769
- v === "string" ? A = [u] : v !== "boolean" && (A = Array.isArray(u) ? u : A), d >= 1e6 && A.indexOf("km") !== -1 ? m = `${c(1e-6 * d, g.km)} km²` : d >= 1e4 && A.indexOf("ha") !== -1 ? m = `${c(1e-4 * d, g.ha)} ha` : m = `${c(d, g.m)} m²`;
2770
- } else
2771
- d = d / 0.836127, d >= 3097600 ? m = `${c(d / 3097600, g.mi)} mi²` : d >= 4840 ? m = `${c(d / 4840, g.ac)} acres` : m = `${c(d, g.yd)} yd²`;
2772
- return m;
2773
- };
2774
- } catch (n) {
2775
- this.logger.warn("leaflet-draw-patch:readableArea", n);
2776
- }
2777
- try {
2778
- const n = this.L, s = (r = n.Edit) == null ? void 0 : r.Circle, l = (o = n.Draw) == null ? void 0 : o.Event, c = n.GeometryUtil;
2779
- if (!((i = s == null ? void 0 : s.prototype) != null && i._resize) || !l || !c) return;
2780
- s.prototype._resize = function(u) {
2781
- var m, f, A;
2782
- const p = this._moveMarker.getLatLng(), g = c.isVersion07x() ? p.distanceTo(u) : this._map.distance(p, u);
2783
- this._shape.setRadius(g);
2784
- try {
2785
- (m = this._map) != null && m.editTooltip && ((A = (f = this._map) == null ? void 0 : f._editTooltip) != null && A.updateContent) && this._map._editTooltip.updateContent({
2786
- text: n.drawLocal.edit.handlers.edit.tooltip.subtext + "<br />" + n.drawLocal.edit.handlers.edit.tooltip.text,
2787
- subtext: n.drawLocal.draw.handlers.circle.radius + ": " + c.readableDistance(
2788
- g,
2789
- !0,
2790
- this.options.feet,
2791
- this.options.nautic
2792
- )
2793
- });
2794
- } catch {
2795
- }
2796
- this._map.fire(l.EDITRESIZE, { layer: this._shape });
2797
- };
2798
- } catch (n) {
2799
- this.logger.warn("leaflet-draw-patch:circle-resize", n);
2800
- }
2801
- }
2802
- bindDrawEvents() {
2803
- !this.map || !this.drawnItems || (this.map.on(this.L.Draw.Event.CREATED, (t) => {
2804
- var e, r, o;
2805
- try {
2806
- const { layer: i, layerType: n } = t;
2807
- if (n === N.TYPE) {
2808
- try {
2809
- (e = this.activeCakeSession) == null || e.destroy();
2810
- } catch {
2811
- }
2812
- this.activeCakeSession = new er(
2813
- this.map,
2814
- i,
2815
- (u) => {
2816
- if (!this.drawnItems) return;
2817
- const p = this.store.add(u), g = this.L.geoJSON(u);
2818
- let m = 0;
2819
- g.eachLayer((f) => {
2820
- var v, y, b;
2821
- const A = (v = p[m]) != null ? v : p[p.length - 1];
2822
- f._fid = A, this.drawnItems.addLayer(f), this.installVertexContextMenu(f), (b = (y = this.options.callbacks) == null ? void 0 : y.onCreated) == null || b.call(y, {
2823
- id: A,
2824
- layerType: "polygon",
2825
- geoJSON: f.toGeoJSON()
2826
- }), m++;
2827
- }), this.activeCakeSession = null, this.emitToolEvent("tool:layer-cake:saved", {
2828
- featureCollection: u
2829
- });
2830
- },
2831
- this.measurementSystem
2832
- ), this.emitToolEvent("tool:layer-cake:session-started", {
2833
- center: i.getLatLng(),
2834
- radius: i.getRadius()
2835
- });
2836
- return;
2837
- }
2838
- this.drawnItems.addLayer(i);
2839
- const s = i.toGeoJSON(), c = this.store.add({
2840
- type: "FeatureCollection",
2841
- features: [s]
2842
- })[0];
2843
- i._fid = c, this.installVertexContextMenu(i), (o = (r = this.options.callbacks) == null ? void 0 : r.onCreated) == null || o.call(r, { id: c, layerType: n, geoJSON: s });
2844
- const d = fr[n];
2845
- d && this.emitToolEvent(d, {
2846
- id: c,
2847
- geoJSON: s
2848
- });
2849
- } catch (i) {
2850
- this._error("onCreated handler failed", i);
2851
- }
2852
- }), this.map.on(this.L.Draw.Event.EDITED, (t) => {
2853
- var e, r;
2854
- try {
2855
- const o = [];
2856
- t.layers.eachLayer((s) => {
2857
- const l = s.toGeoJSON(), c = s._fid;
2858
- if (c)
2859
- this.store.update(c, l), o.push(c);
2860
- else {
2861
- const d = this.store.add({
2862
- type: "FeatureCollection",
2863
- features: [l]
2864
- })[0];
2865
- s._fid = d, o.push(d);
2866
- }
2867
- });
2868
- const n = this.store.toFeatureCollection();
2869
- (r = (e = this.options.callbacks) == null ? void 0 : e.onEdited) == null || r.call(e, {
2870
- ids: o,
2871
- geoJSON: n
2872
- }), this.emitToolEvent("tool:edit:applied", {
2873
- ids: o,
2874
- geoJSON: n
2875
- });
2876
- } catch (o) {
2877
- this._error("onEdited handler failed", o);
2878
- }
2879
- }), this.map.on(this.L.Draw.Event.DELETED, (t) => {
2880
- var e, r;
2881
- try {
2882
- const o = [];
2883
- t.layers.eachLayer((s) => {
2884
- const l = s._fid;
2885
- l && (o.push(l), this.store.remove(l));
2886
- });
2887
- const n = this.store.toFeatureCollection();
2888
- (r = (e = this.options.callbacks) == null ? void 0 : e.onDeleted) == null || r.call(e, {
2889
- ids: o,
2890
- geoJSON: n
2891
- }), this.emitToolEvent("tool:delete:applied", {
2892
- ids: o,
2893
- geoJSON: n
2894
- });
2895
- } catch (o) {
2896
- this._error("onDeleted handler failed", o);
2897
- }
2898
- }), this.map.on("draw:moveend", (t) => {
2899
- var e;
2900
- try {
2901
- this.emitToolEvent("tool:move:pending", {
2902
- layerId: (e = t == null ? void 0 : t.layer) == null ? void 0 : e._fid,
2903
- originalGeoJSON: t == null ? void 0 : t.originalGeoJSON,
2904
- newGeoJSON: t == null ? void 0 : t.newGeoJSON
2905
- }), this.showMoveConfirmationUI(t.layer);
2906
- } catch (r) {
2907
- this._error("draw:moveend handler failed", r);
2908
- }
2909
- }), this.map.on("draw:moveconfirmed", (t) => {
2910
- var e, r, o;
2911
- try {
2912
- this.emitToolEvent("tool:move:confirmed", {
2913
- layerId: (e = t == null ? void 0 : t.layer) == null ? void 0 : e._fid,
2914
- originalGeoJSON: t == null ? void 0 : t.originalGeoJSON,
2915
- newGeoJSON: t == null ? void 0 : t.newGeoJSON
2916
- });
2917
- const i = t.layer, n = i._fid;
2918
- if (n) {
2919
- const s = i.toGeoJSON();
2920
- this.store.update(n, s), (o = (r = this.options.callbacks) == null ? void 0 : r.onEdited) == null || o.call(r, {
2921
- ids: [n],
2922
- geoJSON: this.store.toFeatureCollection()
2923
- });
2924
- }
2925
- this.hideMoveConfirmationUI();
2926
- } catch (i) {
2927
- this._error("draw:moveconfirmed handler failed", i);
2928
- }
2929
- }));
2930
- }
2931
- _error(t, e, r) {
2932
- var i, n, s, l;
2933
- const o = {
2934
- code: (i = r == null ? void 0 : r.code) != null ? i : "controller_error",
2935
- message: t,
2936
- recoverable: (n = r == null ? void 0 : r.recoverable) != null ? n : !0,
2937
- cause: e,
2938
- timestamp: Date.now()
2939
- };
2940
- this.logger.error("error", o), (l = (s = this.options.callbacks) == null ? void 0 : s.onError) == null || l.call(s, o);
2941
- }
2942
- // -------- Vertex deletion context menu --------
2943
- installVertexEditSurfaceMenu() {
2944
- var o;
2945
- if (!this.map) return;
2946
- try {
2947
- (o = this.vertexEditSurfaceCleanup) == null || o.call(this);
2948
- } catch {
2949
- }
2950
- const t = this.map.getContainer(), e = (i) => {
2951
- this.openNearestEditableVertexMenuFromDomEvent(i);
2952
- }, r = (i) => {
2953
- (i.ctrlKey || i.metaKey) && this.openNearestEditableVertexMenuFromDomEvent(i);
2954
- };
2955
- t.addEventListener("contextmenu", e, {
2956
- capture: !0
2957
- }), t.addEventListener("click", r, { capture: !0 }), this.vertexEditSurfaceCleanup = () => {
2958
- t.removeEventListener("contextmenu", e, {
2959
- capture: !0
2960
- }), t.removeEventListener("click", r, { capture: !0 });
2961
- };
2962
- }
2963
- openNearestEditableVertexMenuFromDomEvent(t) {
2964
- try {
2965
- if (!this.map || !this.drawnItems) return;
2966
- const e = this.map.mouseEventToContainerPoint(t), r = this.map.containerPointToLatLng(e);
2967
- let o = null;
2968
- if (this.drawnItems.eachLayer((i) => {
2969
- if (o) return;
2970
- const n = i.editing;
2971
- if (!(n && typeof n.enabled == "function" && n.enabled())) return;
2972
- const l = this.findNearestVertex(i, r, 16);
2973
- l && (o = { layer: i, ...l });
2974
- }), !o) return;
2975
- t.preventDefault(), t.stopPropagation(), this.showVertexMenu(e, async () => {
2976
- await this.deleteVertex(
2977
- o.layer,
2978
- o.pathIndex,
2979
- o.vertexIndex
2980
- );
2981
- });
2982
- } catch (e) {
2983
- this._error("openNearestEditableVertexMenuFromDomEvent", e);
2984
- }
2985
- }
2986
- installVertexContextMenu(t) {
2987
- if (!t || typeof t.on != "function") return;
2988
- const e = (o) => {
2989
- var i, n, s, l;
2990
- try {
2991
- (n = (i = o == null ? void 0 : o.originalEvent) == null ? void 0 : i.preventDefault) == null || n.call(i), (l = (s = o == null ? void 0 : o.originalEvent) == null ? void 0 : s.stopPropagation) == null || l.call(s);
2992
- } catch {
2993
- }
2994
- this.openVertexMenu(t, o);
2995
- }, r = (o) => {
2996
- const i = o == null ? void 0 : o.originalEvent;
2997
- i && (i.ctrlKey || i.metaKey) && this.openVertexMenu(t, o);
2998
- };
2999
- try {
3000
- t.on("contextmenu", e), t.on("click", r);
3001
- } catch {
3002
- }
3003
- }
3004
- openVertexMenu(t, e) {
3005
- try {
3006
- if (!this.map || !(typeof t.getLatLngs == "function" && (t instanceof this.L.Polygon || t instanceof this.L.Polyline))) return;
3007
- const o = t.editing;
3008
- if (!o || typeof o.enabled != "function" || !o.enabled())
3009
- return;
3010
- const i = e == null ? void 0 : e.latlng, n = this.map.latLngToContainerPoint(i), s = this.findNearestVertex(t, i, 12);
3011
- if (!s) return;
3012
- this.showVertexMenu(n, async () => {
3013
- await this.deleteVertex(t, s.pathIndex, s.vertexIndex);
3014
- });
3015
- } catch (r) {
3016
- this._error("openVertexMenu", r);
3017
- }
3018
- }
3019
- showVertexMenu(t, e) {
3020
- var r;
3021
- try {
3022
- try {
3023
- (r = this.vertexMenuCleanup) == null || r.call(this);
3024
- } catch {
3025
- }
3026
- if (this.vertexMenuCleanup = null, !this.container) return;
3027
- const o = document.createElement("div");
3028
- o.style.position = "absolute", o.style.top = `${t.y}px`, o.style.left = `${t.x}px`, o.style.transform = "translate(-50%, -100%)", o.style.background = "#fff", o.style.border = "1px solid rgba(0,0,0,0.15)", o.style.borderRadius = "6px", o.style.boxShadow = "0 4px 12px rgba(0,0,0,0.15)", o.style.padding = "6px", o.style.zIndex = "10000", o.style.fontSize = "12px", o.style.userSelect = "none";
3029
- const i = document.createElement("button");
3030
- i.textContent = "Delete vertex", i.style.padding = "6px 10px", i.style.border = "none", i.style.background = "#da1e28", i.style.color = "#fff", i.style.borderRadius = "4px", i.style.cursor = "pointer", i.addEventListener("click", (l) => {
3031
- l.stopPropagation(), l.preventDefault();
3032
- try {
3033
- e();
3034
- } finally {
3035
- n();
3036
- }
3037
- }), o.appendChild(i);
3038
- const n = () => {
3039
- try {
3040
- window.removeEventListener("pointerdown", s), this.container.removeEventListener("scroll", n, !0), o.remove();
3041
- } catch {
3042
- }
3043
- this.vertexMenuEl = null, this.vertexMenuCleanup = null;
3044
- }, s = (l) => {
3045
- !(typeof l.composedPath == "function" ? l.composedPath() : []).includes(o) && !o.contains(l.target) && n();
3046
- };
3047
- window.addEventListener("pointerdown", s, { capture: !0 }), this.container.addEventListener("scroll", n, !0), this.container.appendChild(o), this.vertexMenuEl = o, this.vertexMenuCleanup = n;
3048
- } catch (o) {
3049
- this._error("showVertexMenu", o);
3050
- }
3051
- }
3052
- findNearestVertex(t, e, r) {
3053
- if (!this.map) return null;
3054
- const o = (p) => this.map.latLngToContainerPoint(p), i = (p, g) => Math.hypot(p.x - g.x, p.y - g.y), n = o(e);
3055
- let s = 1 / 0, l = -1, c = -1;
3056
- const d = t.getLatLngs();
3057
- return (Array.isArray(d[0]) ? d : [d]).forEach((p, g) => {
3058
- p.forEach((m, f) => {
3059
- const A = o(m), v = i(A, n);
3060
- v < s && (s = v, l = g, c = f);
3061
- });
3062
- }), l === -1 || s > r ? null : { pathIndex: l, vertexIndex: c };
3063
- }
3064
- async deleteVertex(t, e, r) {
3065
- var o, i, n;
3066
- try {
3067
- if (!(typeof t.getLatLngs == "function" && (t instanceof this.L.Polygon || t instanceof this.L.Polyline))) return;
3068
- const l = t.getLatLngs(), c = Array.isArray(l[0]) ? l : [l], d = c[e];
3069
- if (!d) return;
3070
- const p = t instanceof this.L.Polygon ? 3 : 2;
3071
- if (d.length <= p) return;
3072
- if (d.splice(r, 1), c.length === 1)
3073
- t.setLatLngs(d);
3074
- else {
3075
- const m = c.map((f, A) => A === e ? d : f);
3076
- t.setLatLngs(m);
3077
- }
3078
- (o = t.redraw) == null || o.call(t);
3079
- const g = t._fid;
3080
- if (g) {
3081
- const m = t.toGeoJSON();
3082
- this.store.update(g, m), (n = (i = this.options.callbacks) == null ? void 0 : i.onEdited) == null || n.call(i, {
3083
- ids: [g],
3084
- geoJSON: this.store.toFeatureCollection()
3085
- });
3086
- }
3087
- } catch (s) {
3088
- this._error("deleteVertex", s);
3089
- }
3090
- }
3091
- // -------- Move tool Save/Cancel UI --------
3092
- showMoveConfirmationUI(t) {
3093
- var e, r;
3094
- try {
3095
- if (this.hideMoveConfirmationUI(), !this.container || !this.map) return;
3096
- const o = this.drawControl;
3097
- if (!o) return;
3098
- const i = (e = o == null ? void 0 : o._toolbars) == null ? void 0 : e.draw;
3099
- if (!i) return;
3100
- const n = i._modes || {};
3101
- let s = null;
3102
- for (const u in n) {
3103
- const p = n[u];
3104
- if (((r = p == null ? void 0 : p.handler) == null ? void 0 : r.type) === "move") {
3105
- s = p.handler;
3106
- break;
3107
- }
3108
- }
3109
- this.activeMoveHandler = s;
3110
- const l = document.createElement("div");
3111
- l.style.position = "absolute", l.style.bottom = "60px", l.style.left = "50%", l.style.transform = "translateX(-50%)", l.style.display = "flex", l.style.gap = "8px", l.style.background = "#fff", l.style.border = "2px solid #3388ff", l.style.borderRadius = "8px", l.style.padding = "12px 16px", l.style.boxShadow = "0 4px 12px rgba(0,0,0,0.2)", l.style.zIndex = "10000", l.style.fontSize = "14px", l.style.fontFamily = "system-ui, sans-serif";
3112
- const c = document.createElement("button");
3113
- c.textContent = "✓ Save", c.style.padding = "8px 16px", c.style.border = "none", c.style.background = "#28a745", c.style.color = "#fff", c.style.borderRadius = "4px", c.style.cursor = "pointer", c.style.fontWeight = "600", c.style.fontSize = "14px", c.addEventListener("click", (u) => {
3114
- u.stopPropagation(), u.preventDefault(), s != null && s.confirmMove && s.confirmMove();
3115
- });
3116
- const d = document.createElement("button");
3117
- d.textContent = "✕ Cancel", d.style.padding = "8px 16px", d.style.border = "1px solid #ccc", d.style.background = "#fff", d.style.color = "#333", d.style.borderRadius = "4px", d.style.cursor = "pointer", d.style.fontWeight = "600", d.style.fontSize = "14px", d.addEventListener("click", (u) => {
3118
- u.stopPropagation(), u.preventDefault(), this.emitToolEvent("tool:move:cancelled", {
3119
- layerId: t == null ? void 0 : t._fid
3120
- }), s != null && s.cancelMove && s.cancelMove(), this.hideMoveConfirmationUI();
3121
- }), l.appendChild(c), l.appendChild(d), this.container.appendChild(l), this.moveConfirmationUI = l, this.logger.debug("showMoveConfirmationUI", {
3122
- layerId: t._fid
3123
- });
3124
- } catch (o) {
3125
- this._error("showMoveConfirmationUI", o);
3126
- }
3127
- }
3128
- hideMoveConfirmationUI() {
3129
- try {
3130
- this.moveConfirmationUI && (this.moveConfirmationUI.remove(), this.moveConfirmationUI = null), this.activeMoveHandler = null;
3131
- } catch (t) {
3132
- this._error("hideMoveConfirmationUI", t);
3133
- }
3134
- }
3135
- }
3136
- const Oe = [25, 41], De = [12, 41], Pe = [1, -34];
3137
- function O(a, t) {
3138
- var r, o, i, n;
3139
- if (a == null)
3140
- return null;
3141
- const e = typeof a == "string" ? a.trim() : "";
3142
- if (!e)
3143
- return (r = t.reportError) == null || r.call(t, t.errorMessage, t.cause), null;
3144
- try {
3145
- return new URL(e, (o = t.baseUrl) != null ? o : document.baseURI).toString();
3146
- } catch (s) {
3147
- return (n = t.reportError) == null || n.call(t, t.errorMessage, (i = t.cause) != null ? i : s), null;
3148
- }
3149
- }
3150
- function $(a, t, e) {
3151
- var l, c;
3152
- if (a == null)
3153
- return [...t];
3154
- if (!Array.isArray(a) || a.length !== 2)
3155
- return (l = e.reportError) == null || l.call(e, e.errorMessage, e.cause), [...t];
3156
- const [r, o] = a, i = Number(r), n = Number(o);
3157
- return Number.isFinite(i) && Number.isFinite(n) && (!e.positiveOnly || i > 0 && n > 0) ? [i, n] : ((c = e.reportError) == null || c.call(e, e.errorMessage, e.cause), [...t]);
3158
- }
3159
- function ee(a, t, e) {
3160
- var l, c, d, u, p;
3161
- if (a == null)
3162
- return [...t];
3163
- const r = typeof a == "string" ? a.trim() : "";
3164
- if (!r)
3165
- return (l = e.reportError) == null || l.call(e, e.errorMessage, e.cause), [...t];
3166
- const o = r.split(",");
3167
- if (o.length !== 2)
3168
- return (c = e.reportError) == null || c.call(e, e.errorMessage, e.cause), [...t];
3169
- const i = Number((d = o[0]) == null ? void 0 : d.trim()), n = Number((u = o[1]) == null ? void 0 : u.trim());
3170
- return Number.isFinite(i) && Number.isFinite(n) && (!e.positiveOnly || i > 0 && n > 0) ? [i, n] : ((p = e.reportError) == null || p.call(e, e.errorMessage, e.cause), [...t]);
3171
- }
3172
- function mr(a, t = {}) {
3173
- var i, n;
3174
- if (!a || typeof a != "object")
3175
- return null;
3176
- const e = O(a.iconUrl, {
3177
- ...t,
3178
- errorMessage: "Invalid marker icon config: iconUrl must be a valid URL",
3179
- cause: { field: "iconUrl", value: a.iconUrl }
3180
- });
3181
- if (!e)
3182
- return null;
3183
- const r = (i = O(a.iconRetinaUrl, {
3184
- ...t,
3185
- errorMessage: "Invalid marker icon config: iconRetinaUrl must be a valid URL",
3186
- cause: { field: "iconRetinaUrl", value: a.iconRetinaUrl }
3187
- })) != null ? i : e, o = (n = O(a.shadowUrl, {
3188
- ...t,
3189
- errorMessage: "Invalid marker icon config: shadowUrl must be a valid URL",
3190
- cause: { field: "shadowUrl", value: a.shadowUrl }
3191
- })) != null ? n : void 0;
3192
- return {
3193
- iconUrl: e,
3194
- iconRetinaUrl: r,
3195
- shadowUrl: o,
3196
- iconSize: $(a.iconSize, Oe, {
3197
- ...t,
3198
- positiveOnly: !0,
3199
- errorMessage: "Invalid marker icon config: iconSize must be a [width, height] tuple of positive finite numbers",
3200
- cause: { field: "iconSize", value: a.iconSize }
3201
- }),
3202
- iconAnchor: $(
3203
- a.iconAnchor,
3204
- De,
3205
- {
3206
- ...t,
3207
- errorMessage: "Invalid marker icon config: iconAnchor must be a [x, y] tuple of finite numbers",
3208
- cause: { field: "iconAnchor", value: a.iconAnchor }
3209
- }
3210
- ),
3211
- popupAnchor: $(
3212
- a.popupAnchor,
3213
- Pe,
3214
- {
3215
- ...t,
3216
- errorMessage: "Invalid marker icon config: popupAnchor must be a [x, y] tuple of finite numbers",
3217
- cause: { field: "popupAnchor", value: a.popupAnchor }
3218
- }
3219
- )
3220
- };
3221
- }
3222
- function yr(a, t = {}) {
3223
- var i, n;
3224
- const e = O(a.iconUrl, {
3225
- ...t,
3226
- errorMessage: 'Invalid "marker-icon-url" attribute; falling back to default markers',
3227
- cause: { attribute: "marker-icon-url", value: a.iconUrl }
3228
- });
3229
- if (!e)
3230
- return null;
3231
- const r = (i = O(a.iconRetinaUrl, {
3232
- ...t,
3233
- errorMessage: 'Invalid "marker-icon-retina-url" attribute; using "marker-icon-url" instead',
3234
- cause: {
3235
- attribute: "marker-icon-retina-url",
3236
- value: a.iconRetinaUrl
3237
- }
3238
- })) != null ? i : e, o = (n = O(a.shadowUrl, {
3239
- ...t,
3240
- errorMessage: 'Invalid "marker-shadow-url" attribute; dropping the custom marker shadow',
3241
- cause: { attribute: "marker-shadow-url", value: a.shadowUrl }
3242
- })) != null ? n : void 0;
3243
- return {
3244
- iconUrl: e,
3245
- iconRetinaUrl: r,
3246
- shadowUrl: o,
3247
- iconSize: ee(
3248
- a.iconSize,
3249
- Oe,
3250
- {
3251
- ...t,
3252
- positiveOnly: !0,
3253
- errorMessage: 'Invalid "marker-icon-size" attribute; using the default marker size',
3254
- cause: {
3255
- attribute: "marker-icon-size",
3256
- value: a.iconSize
3257
- }
3258
- }
3259
- ),
3260
- iconAnchor: ee(
3261
- a.iconAnchor,
3262
- De,
3263
- {
3264
- ...t,
3265
- errorMessage: 'Invalid "marker-icon-anchor" attribute; using the default marker anchor',
3266
- cause: {
3267
- attribute: "marker-icon-anchor",
3268
- value: a.iconAnchor
3269
- }
3270
- }
3271
- ),
3272
- popupAnchor: ee(
3273
- a.popupAnchor,
3274
- Pe,
3275
- {
3276
- ...t,
3277
- errorMessage: 'Invalid "marker-popup-anchor" attribute; using the default popup anchor',
3278
- cause: {
3279
- attribute: "marker-popup-anchor",
3280
- value: a.popupAnchor
3281
- }
3282
- }
3283
- )
3284
- };
3285
- }
3286
- const I = {
3287
- osm: {
3288
- urlTemplate: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
3289
- attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
3290
- maxZoom: 19,
3291
- subdomains: ["a", "b", "c"]
3292
- },
3293
- here: {
3294
- styles: {
3295
- "lite.day": "lite.day",
3296
- "normal.day": "normal.day",
3297
- "satellite.day": "satellite.day"
3298
- },
3299
- defaultStyle: "lite.day",
3300
- attribution: 'Map Tiles &copy; <a href="https://www.here.com">HERE</a>',
3301
- maxZoom: 20
3302
- }
3303
- };
3304
- function ze(a) {
3305
- return typeof a == "string" ? a.trim().toLowerCase() : "";
3306
- }
3307
- function Re(a) {
3308
- if (typeof a != "string") return;
3309
- const t = a.trim();
3310
- return t.length > 0 ? t : void 0;
3311
- }
3312
- function br(a) {
3313
- const { style: t, attribution: e } = a, r = ze(a.provider), o = Re(a.apiKey);
3314
- switch (r) {
3315
- case "osm":
3316
- return {
3317
- urlTemplate: I.osm.urlTemplate,
3318
- attribution: e || I.osm.attribution,
3319
- maxZoom: I.osm.maxZoom,
3320
- subdomains: [...I.osm.subdomains]
3321
- };
3322
- case "here": {
3323
- if (!o)
3324
- throw new Error("HERE Maps requires an API key");
3325
- const i = typeof t == "string" ? t.trim() : "", n = i && i in I.here.styles ? i : I.here.defaultStyle;
3326
- return {
3327
- urlTemplate: `https://maps.hereapi.com/v3/base/mc/{z}/{x}/{y}/png8?style=${encodeURIComponent(n)}&apiKey=${encodeURIComponent(o)}`,
3328
- attribution: e || I.here.attribution,
3329
- maxZoom: I.here.maxZoom,
3330
- subdomains: void 0
3331
- };
3332
- }
3333
- default:
3334
- throw new Error(`Unknown tile provider: ${a.provider}`);
3335
- }
3336
- }
3337
- function Ar(a) {
3338
- const t = ze(a.provider), e = Re(a.apiKey);
3339
- return t ? t === "here" && !e ? { valid: !1, error: "HERE Maps requires an API key" } : { valid: !0 } : { valid: !1, error: "Provider is required" };
3340
- }
3341
- class Ue extends HTMLElement {
3342
- constructor() {
3343
- super();
3344
- // Shadow DOM and container references
3345
- h(this, "_root");
3346
- h(this, "_container");
3347
- // Logging
3348
- h(this, "_logger", V("component:leaflet-geokit", "debug"));
3349
- // Internal state mirrors for attributes/properties
3350
- h(this, "_latitude", 0);
3351
- h(this, "_longitude", 0);
3352
- h(this, "_zoom", 2);
3353
- h(this, "_minZoom");
3354
- h(this, "_maxZoom");
3355
- h(this, "_tileUrl", "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png");
3356
- h(this, "_tileAttribution");
3357
- h(this, "_tileProvider");
3358
- h(this, "_tileStyle");
3359
- h(this, "_apiKey");
3360
- h(this, "_activeTileProvider", "tile-url");
3361
- h(this, "_readOnly", !1);
3362
- h(this, "_logLevel", "debug");
3363
- h(this, "_devOverlay", !1);
3364
- h(this, "_polygonAllowIntersection", !1);
3365
- h(this, "_preferCanvas", !0);
3366
- // Default to Canvas for performance
3367
- // Theming
3368
- h(this, "_themeUrl");
3369
- h(this, "_themeCss", "");
3370
- h(this, "_themeLinkEl", null);
3371
- h(this, "_themeStyleEl", null);
3372
- // Controller
3373
- h(this, "_controller", null);
3374
- // External Leaflet configuration
3375
- h(this, "_useExternalLeaflet", !1);
3376
- h(this, "_skipLeafletStyles", !1);
3377
- h(this, "_leafletInstance");
3378
- h(this, "_toolHooks");
3379
- h(this, "_toolEventEmitter");
3380
- h(this, "_markerIconConfig");
3381
- h(this, "_toolButtonConfig");
3382
- h(this, "_toolbarGroups");
3383
- h(this, "_status", {
3384
- state: "uninitialized",
3385
- ready: !1,
3386
- busy: !1,
3387
- featureCount: 0,
3388
- timestamp: Date.now()
3389
- });
3390
- h(this, "_externalToolTriggerListener", (e) => {
3391
- var o, i;
3392
- const r = e.detail;
3393
- if ((r == null ? void 0 : r.action) === "deactivate" || (r == null ? void 0 : r.active) === !1) {
3394
- this.deactivateTool({
3395
- source: (o = r.source) != null ? o : "event",
3396
- groupId: r.groupId
3397
- });
3398
- return;
3399
- }
3400
- r != null && r.tool && this.activateTool(r.tool, {
3401
- source: (i = r.source) != null ? i : "event",
3402
- groupId: r.groupId
3403
- });
3404
- });
3405
- h(this, "_externalToolDeactivateListener", (e) => {
3406
- var o;
3407
- const r = e.detail;
3408
- this.deactivateTool({
3409
- source: (o = r == null ? void 0 : r.source) != null ? o : "event",
3410
- groupId: r == null ? void 0 : r.groupId
3411
- });
3412
- });
3413
- this._root = this.attachShadow({ mode: "open" }), this._root.innerHTML = `
3414
- <style>
3415
- :host {
3416
- display: block;
3417
- contain: content;
3418
- }
3419
- .map-container {
3420
- width: 100%;
3421
- height: 100%;
3422
- position: relative;
3423
- }
3424
- </style>
3425
- <div class="map-container" part="map"></div>
3426
- `;
3427
- const e = this._root.querySelector(".map-container");
3428
- if (!(e instanceof HTMLDivElement))
3429
- throw new Error("Failed to initialize map container");
3430
- this._container = e;
3431
- const r = this.getAttribute("log-level");
3432
- r && (this._logLevel = r, this._logger.setLevel(r));
3433
- }
3434
- // Build DrawControlsConfig from boolean attributes
3435
- _controlsFromAttributes() {
3436
- return {
3437
- polygon: this.hasAttribute("draw-polygon"),
3438
- polyline: this.hasAttribute("draw-polyline"),
3439
- rectangle: this.hasAttribute("draw-rectangle"),
3440
- circle: this.hasAttribute("draw-circle"),
3441
- cake: this.hasAttribute("draw-layer-cake"),
3442
- marker: this.hasAttribute("draw-marker"),
3443
- move: this.hasAttribute("draw-move"),
3444
- edit: this.hasAttribute("edit-features"),
3445
- delete: this.hasAttribute("delete-features"),
3446
- ruler: this.hasAttribute("draw-ruler")
3447
- };
3448
- }
3449
- _mapConfig() {
3450
- return {
3451
- latitude: this._latitude,
3452
- longitude: this._longitude,
3453
- zoom: this._zoom,
3454
- minZoom: this._minZoom,
3455
- maxZoom: this._maxZoom,
3456
- tileUrl: this._tileUrl,
3457
- tileAttribution: this._tileAttribution,
3458
- readOnly: this._readOnly,
3459
- fitToDataOnLoad: !1,
3460
- logLevel: this._logLevel,
3461
- devOverlay: this._devOverlay,
3462
- polygonAllowIntersection: this._polygonAllowIntersection,
3463
- preferCanvas: this._preferCanvas,
3464
- useExternalLeaflet: this._useExternalLeaflet,
3465
- skipLeafletStyles: this._skipLeafletStyles
3466
- };
3467
- }
3468
- // Lifecycle
3469
- async connectedCallback() {
3470
- var e;
3471
- this._logger.debug("connectedCallback", this._currentConfig()), this._setStatus({
3472
- state: "initializing",
3473
- ready: !1,
3474
- busy: !0,
3475
- featureCount: 0,
3476
- lastEvent: "connected",
3477
- lastError: null
3478
- }), ot({
3479
- root: this._root,
3480
- skipStyles: this._skipLeafletStyles
3481
- }), this._applyThemeStyles(), this._controller = new gr({
3482
- container: this._container,
3483
- map: this._mapConfig(),
3484
- controls: this._controlsFromAttributes(),
3485
- readOnly: this._readOnly,
3486
- logger: this._logger.child("controller"),
3487
- callbacks: {
3488
- onReady: (r) => {
3489
- this.dispatchEvent(new CustomEvent(L.Ready, { detail: r })), this._syncStatusFromController({
3490
- state: "ready",
3491
- ready: !0,
3492
- busy: !1,
3493
- lastEvent: L.Ready,
3494
- clearLastError: !0
3495
- });
3496
- },
3497
- onCreated: (r) => {
3498
- this.dispatchEvent(new CustomEvent(L.Created, { detail: r })), this._setStatus({
3499
- state: "ready",
3500
- ready: !0,
3501
- busy: !1,
3502
- featureCount: this._status.featureCount + 1,
3503
- lastEvent: L.Created,
3504
- lastError: null
3505
- });
3506
- },
3507
- onEdited: (r) => {
3508
- this.dispatchEvent(new CustomEvent(L.Edited, { detail: r })), this._setStatus({
3509
- state: "ready",
3510
- ready: !0,
3511
- busy: !1,
3512
- featureCount: r.geoJSON.features.length,
3513
- lastEvent: L.Edited,
3514
- lastError: null
3515
- });
3516
- },
3517
- onDeleted: (r) => {
3518
- this.dispatchEvent(new CustomEvent(L.Deleted, { detail: r })), this._setStatus({
3519
- state: "ready",
3520
- ready: !0,
3521
- busy: !1,
3522
- featureCount: r.geoJSON.features.length,
3523
- lastEvent: L.Deleted,
3524
- lastError: null
3525
- });
3526
- },
3527
- onError: (r) => {
3528
- this._emitError(r, {
3529
- state: r.recoverable ? this._status.ready ? "ready" : this._status.state : "error",
3530
- lastEvent: L.Error
3531
- });
3532
- },
3533
- onTileError: (r) => {
3534
- if (this._tileProvider)
3535
- return;
3536
- const o = this._describeTileLayerError(r, "tile-url");
3537
- this._handleTileProviderError(
3538
- "tile_load_failed",
3539
- o,
3540
- "tile-url"
3541
- );
3542
- },
3543
- onToolTrigger: (r) => {
3544
- this._emitToolTriggerResult(r);
3545
- },
3546
- onSaved: (r) => {
3547
- this.dispatchEvent(
3548
- new CustomEvent(L.Export, {
3549
- detail: {
3550
- geoJSON: r.geoJSON,
3551
- featureCount: r.featureCount,
3552
- adapter: "editing"
3553
- }
3554
- })
3555
- ), this._setStatus({
3556
- state: "ready",
3557
- ready: !0,
3558
- busy: !1,
3559
- featureCount: r.featureCount,
3560
- lastEvent: L.Export,
3561
- lastError: null
3562
- });
3563
- }
3564
- },
3565
- leaflet: (e = this._leafletInstance) != null ? e : void 0,
3566
- useExternalLeaflet: this._useExternalLeaflet,
3567
- toolHooks: this._toolHooks,
3568
- toolEventEmitter: this._toolEventEmitter,
3569
- markerIconConfig: this._effectiveMarkerIconConfig(),
3570
- toolButtonConfig: this._effectiveToolButtonConfig(),
3571
- toolbarGroups: this._effectiveToolbarGroups()
3572
- }), this.addEventListener(
3573
- "leaflet-geokit:trigger-tool",
3574
- this._externalToolTriggerListener
3575
- ), this.addEventListener(
3576
- "leaflet-geokit:activate-tool",
3577
- this._externalToolTriggerListener
3578
- ), this.addEventListener(
3579
- "leaflet-geokit:deactivate-tool",
3580
- this._externalToolDeactivateListener
3581
- ), await this._controller.init(), this._status.state !== "error" && this._tileProvider && this._updateTileLayer();
3582
- }
3583
- async disconnectedCallback() {
3584
- this._logger.debug("disconnectedCallback"), this._controller && (await this._controller.destroy(), this._controller = null), this.removeEventListener(
3585
- "leaflet-geokit:trigger-tool",
3586
- this._externalToolTriggerListener
3587
- ), this.removeEventListener(
3588
- "leaflet-geokit:activate-tool",
3589
- this._externalToolTriggerListener
3590
- ), this.removeEventListener(
3591
- "leaflet-geokit:deactivate-tool",
3592
- this._externalToolDeactivateListener
3593
- ), this._setStatus({
3594
- state: "uninitialized",
3595
- ready: !1,
3596
- busy: !1,
3597
- featureCount: 0,
3598
- lastEvent: "disconnected",
3599
- lastError: null
3600
- });
3601
- }
3602
- // Observed attributes and reflection
3603
- static get observedAttributes() {
3604
- return [
3605
- "latitude",
3606
- "longitude",
3607
- "zoom",
3608
- "min-zoom",
3609
- "max-zoom",
3610
- "tile-url",
3611
- "tile-attribution",
3612
- "tile-provider",
3613
- "tile-style",
3614
- "api-key",
3615
- "here-api-key",
3616
- "read-only",
3617
- "log-level",
3618
- "dev-overlay",
3619
- "prefer-canvas",
3620
- "use-external-leaflet",
3621
- "skip-leaflet-styles",
3622
- "marker-icon-url",
3623
- "marker-icon-retina-url",
3624
- "marker-shadow-url",
3625
- "marker-icon-size",
3626
- "marker-icon-anchor",
3627
- "marker-popup-anchor",
3628
- "tool-button-config",
3629
- "toolbar-groups",
3630
- "theme-url",
3631
- // draw controls
3632
- "draw-polygon",
3633
- "draw-polyline",
3634
- "draw-rectangle",
3635
- "draw-circle",
3636
- "draw-layer-cake",
3637
- "draw-marker",
3638
- "draw-move",
3639
- "draw-ruler",
3640
- "edit-features",
3641
- "delete-features",
3642
- "polygon-allow-intersection"
3643
- ];
3644
- }
3645
- attributeChangedCallback(e, r, o) {
3646
- switch (this._logger.debug("attributeChanged", { name: e, value: o }), e) {
3647
- case "latitude":
3648
- this._latitude = this._coerceNumber(o, 0);
3649
- break;
3650
- case "longitude":
3651
- this._longitude = this._coerceNumber(o, 0);
3652
- break;
3653
- case "zoom":
3654
- this._zoom = this._coerceNumber(o, 2);
3655
- break;
3656
- case "min-zoom":
3657
- this._minZoom = o != null ? this._coerceNumber(o) : void 0;
3658
- break;
3659
- case "max-zoom":
3660
- this._maxZoom = o != null ? this._coerceNumber(o) : void 0;
3661
- break;
3662
- case "tile-url":
3663
- this._tileUrl = o != null ? o : "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", this._controller && this._updateTileLayer();
3664
- break;
3665
- case "tile-attribution":
3666
- this._tileAttribution = o != null ? o : void 0, this._controller && this._updateTileLayer();
3667
- break;
3668
- case "tile-provider":
3669
- this._tileProvider = this._normalizeText(o, {
3670
- lowercase: !0
3671
- }), this._controller && this._updateTileLayer();
3672
- break;
3673
- case "tile-style":
3674
- this._tileStyle = this._normalizeText(o), this._controller && this._updateTileLayer();
3675
- break;
3676
- case "api-key":
3677
- case "here-api-key":
3678
- this._syncApiKeyFromAttributes(), this._controller && this._updateTileLayer();
3679
- break;
3680
- case "theme-url":
3681
- this._themeUrl = o != null ? o : void 0, this.isConnected && this._applyThemeStyles();
3682
- break;
3683
- case "read-only":
3684
- this._readOnly = o !== null;
3685
- break;
3686
- case "log-level":
3687
- this._logLevel = o != null ? o : this._logLevel, this._logger.setLevel(this._logLevel);
3688
- break;
3689
- case "dev-overlay":
3690
- this._devOverlay = o !== null;
3691
- break;
3692
- case "polygon-allow-intersection":
3693
- this._polygonAllowIntersection = o !== null;
3694
- break;
3695
- case "prefer-canvas":
3696
- this._preferCanvas = o !== null;
3697
- break;
3698
- case "use-external-leaflet":
3699
- this._useExternalLeaflet = o !== null;
3700
- break;
3701
- case "skip-leaflet-styles":
3702
- this._skipLeafletStyles = o !== null;
3703
- break;
3704
- }
3705
- this._controller && (e === "latitude" || e === "longitude" || e === "zoom" ? this._controller.setView(
3706
- this._latitude,
3707
- this._longitude,
3708
- this._zoom
3709
- ) : this._isMarkerIconAttribute(e) ? this._syncMarkerIconConfig() : e === "tool-button-config" ? this._syncToolButtonConfig() : e === "toolbar-groups" ? this._syncToolbarGroups() : (e === "min-zoom" || e === "max-zoom" || e === "read-only" || e === "dev-overlay" || e === "log-level" || e === "prefer-canvas" || e === "use-external-leaflet" || e === "skip-leaflet-styles" || e.startsWith("draw-") || e === "edit-features" || e === "delete-features") && this._controller.destroy().then(() => this._controller.init()));
3710
- }
3711
- _updateTileLayer() {
3712
- var r, o, i, n;
3713
- if (!this._controller)
3714
- return;
3715
- const e = this._controller;
3716
- if (typeof e.setTileLayer != "function") {
3717
- this._logger.warn("setTileLayer is not available on MapController yet");
3718
- return;
3719
- }
3720
- try {
3721
- if (this._tileProvider) {
3722
- const s = this._tileProvider, l = {
3723
- provider: s,
3724
- style: this._tileStyle,
3725
- apiKey: this._apiKey,
3726
- attribution: this._tileAttribution
3727
- }, c = Ar(l);
3728
- if (!c.valid) {
3729
- const p = (r = c.error) != null && r.toLowerCase().includes("api key") ? "missing_api_key" : "tile_load_failed";
3730
- this._handleTileProviderError(
3731
- p,
3732
- (o = c.error) != null ? o : "Invalid tile provider configuration",
3733
- s
3734
- );
3735
- return;
3736
- }
3737
- const d = br(l), u = this._activeTileProvider;
3738
- e.setTileLayer(d, {
3739
- onTileError: (p) => {
3740
- if (this._tileProvider !== s) return;
3741
- const g = this._describeTileLayerError(p, s), m = s === "here" ? this._resolveHereTileLayerErrorCode(g) : "tile_load_failed";
3742
- this._handleTileProviderError(m, g, s);
3743
- }
3744
- }), this._activeTileProvider = s, this._emitTileProviderChanged(
3745
- s,
3746
- this._tileStyle,
3747
- u
3748
- );
3749
- return;
3750
- }
3751
- e.setTileLayer(
3752
- {
3753
- urlTemplate: this._tileUrl,
3754
- attribution: (i = this._tileAttribution) != null ? i : "",
3755
- maxZoom: this._maxZoom,
3756
- subdomains: ["a", "b", "c"]
3757
- },
3758
- {
3759
- onTileError: (s) => {
3760
- const l = this._describeTileLayerError(s, "tile-url");
3761
- this._handleTileProviderError(
3762
- "tile_load_failed",
3763
- l,
3764
- "tile-url"
3765
- );
3766
- }
3767
- }
3768
- ), this._activeTileProvider = "tile-url";
3769
- } catch (s) {
3770
- const l = this._resolveTileProviderErrorCode(s);
3771
- this._logger.error("Failed to update tile layer", { error: s, code: l }), this._handleTileProviderError(
3772
- l,
3773
- s instanceof Error ? s.message : "Unknown tile layer error",
3774
- (n = this._tileProvider) != null ? n : "unknown"
3775
- );
3776
- }
3777
- }
3778
- _handleTileProviderError(e, r, o) {
3779
- this._logger.error(`Tile provider error (${e}): ${r}`);
3780
- const i = Date.now();
3781
- this.dispatchEvent(
3782
- new CustomEvent("tile-provider-error", {
3783
- bubbles: !0,
3784
- detail: {
3785
- code: e,
3786
- message: r,
3787
- provider: o,
3788
- timestamp: i
3789
- }
3790
- })
3791
- ), this._emitDiagnostic(
3792
- {
3793
- code: e,
3794
- message: r,
3795
- recoverable: !0,
3796
- severity: "warn",
3797
- timestamp: i
3798
- },
3799
- {
3800
- state: this._status.ready ? "ready" : this._status.state,
3801
- lastEvent: "tile-provider-error"
3802
- }
3803
- );
3804
- const n = this._controller;
3805
- typeof n.setTileLayer == "function" && (n.setTileLayer({
3806
- urlTemplate: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
3807
- attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
3808
- maxZoom: 19,
3809
- subdomains: ["a", "b", "c"]
3810
- }), this._activeTileProvider = "osm");
3811
- }
3812
- _emitTileProviderChanged(e, r, o) {
3813
- this.dispatchEvent(
3814
- new CustomEvent("tile-provider-changed", {
3815
- bubbles: !0,
3816
- detail: {
3817
- provider: e,
3818
- style: r,
3819
- previousProvider: o,
3820
- timestamp: Date.now()
3821
- }
3822
- })
3823
- );
3824
- }
3825
- _isMarkerIconAttribute(e) {
3826
- return e === "marker-icon-url" || e === "marker-icon-retina-url" || e === "marker-shadow-url" || e === "marker-icon-size" || e === "marker-icon-anchor" || e === "marker-popup-anchor";
3827
- }
3828
- _effectiveMarkerIconConfig() {
3829
- const e = (o, i) => {
3830
- this._emitError(
3831
- {
3832
- code: "invalid_marker_icon_config",
3833
- message: o,
3834
- recoverable: !0,
3835
- cause: i
3836
- },
3837
- {
3838
- state: this._status.ready ? "ready" : this._status.state
3839
- }
3840
- );
3841
- };
3842
- if (this._markerIconConfig === null)
3843
- return null;
3844
- if (this._markerIconConfig !== void 0)
3845
- return mr(this._markerIconConfig, { reportError: e });
3846
- const r = this.getAttribute("marker-icon-url");
3847
- return r == null ? null : yr(
3848
- {
3849
- iconUrl: r,
3850
- iconRetinaUrl: this.getAttribute("marker-icon-retina-url"),
3851
- shadowUrl: this.getAttribute("marker-shadow-url"),
3852
- iconSize: this.getAttribute("marker-icon-size"),
3853
- iconAnchor: this.getAttribute("marker-icon-anchor"),
3854
- popupAnchor: this.getAttribute("marker-popup-anchor")
3855
- },
3856
- { reportError: e }
3857
- );
3858
- }
3859
- _syncMarkerIconConfig() {
3860
- const e = this._controller;
3861
- typeof (e == null ? void 0 : e.setMarkerIconConfig) == "function" && e.setMarkerIconConfig(this._effectiveMarkerIconConfig());
3862
- }
3863
- _effectiveToolButtonConfig() {
3864
- if (this._toolButtonConfig !== void 0)
3865
- return this._toolButtonConfig;
3866
- const e = this.getAttribute("tool-button-config");
3867
- if (e == null || e.trim() === "")
3868
- return null;
3869
- try {
3870
- const r = JSON.parse(e);
3871
- if (!r || typeof r != "object" || Array.isArray(r))
3872
- throw new Error("tool-button-config must be a JSON object");
3873
- return r;
3874
- } catch (r) {
3875
- return this._emitError(
3876
- {
3877
- code: "invalid_tool_button_config",
3878
- message: "Failed to parse tool-button-config",
3879
- recoverable: !0,
3880
- cause: r
3881
- },
3882
- {
3883
- state: this._status.ready ? "ready" : this._status.state
3884
- }
3885
- ), null;
3886
- }
3887
- }
3888
- _syncToolButtonConfig() {
3889
- const e = this._controller;
3890
- typeof (e == null ? void 0 : e.setToolButtonConfig) == "function" && e.setToolButtonConfig(this._effectiveToolButtonConfig());
3891
- }
3892
- _effectiveToolbarGroups() {
3893
- if (this._toolbarGroups !== void 0)
3894
- return this._toolbarGroups;
3895
- const e = this.getAttribute("toolbar-groups");
3896
- if (e == null || e.trim() === "")
3897
- return null;
3898
- try {
3899
- const r = JSON.parse(e);
3900
- if (!Array.isArray(r))
3901
- throw new Error("toolbar-groups must be a JSON array");
3902
- return r;
3903
- } catch (r) {
3904
- return this._emitError(
3905
- {
3906
- code: "invalid_toolbar_groups",
3907
- message: "Failed to parse toolbar-groups",
3908
- recoverable: !0,
3909
- cause: r
3910
- },
3911
- {
3912
- state: this._status.ready ? "ready" : this._status.state
3913
- }
3914
- ), null;
3915
- }
3916
- }
3917
- _syncToolbarGroups() {
3918
- const e = this._controller;
3919
- typeof (e == null ? void 0 : e.setToolbarGroups) == "function" && e.setToolbarGroups(this._effectiveToolbarGroups());
3920
- }
3921
- // Properties (reflect attributes)
3922
- get latitude() {
3923
- return this._latitude;
3924
- }
3925
- set latitude(e) {
3926
- this._latitude = Number(e), this._reflect("latitude", String(this._latitude));
3927
- }
3928
- get longitude() {
3929
- return this._longitude;
3930
- }
3931
- set longitude(e) {
3932
- this._longitude = Number(e), this._reflect("longitude", String(this._longitude));
3933
- }
3934
- get zoom() {
3935
- return this._zoom;
3936
- }
3937
- set zoom(e) {
3938
- this._zoom = Number(e), this._reflect("zoom", String(this._zoom));
3939
- }
3940
- get minZoom() {
3941
- return this._minZoom;
3942
- }
3943
- set minZoom(e) {
3944
- this._minZoom = e, this._reflect("min-zoom", e != null ? String(e) : null);
3945
- }
3946
- get maxZoom() {
3947
- return this._maxZoom;
3948
- }
3949
- set maxZoom(e) {
3950
- this._maxZoom = e, this._reflect("max-zoom", e != null ? String(e) : null);
3951
- }
3952
- get tileUrl() {
3953
- return this._tileUrl;
3954
- }
3955
- set tileUrl(e) {
3956
- this._tileUrl = e, this._reflect("tile-url", e), this._controller && this._updateTileLayer();
3957
- }
3958
- get tileProvider() {
3959
- return this._tileProvider;
3960
- }
3961
- set tileProvider(e) {
3962
- var r;
3963
- this._tileProvider = this._normalizeText(e != null ? e : null, {
3964
- lowercase: !0
3965
- }), this._reflect("tile-provider", (r = this._tileProvider) != null ? r : null), this._controller && this._updateTileLayer();
3966
- }
3967
- get tileStyle() {
3968
- return this._tileStyle;
3969
- }
3970
- set tileStyle(e) {
3971
- var r;
3972
- this._tileStyle = this._normalizeText(e != null ? e : null), this._reflect("tile-style", (r = this._tileStyle) != null ? r : null), this._controller && this._updateTileLayer();
3973
- }
3974
- get apiKey() {
3975
- return this._apiKey;
3976
- }
3977
- set apiKey(e) {
3978
- var r;
3979
- this._apiKey = this._normalizeText(e != null ? e : null), this._reflect("api-key", (r = this._apiKey) != null ? r : null), this.hasAttribute("here-api-key") && this.removeAttribute("here-api-key"), this._controller && this._updateTileLayer();
3980
- }
3981
- get status() {
3982
- return this._cloneStatus(this._status);
3983
- }
3984
- get tileAttribution() {
3985
- return this._tileAttribution;
3986
- }
3987
- set tileAttribution(e) {
3988
- this._tileAttribution = e, this._reflect("tile-attribution", e != null ? e : null), this._controller && this._updateTileLayer();
3989
- }
3990
- get readOnly() {
3991
- return this._readOnly;
3992
- }
3993
- set readOnly(e) {
3994
- this._readOnly = !!e, this._booleanReflect("read-only", this._readOnly);
3995
- }
3996
- get logLevel() {
3997
- return this._logLevel;
3998
- }
3999
- set logLevel(e) {
4000
- this._logLevel = e, this._logger.setLevel(e), this._reflect("log-level", e);
4001
- }
4002
- get devOverlay() {
4003
- return this._devOverlay;
4004
- }
4005
- set devOverlay(e) {
4006
- this._devOverlay = !!e, this._booleanReflect("dev-overlay", this._devOverlay);
4007
- }
4008
- get preferCanvas() {
4009
- return this._preferCanvas;
4010
- }
4011
- set preferCanvas(e) {
4012
- this._preferCanvas = !!e, this._booleanReflect("prefer-canvas", this._preferCanvas);
4013
- }
4014
- get useExternalLeaflet() {
4015
- return this._useExternalLeaflet;
4016
- }
4017
- set useExternalLeaflet(e) {
4018
- this._useExternalLeaflet = !!e, this._booleanReflect("use-external-leaflet", this._useExternalLeaflet);
4019
- }
4020
- get skipLeafletStyles() {
4021
- return this._skipLeafletStyles;
4022
- }
4023
- set skipLeafletStyles(e) {
4024
- this._skipLeafletStyles = !!e, this._booleanReflect("skip-leaflet-styles", this._skipLeafletStyles);
4025
- }
4026
- get markerIconConfig() {
4027
- return this._markerIconConfig;
4028
- }
4029
- set markerIconConfig(e) {
4030
- this._markerIconConfig = e, this._syncMarkerIconConfig();
4031
- }
4032
- get toolButtonConfig() {
4033
- return this._toolButtonConfig;
4034
- }
4035
- set toolButtonConfig(e) {
4036
- this._toolButtonConfig = e, this._syncToolButtonConfig();
4037
- }
4038
- get toolbarGroups() {
4039
- return this._toolbarGroups;
4040
- }
4041
- set toolbarGroups(e) {
4042
- this._toolbarGroups = e, this._syncToolbarGroups();
4043
- }
4044
- get leafletInstance() {
4045
- return this._leafletInstance;
4046
- }
4047
- set leafletInstance(e) {
4048
- this._leafletInstance = e;
4049
- }
4050
- get toolHooks() {
4051
- return this._toolHooks;
4052
- }
4053
- set toolHooks(e) {
4054
- this._toolHooks = e;
4055
- const r = this._controller;
4056
- typeof (r == null ? void 0 : r.setToolObservers) == "function" && r.setToolObservers({
4057
- toolHooks: this._toolHooks,
4058
- toolEventEmitter: this._toolEventEmitter
4059
- });
4060
- }
4061
- get toolEventEmitter() {
4062
- return this._toolEventEmitter;
4063
- }
4064
- set toolEventEmitter(e) {
4065
- this._toolEventEmitter = e;
4066
- const r = this._controller;
4067
- typeof (r == null ? void 0 : r.setToolObservers) == "function" && r.setToolObservers({
4068
- toolHooks: this._toolHooks,
4069
- toolEventEmitter: this._toolEventEmitter
4070
- });
4071
- }
4072
- get themeCss() {
4073
- return this._themeCss;
4074
- }
4075
- set themeCss(e) {
4076
- this._themeCss = typeof e == "string" ? e : "", this.isConnected && this._applyThemeStyles();
4077
- }
4078
- // Public API methods (delegating to controller)
4079
- async getGeoJSON() {
4080
- return this._logger.debug("getGeoJSON"), this._controller ? this._controller.getGeoJSON() : { type: "FeatureCollection", features: [] };
4081
- }
4082
- async importGeoJSON(e, r = {}) {
4083
- var n, s, l, c;
4084
- const o = (n = r.behavior) != null ? n : "replace";
4085
- if (this._logger.debug("importGeoJSON", {
4086
- behavior: o,
4087
- fitToData: (s = r.fitToData) != null ? s : !1,
4088
- features: (c = (l = e == null ? void 0 : e.features) == null ? void 0 : l.length) != null ? c : 0
4089
- }), !this._controller) return [];
4090
- const i = this.status;
4091
- return this._setImportLoadingStatus(i), this._performImport(
4092
- e,
4093
- r,
4094
- i,
4095
- o === "add" ? "Failed to add GeoJSON features to the map" : "Failed to load GeoJSON into the map"
4096
- );
4097
- }
4098
- async loadGeoJSON(e) {
4099
- var r, o;
4100
- this._logger.debug("loadGeoJSON", { features: (o = (r = e == null ? void 0 : e.features) == null ? void 0 : r.length) != null ? o : 0 }), await this.importGeoJSON(e, { behavior: "replace" });
4101
- }
4102
- async clearLayers() {
4103
- this._logger.debug("clearLayers"), this._controller && (await this._controller.clearLayers(), this._setStatus({
4104
- state: "ready",
4105
- ready: !0,
4106
- busy: !1,
4107
- featureCount: 0,
4108
- lastEvent: "clearLayers",
4109
- lastError: null
4110
- }));
4111
- }
4112
- async addFeatures(e) {
4113
- var r, o;
4114
- return this._logger.debug("addFeatures", { count: (o = (r = e == null ? void 0 : e.features) == null ? void 0 : r.length) != null ? o : 0 }), this.importGeoJSON(e, { behavior: "add" });
4115
- }
4116
- async updateFeature(e, r) {
4117
- this._logger.debug("updateFeature", { id: e }), this._controller && await this._controller.updateFeature(e, r);
4118
- }
4119
- async removeFeature(e) {
4120
- this._logger.debug("removeFeature", { id: e }), this._controller && (await this._controller.removeFeature(e), await this._syncStatusFromController({
4121
- state: "ready",
4122
- ready: !0,
4123
- busy: !1,
4124
- lastEvent: "removeFeature",
4125
- clearLastError: !0
4126
- }));
4127
- }
4128
- async fitBoundsToData(e) {
4129
- this._logger.debug("fitBoundsToData", { padding: e }), this._controller && await this._controller.fitBoundsToData(
4130
- typeof e == "number" ? e : 0.05
4131
- );
4132
- }
4133
- async fitBounds(e, r) {
4134
- this._logger.debug("fitBounds", { bounds: e, padding: r }), this._controller && await this._controller.fitBounds(
4135
- e,
4136
- typeof r == "number" ? r : 0.05
4137
- );
4138
- }
4139
- async setView(e, r, o) {
4140
- this._logger.debug("setView", { lat: e, lng: r, zoom: o }), this.latitude = e, this.longitude = r, typeof o == "number" && (this.zoom = o), this._controller && await this._controller.setView(e, r, o);
4141
- }
4142
- async exportGeoJSON(e = {}) {
4143
- var n;
4144
- const r = (n = e.adapter) != null ? n : "editing";
4145
- if (this._logger.debug("exportGeoJSON", { adapter: r }), !this._controller) return { type: "FeatureCollection", features: [] };
4146
- const o = await this._exportWithController(e), i = {
4147
- geoJSON: o,
4148
- featureCount: o.features.length,
4149
- adapter: r
4150
- };
4151
- return this.dispatchEvent(new CustomEvent(L.Export, { detail: i })), o;
4152
- }
4153
- /**
4154
- * Merge all visible polygon layers into a single polygon.
4155
- * This removes the original polygon features and adds a new merged feature.
4156
- *
4157
- * @param options Optional configuration for the merge operation
4158
- * @returns Promise resolving to the ID of the newly created merged feature, or null if no polygons to merge
4159
- */
4160
- async mergePolygons(e) {
4161
- if (this._logger.debug("mergePolygons"), !this._controller) return null;
4162
- const o = (await this._controller.getGeoJSON()).features.length, i = await this._controller.mergeVisiblePolygons(e);
4163
- if (i) {
4164
- const n = await this._controller.getGeoJSON(), s = {
4165
- id: i,
4166
- mergedFeatureCount: o - n.features.length + 1,
4167
- geoJSON: n
4168
- };
4169
- this.dispatchEvent(new CustomEvent("leaflet-draw:merged", { detail: s })), this._setStatus({
4170
- state: "ready",
4171
- ready: !0,
4172
- busy: !1,
4173
- featureCount: n.features.length,
4174
- lastEvent: "leaflet-draw:merged",
4175
- lastError: null
4176
- });
4177
- }
4178
- return i;
4179
- }
4180
- async setMeasurementUnits(e) {
4181
- this._logger.debug("setMeasurementUnits", { system: e }), this._controller && this._controller.setRulerUnits(e);
4182
- }
4183
- async activateTool(e, r = {}) {
4184
- var s, l;
4185
- const o = (s = r.source) != null ? s : "api";
4186
- if (this.dispatchEvent(
4187
- new CustomEvent("leaflet-geokit:tool-trigger-requested", {
4188
- bubbles: !0,
4189
- composed: !0,
4190
- detail: {
4191
- tool: e,
4192
- source: o,
4193
- groupId: r.groupId,
4194
- handled: !1,
4195
- timestamp: Date.now()
4196
- }
4197
- })
4198
- ), !this._controller)
4199
- return this._emitToolTriggerResult({
4200
- tool: e,
4201
- source: o,
4202
- groupId: r.groupId,
4203
- handled: !1,
4204
- timestamp: Date.now(),
4205
- error: "Map controller is not initialized"
4206
- }), !1;
4207
- const i = this._controller, n = typeof i.activateTool == "function" ? i.activateTool.bind(i) : (l = i.triggerTool) == null ? void 0 : l.bind(i);
4208
- return n ? n(e, {
4209
- source: o,
4210
- groupId: r.groupId
4211
- }) : (this._emitToolTriggerResult({
4212
- tool: e,
4213
- source: o,
4214
- groupId: r.groupId,
4215
- handled: !1,
4216
- timestamp: Date.now(),
4217
- error: "Map controller cannot activate tools"
4218
- }), !1);
4219
- }
4220
- async triggerTool(e, r = {}) {
4221
- return this.activateTool(e, r);
4222
- }
4223
- async deactivateTool(e = {}) {
4224
- var n, s;
4225
- const r = (n = e.source) != null ? n : "api";
4226
- if (this.dispatchEvent(
4227
- new CustomEvent("leaflet-geokit:tool-trigger-requested", {
4228
- bubbles: !0,
4229
- composed: !0,
4230
- detail: {
4231
- tool: "select",
4232
- source: r,
4233
- groupId: e.groupId,
4234
- handled: !1,
4235
- timestamp: Date.now()
4236
- }
4237
- })
4238
- ), !this._controller)
4239
- return this._emitToolTriggerResult({
4240
- tool: "select",
4241
- source: r,
4242
- groupId: e.groupId,
4243
- handled: !1,
4244
- timestamp: Date.now(),
4245
- error: "Map controller is not initialized"
4246
- }), !1;
4247
- const o = this._controller;
4248
- if (typeof o.deactivateTool == "function")
4249
- return o.deactivateTool({
4250
- source: r,
4251
- groupId: e.groupId
4252
- });
4253
- const i = typeof o.activateTool == "function" ? o.activateTool.bind(o) : (s = o.triggerTool) == null ? void 0 : s.bind(o);
4254
- return i ? i("select", {
4255
- source: r,
4256
- groupId: e.groupId
4257
- }) : (this._emitToolTriggerResult({
4258
- tool: "select",
4259
- source: r,
4260
- groupId: e.groupId,
4261
- handled: !1,
4262
- timestamp: Date.now(),
4263
- error: "Map controller cannot deactivate tools"
4264
- }), !1);
4265
- }
4266
- async loadGeoJSONFromUrl(e, r = {}) {
4267
- var l, c, d;
4268
- const o = (l = r.behavior) != null ? l : "replace";
4269
- if (this._logger.debug("loadGeoJSONFromUrl", {
4270
- url: e,
4271
- behavior: o,
4272
- fitToData: (c = r.fitToData) != null ? c : !0
4273
- }), !this._controller) return;
4274
- const i = this.status;
4275
- this._setImportLoadingStatus(i);
4276
- let n;
4277
- try {
4278
- n = await fetch(e, { headers: { Accept: "application/json" } });
4279
- } catch (u) {
4280
- const p = new Error(`Failed to fetch GeoJSON from ${e}`);
4281
- throw this._emitError(
4282
- {
4283
- code: "data_fetch_failed",
4284
- message: p.message,
4285
- recoverable: !0,
4286
- cause: u
4287
- },
4288
- {
4289
- state: i.ready ? "ready" : i.state,
4290
- featureCount: i.featureCount
4291
- }
4292
- ), p;
4293
- }
4294
- if (!n.ok) {
4295
- const u = new Error(
4296
- `Failed to fetch GeoJSON from ${e}: ${n.status} ${n.statusText}`
4297
- );
4298
- throw this._emitError(
4299
- {
4300
- code: "data_fetch_failed",
4301
- message: u.message,
4302
- recoverable: !0,
4303
- cause: u
4304
- },
4305
- {
4306
- state: i.ready ? "ready" : i.state,
4307
- featureCount: i.featureCount
4308
- }
4309
- ), u;
4310
- }
4311
- let s;
4312
- try {
4313
- s = await n.json();
4314
- } catch (u) {
4315
- const p = new Error(`Failed to parse GeoJSON from ${e}`);
4316
- throw this._emitError(
4317
- {
4318
- code: "data_parse_failed",
4319
- message: p.message,
4320
- recoverable: !0,
4321
- cause: u
4322
- },
4323
- {
4324
- state: i.ready ? "ready" : i.state,
4325
- featureCount: i.featureCount
4326
- }
4327
- ), p;
4328
- }
4329
- await this._performImport(
4330
- s,
4331
- {
4332
- behavior: o,
4333
- fitToData: (d = r.fitToData) != null ? d : !0
4334
- },
4335
- i,
4336
- o === "add" ? `Failed to add GeoJSON from ${e}` : `Failed to load GeoJSON from ${e}`
4337
- );
4338
- }
4339
- async loadGeoJSONFromText(e, r = {}) {
4340
- var s, l, c, d;
4341
- const o = (s = r.behavior) != null ? s : "replace";
4342
- if (this._logger.debug("loadGeoJSONFromText", {
4343
- behavior: o,
4344
- fitToData: (l = r.fitToData) != null ? l : !0,
4345
- length: (c = e == null ? void 0 : e.length) != null ? c : 0
4346
- }), !this._controller) return;
4347
- const i = this.status;
4348
- this._setImportLoadingStatus(i);
4349
- let n;
4350
- try {
4351
- n = JSON.parse(e);
4352
- } catch (u) {
4353
- const p = new Error("Failed to parse GeoJSON text");
4354
- throw this._emitError(
4355
- {
4356
- code: "data_parse_failed",
4357
- message: p.message,
4358
- recoverable: !0,
4359
- cause: u
4360
- },
4361
- {
4362
- state: i.ready ? "ready" : i.state,
4363
- featureCount: i.featureCount
4364
- }
4365
- ), p;
4366
- }
4367
- await this._performImport(
4368
- n,
4369
- {
4370
- behavior: o,
4371
- fitToData: (d = r.fitToData) != null ? d : !0
4372
- },
4373
- i,
4374
- o === "add" ? "Failed to add parsed GeoJSON into the map" : "Failed to load parsed GeoJSON into the map"
4375
- );
4376
- }
4377
- _setImportLoadingStatus(e) {
4378
- this._setStatus({
4379
- state: "loading",
4380
- ready: e.ready,
4381
- busy: !0,
4382
- featureCount: e.featureCount,
4383
- lastEvent: L.Ingest,
4384
- lastError: null
4385
- });
4386
- }
4387
- async _performImport(e, r, o, i) {
4388
- var c, d;
4389
- const n = (c = r.behavior) != null ? c : "replace", s = {
4390
- fc: e,
4391
- mode: n === "add" ? "add" : "load"
4392
- };
4393
- this.dispatchEvent(new CustomEvent(L.Ingest, { detail: s }));
4394
- const l = s.fc && s.fc.type === "FeatureCollection" ? s.fc : e;
4395
- try {
4396
- const u = await this._importWithController(l, {
4397
- behavior: n,
4398
- fitToData: (d = r.fitToData) != null ? d : !1
4399
- });
4400
- return await this._syncStatusFromController({
4401
- state: "ready",
4402
- ready: !0,
4403
- busy: !1,
4404
- lastEvent: L.Ingest,
4405
- clearLastError: !0
4406
- }), u;
4407
- } catch (u) {
4408
- throw this._emitError(
4409
- {
4410
- code: n === "add" ? "data_add_failed" : "data_load_failed",
4411
- message: i,
4412
- recoverable: !0,
4413
- cause: u
4414
- },
4415
- {
4416
- state: o.ready ? "ready" : o.state,
4417
- featureCount: o.featureCount
4418
- }
4419
- ), u;
4420
- }
4421
- }
4422
- async _importWithController(e, r) {
4423
- var s, l;
4424
- if (!this._controller) return [];
4425
- const o = (s = r.behavior) != null ? s : "replace", i = (l = r.fitToData) != null ? l : !1, n = this._controller;
4426
- return typeof n.importGeoJSON == "function" ? n.importGeoJSON(e, { behavior: o, fitToData: i }) : o === "add" ? n.addFeatures(e) : (await n.loadGeoJSON(e, i), []);
4427
- }
4428
- async _exportWithController(e) {
4429
- if (!this._controller)
4430
- return { type: "FeatureCollection", features: [] };
4431
- const r = this._controller;
4432
- return typeof r.exportGeoJSON == "function" ? r.exportGeoJSON(e) : r.getGeoJSON();
4433
- }
4434
- // Helpers
4435
- _currentConfig() {
4436
- return {
4437
- latitude: this._latitude,
4438
- longitude: this._longitude,
4439
- zoom: this._zoom,
4440
- minZoom: this._minZoom,
4441
- maxZoom: this._maxZoom,
4442
- tileUrl: this._tileUrl,
4443
- tileAttribution: this._tileAttribution,
4444
- readOnly: this._readOnly,
4445
- fitToDataOnLoad: !1,
4446
- logLevel: this._logLevel,
4447
- devOverlay: this._devOverlay,
4448
- polygonAllowIntersection: this._polygonAllowIntersection,
4449
- preferCanvas: this._preferCanvas,
4450
- useExternalLeaflet: this._useExternalLeaflet,
4451
- skipLeafletStyles: this._skipLeafletStyles
4452
- };
4453
- }
4454
- _applyThemeStyles() {
4455
- var o;
4456
- const e = (o = this._themeUrl) == null ? void 0 : o.trim();
4457
- if (e) {
4458
- if (!this._themeLinkEl) {
4459
- const i = document.createElement("link");
4460
- i.setAttribute("rel", "stylesheet"), i.setAttribute("data-geokit-theme-url", "true"), this._root.appendChild(i), this._themeLinkEl = i;
4461
- }
4462
- this._themeLinkEl.getAttribute("href") !== e && this._themeLinkEl.setAttribute("href", e);
4463
- } else this._themeLinkEl && (this._themeLinkEl.remove(), this._themeLinkEl = null);
4464
- const r = this._themeCss;
4465
- if (r.trim().length > 0) {
4466
- if (!this._themeStyleEl) {
4467
- const i = document.createElement("style");
4468
- i.setAttribute("data-geokit-theme-css", "true"), this._root.appendChild(i), this._themeStyleEl = i;
4469
- }
4470
- this._themeStyleEl.textContent !== r && (this._themeStyleEl.textContent = r);
4471
- } else this._themeStyleEl && (this._themeStyleEl.remove(), this._themeStyleEl = null);
4472
- }
4473
- _emitToolTriggerResult(e) {
4474
- this.dispatchEvent(
4475
- new CustomEvent(
4476
- e.handled ? "leaflet-geokit:tool-triggered" : "leaflet-geokit:tool-trigger-failed",
4477
- {
4478
- bubbles: !0,
4479
- composed: !0,
4480
- detail: e
4481
- }
4482
- )
4483
- );
4484
- }
4485
- _syncStatusFromController(e) {
4486
- const r = this._controller;
4487
- return !r || typeof r.getGeoJSON != "function" ? (this._setStatus({
4488
- state: e.state,
4489
- ready: e.ready,
4490
- busy: e.busy,
4491
- featureCount: this._status.featureCount,
4492
- lastEvent: e.lastEvent,
4493
- lastError: e.clearLastError ? null : void 0
4494
- }), Promise.resolve()) : r.getGeoJSON().then((o) => {
4495
- this._setStatus({
4496
- state: e.state,
4497
- ready: e.ready,
4498
- busy: e.busy,
4499
- featureCount: o.features.length,
4500
- lastEvent: e.lastEvent,
4501
- lastError: e.clearLastError ? null : void 0
4502
- });
4503
- }).catch(() => {
4504
- this._setStatus({
4505
- state: e.state,
4506
- ready: e.ready,
4507
- busy: e.busy,
4508
- lastEvent: e.lastEvent,
4509
- lastError: e.clearLastError ? null : void 0
4510
- });
4511
- });
4512
- }
4513
- _emitError(e, r) {
4514
- var i;
4515
- const o = {
4516
- ...e,
4517
- timestamp: Date.now()
4518
- };
4519
- return this.dispatchEvent(
4520
- new CustomEvent(L.Error, { detail: o })
4521
- ), this._emitDiagnostic(
4522
- {
4523
- code: o.code,
4524
- message: o.message,
4525
- recoverable: o.recoverable,
4526
- severity: o.recoverable ? "warn" : "error",
4527
- cause: o.cause,
4528
- timestamp: o.timestamp
4529
- },
4530
- {
4531
- state: r.state,
4532
- featureCount: r.featureCount,
4533
- lastEvent: (i = r.lastEvent) != null ? i : L.Error
4534
- }
4535
- ), o;
4536
- }
4537
- _emitDiagnostic(e, r) {
4538
- var i, n;
4539
- const o = {
4540
- ...e,
4541
- state: r.state
4542
- };
4543
- return this.dispatchEvent(
4544
- new CustomEvent(q.Diagnostic, { detail: o })
4545
- ), this._setStatus({
4546
- state: r.state,
4547
- ready: r.state === "ready",
4548
- busy: r.state === "initializing" || r.state === "loading",
4549
- featureCount: (i = r.featureCount) != null ? i : this._status.featureCount,
4550
- lastEvent: (n = r.lastEvent) != null ? n : q.Diagnostic,
4551
- lastError: {
4552
- code: o.code,
4553
- message: o.message,
4554
- recoverable: o.recoverable,
4555
- timestamp: o.timestamp
4556
- }
4557
- }), o;
4558
- }
4559
- _setStatus(e) {
4560
- const r = {
4561
- ...this._status,
4562
- ...e,
4563
- lastError: e.lastError === null ? void 0 : e.lastError !== void 0 ? { ...e.lastError } : this._status.lastError ? { ...this._status.lastError } : void 0,
4564
- timestamp: Date.now()
4565
- };
4566
- this._status = r, this.dispatchEvent(
4567
- new CustomEvent(q.Status, {
4568
- detail: this._cloneStatus(r)
4569
- })
4570
- );
4571
- }
4572
- _cloneStatus(e) {
4573
- return {
4574
- ...e,
4575
- lastError: e.lastError ? { ...e.lastError } : void 0
4576
- };
4577
- }
4578
- _syncApiKeyFromAttributes() {
4579
- const e = this._normalizeText(this.getAttribute("api-key")), r = this._normalizeText(this.getAttribute("here-api-key"));
4580
- this._apiKey = e != null ? e : r;
4581
- }
4582
- _normalizeText(e, r) {
4583
- if (typeof e != "string") return;
4584
- const o = e.trim();
4585
- if (o)
4586
- return r != null && r.lowercase ? o.toLowerCase() : o;
4587
- }
4588
- _resolveTileProviderErrorCode(e) {
4589
- return e instanceof Error && e.message.toLowerCase().includes("unknown tile provider") ? "unknown_provider" : "tile_load_failed";
4590
- }
4591
- _resolveHereTileLayerErrorCode(e) {
4592
- const r = e.toLowerCase();
4593
- return r.includes("permission") || r.includes("forbidden") || r.includes("403") || r.includes("unauthorized") || r.includes("not authorized") || r.includes("not authorised") || r.includes("access denied") ? "permission_denied" : "invalid_api_key";
4594
- }
4595
- _describeTileLayerError(e, r) {
4596
- if (e && typeof e == "object" && "error" in e && e.error instanceof Error)
4597
- return e.error.message;
4598
- if (e instanceof Error && e.message)
4599
- return e.message;
4600
- if (e && typeof e == "object" && "message" in e && typeof e.message == "string") {
4601
- const o = e.message.trim();
4602
- if (o.length > 0)
4603
- return o;
4604
- }
4605
- return r === "here" ? `Failed to load HERE tiles; verify API key, project permissions, and allowed localhost origin/referrer.${this._tileStyle === "satellite.day" ? " If satellite.day fails, try lite.day." : ""}` : "Failed to load tile layer";
4606
- }
4607
- _reflect(e, r) {
4608
- r === null ? this.removeAttribute(e) : this.getAttribute(e) !== r && this.setAttribute(e, r);
4609
- }
4610
- _booleanReflect(e, r) {
4611
- r ? this.hasAttribute(e) || this.setAttribute(e, "") : this.hasAttribute(e) && this.removeAttribute(e);
4612
- }
4613
- _coerceNumber(e, r) {
4614
- if (e == null) return r != null ? r : NaN;
4615
- const o = Number(e);
4616
- return Number.isFinite(o) ? o : r != null ? r : NaN;
4617
- }
4618
- }
4619
- const ke = "leaflet-geokit";
4620
- customElements.get(ke) || customElements.define(ke, Ue);
4621
- const Ee = "leaflet-draw-map";
4622
- if (!customElements.get(Ee)) {
4623
- class a extends Ue {
4624
- }
4625
- customElements.define(Ee, a);
4626
- }
4627
- export {
4628
- L as DrawEvent,
4629
- q as GeoKitEvent,
4630
- Ue as LeafletDrawMapElement
4631
- };
4632
- //# sourceMappingURL=index-BMfJn-mD.js.map