draw-libre 0.3.2 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +19 -53
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
# DrawLibre
|
|
4
4
|
|
|
5
|
+
> Early supporter? Your ⭐ makes a difference! ❤️
|
|
6
|
+
|
|
5
7
|
## Features
|
|
6
8
|
|
|
9
|
+
- Undo/redo
|
|
10
|
+
- Can break a closed geometry
|
|
7
11
|
- Draw linestrings (including closed ones) and polygons
|
|
8
12
|
- Compatible with maplibre-gl(v2-v5) and mapbox-gl(v1-v3) and all projections
|
|
9
13
|
- Customizable UI and controls
|
|
@@ -63,6 +67,7 @@ const draw = DrawLibre.getInstance({
|
|
|
63
67
|
size: "medium", // "large" || "small" - Controls size of the panel that appears after pressing a button
|
|
64
68
|
buttons: {
|
|
65
69
|
delete: { visible: true }, // Controls visibility of the delete all points button
|
|
70
|
+
redo: { visible: true }
|
|
66
71
|
save: {
|
|
67
72
|
clearOnSave: true, // Whether to clear all points after saving
|
|
68
73
|
visible: true, // Controls visibility of the save button
|
|
@@ -80,6 +85,7 @@ const draw = DrawLibre.getInstance({
|
|
|
80
85
|
polygon: "Polygon",
|
|
81
86
|
save: "Save",
|
|
82
87
|
undo: "Undo",
|
|
88
|
+
redo: "Redo",
|
|
83
89
|
},
|
|
84
90
|
layersPaint: {
|
|
85
91
|
// Customize layer styles here. Refer to MapLibre's layer specifications for options.
|
package/dist/index.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.
|
|
1
|
+
.undo{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='lucide lucide-undo-icon lucide-undo'%3E%3Cpath d='M3 7v6h6'/%3E%3Cpath d='M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13'/%3E%3C/svg%3E")}.redo{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='lucide lucide-redo-icon lucide-redo'%3E%3Cpath d='M21 7v6h-6'/%3E%3Cpath d='M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7'/%3E%3C/svg%3E")}.delete{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='64 64 896 896' focusable='false' data-icon='delete' fill='currentColor' aria-hidden='true'%3E%3Cpath d='M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z'%3E%3C/path%3E%3C/svg%3E")}.save{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='64 64 896 896' focusable='false' data-icon='check' fill='currentColor' aria-hidden='true'%3E%3Cpath d='M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z'%3E%3C/path%3E%3C/svg%3E")}.dashboard{display:flex;align-items:center;background-color:#fff;border-radius:4px}.dashboard-container{position:absolute;z-index:1000000;pointer-events:auto}.dashboard-container.hidden{opacity:0;pointer-events:none}.panel-button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:28px;outline:none;padding:0;width:28px}.panel-button:disabled{opacity:.25;cursor:not-allowed}.panel-button:hover{background-color:#0000000d}.icon{background-position:50%;background-repeat:no-repeat;display:block;height:18px}.panel-button:not(:last-child) .icon{border-right:1px solid #ddd}.panel-button-small{width:20px;height:20px}.panel-button-medium{width:24px;height:24px}.panel-button-large{width:28px;height:28px}.icon-small{height:14px}.icon-medium{height:16px}.icon-large{height:18px}.hide-panel{visibility:hidden}.popup-container{display:block;position:absolute;z-index:1000;pointer-events:none;top:0;left:0}.popup-text{display:inline-block;padding:4px 16px;background-color:#4d4d4d;border-radius:18px;color:#fff;font-size:14px}.popup-text-bottom{opacity:0;transform:translateY(16px);transition:all .2s ease-out;transition-delay:.25s}.popup-text-left{opacity:0;transform:translate(16px);transition:all .3s ease-out}.popup-text-active{transform:translate(0);opacity:1}.line{transform:rotate(44deg);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23' xmlns:cc='http://creativecommons.org/ns%23' xmlns:dc='http://purl.org/dc/elements/1.1/' fill='%23000000' width='10' height='16' viewBox='-3 0 0.22850401 0.63333199' version='1.1' id='svg1' xml:space='preserve'%3E%3Cdefs id='defs1'/%3E%3Ctitle id='title1'%3Eline-chart%3C/title%3E%3Cmetadata id='metadata1'%3E%3Crdf:RDF%3E%3Ccc:Work rdf:about=''%3E%3Cdc:title%3Eline-chart%3C/dc:title%3E%3C/cc:Work%3E%3C/rdf:RDF%3E%3C/metadata%3E%3Cg style='fill:none' id='g1' transform='matrix(0.04,0,0,0.04,-3.48332,-0.48336)'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='m 14.9997,12.084 c -1.6109,0 -2.9167,1.3058 -2.9167,2.9167 0,1.3212 0.8786,2.4373 2.0833,2.7958 v 4.4083 c -1.2047,0.3585 -2.0833,1.4746 -2.0833,2.7959 0,1.6108 1.3058,2.9166 2.9167,2.9166 1.3212,0 2.4373,-0.8785 2.7959,-2.0833 V 14.1673 C 17.437,12.9625 16.3209,12.084 14.9997,12.084 Z m -1.25,2.9167 c 0,-0.6904 0.5596,-1.25 1.25,-1.25 0.6903,0 1.25,0.5596 1.25,1.25 0,0.6903 -0.5597,1.25 -1.25,1.25 -0.6904,0 -1.25,-0.5597 -1.25,-1.25 z m 2.0833,7.2041 c 0.9407,0.2799 1.6826,1.0218 1.9626,1.9625 V 15.834 c -0.28,0.9407 -1.0219,1.6826 -1.9626,1.9625 z m -0.8333,1.5459 c -0.6904,0 -1.25,0.5596 -1.25,1.25 0,0.6903 0.5596,1.25 1.25,1.25 0.6903,0 1.25,-0.5597 1.25,-1.25 0,-0.6904 -0.5597,-1.25 -1.25,-1.25 z' fill='%2315181a' id='path1'/%3E%3C/g%3E%3C/svg%3E")}.polygon{background-image:url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M4.99967 2.08398C3.38884 2.08398 2.08301 3.38982 2.08301 5.00065C2.08301 6.32191 2.96155 7.43797 4.16634 7.79654L4.16634 12.2048C2.96155 12.5633 2.08301 13.6794 2.08301 15.0007C2.08301 16.6115 3.38884 17.9173 4.99967 17.9173C6.32093 17.9173 7.437 17.0388 7.79556 15.834H12.2038C12.5624 17.0388 13.6784 17.9173 14.9997 17.9173C16.6105 17.9173 17.9163 16.6115 17.9163 15.0007C17.9163 13.6794 17.0378 12.5633 15.833 12.2048V7.79653C17.0378 7.43797 17.9163 6.32191 17.9163 5.00065C17.9163 3.38982 16.6105 2.08398 14.9997 2.08398C13.6784 2.08398 12.5624 2.96253 12.2038 4.16732L7.79556 4.16732C7.437 2.96253 6.32093 2.08398 4.99967 2.08398ZM3.74967 5.00065C3.74967 4.31029 4.30932 3.75065 4.99967 3.75065C5.69003 3.75065 6.24967 4.31029 6.24967 5.00065C6.24967 5.69101 5.69003 6.25065 4.99967 6.25065C4.30932 6.25065 3.74967 5.69101 3.74967 5.00065ZM5.83301 12.2048C6.77375 12.4847 7.51558 13.2266 7.79556 14.1673L12.2038 14.1673C12.4838 13.2266 13.2256 12.4847 14.1663 12.2048L14.1663 7.79654C13.2256 7.51656 12.4838 6.77473 12.2038 5.83398L7.79556 5.83398C7.51558 6.77472 6.77375 7.51656 5.83301 7.79653L5.83301 12.2048ZM13.7497 5.00065C13.7497 4.31029 14.3093 3.75065 14.9997 3.75065C15.69 3.75065 16.2497 4.31029 16.2497 5.00065C16.2497 5.69101 15.69 6.25065 14.9997 6.25065C14.3093 6.25065 13.7497 5.69101 13.7497 5.00065ZM4.99967 13.7507C4.30932 13.7507 3.74967 14.3103 3.74967 15.0007C3.74967 15.691 4.30932 16.2507 4.99967 16.2507C5.69003 16.2507 6.24967 15.691 6.24967 15.0007C6.24967 14.3103 5.69003 13.7507 4.99967 13.7507ZM13.7497 15.0007C13.7497 14.3103 14.3093 13.7507 14.9997 13.7507C15.69 13.7507 16.2497 14.3103 16.2497 15.0007C16.2497 15.691 15.69 16.2507 14.9997 16.2507C14.3093 16.2507 13.7497 15.691 13.7497 15.0007Z' fill='%2315181A'/%3E%3C/svg%3E%0A")}.break{background-image:url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.16667 1.66602C4.6269 1.66602 5 2.03911 5 2.49935V5.83268H15V2.49935C15 2.03911 15.3731 1.66602 15.8333 1.66602C16.2936 1.66602 16.6667 2.03911 16.6667 2.49935V5.83268C16.6667 6.75316 15.9205 7.49935 15 7.49935H5C4.07953 7.49935 3.33333 6.75316 3.33333 5.83268V2.49935C3.33333 2.03911 3.70643 1.66602 4.16667 1.66602Z' fill='%2315181A'/%3E%3Cpath d='M4.16667 18.3327C4.6269 18.3327 5 17.9596 5 17.4993V14.166H15V17.4993C15 17.9596 15.3731 18.3327 15.8333 18.3327C16.2936 18.3327 16.6667 17.9596 16.6667 17.4993V14.166C16.6667 13.2455 15.9205 12.4993 15 12.4993H5C4.07953 12.4993 3.33333 13.2455 3.33333 14.166V17.4993C3.33333 17.9596 3.70643 18.3327 4.16667 18.3327Z' fill='%2315181A'/%3E%3Cpath d='M13.3333 9.16602H11.4583C10.9981 9.16602 10.625 9.53911 10.625 9.99935C10.625 10.4596 10.9981 10.8327 11.4583 10.8327H13.3333C13.7936 10.8327 14.1667 10.4596 14.1667 9.99935C14.1667 9.53911 13.7936 9.16602 13.3333 9.16602Z' fill='%2315181A'/%3E%3Cpath d='M8.54167 9.16602H6.66667C6.20643 9.16602 5.83333 9.53911 5.83333 9.99935C5.83333 10.4596 6.20643 10.8327 6.66667 10.8327H8.54167C9.0019 10.8327 9.375 10.4596 9.375 9.99935C9.375 9.53911 9.0019 9.16602 8.54167 9.16602Z' fill='%2315181A'/%3E%3Cpath d='M3.75 9.16601H2.08333C1.6231 9.16601 1.25 9.53911 1.25 9.99935C1.25 10.4596 1.6231 10.8327 2.08333 10.8327H3.75C4.21024 10.8327 4.58333 10.4596 4.58333 9.99935C4.58333 9.53911 4.21024 9.16601 3.75 9.16601Z' fill='%2315181A'/%3E%3Cpath d='M17.9167 9.16601H16.25C15.7898 9.16601 15.4167 9.53911 15.4167 9.99935C15.4167 10.4596 15.7898 10.8327 16.25 10.8327H17.9167C18.3769 10.8327 18.75 10.4596 18.75 9.99935C18.75 9.53911 18.3769 9.16601 17.9167 9.16601Z' fill='%2315181A'/%3E%3C/svg%3E%0A")}.control-button:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.maplibregl-ctrl-group button.control-button-active{background-color:#edeaea}.control-button:disabled{opacity:.25}.maplibregl-popup-tip,.mapboxgl-popup-tip{display:none!important}.maplibregl-popup-content,.mapboxgl-popup-content{padding:0!important}
|
|
2
2
|
/*# sourceMappingURL=index.css.map */
|
package/dist/index.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/panel/panel.css","../src/components/tooltip/tooltip.css","../src/components/side-control/control.css","../src/draw.css"],"sourcesContent":[".hide-panel {\n visibility: hidden;\n}\n\n.undo {\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='64 64 896 896' focusable='false' data-icon='undo' fill='currentColor' aria-hidden='true'%3E%3Cpath d='M511.4 124C290.5 124.3 112 303 112 523.9c0 128 60.2 242 153.8 315.2l-37.5 48c-4.1 5.3-.3 13 6.3 12.9l167-.8c5.2 0 9-4.9 7.7-9.9L369.8 727a8 8 0 00-14.1-3L315 776.1c-10.2-8-20-16.7-29.3-26a318.64 318.64 0 01-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 01-68.6 101.7c-7.5 7.5-15.3 14.5-23.4 21.2a7.93 7.93 0 00-1.2 11.1l39.4 50.5c2.8 3.5 7.9 4.1 11.4 1.3C854.5 760.8 912 649.1 912 523.9c0-221.1-179.4-400.2-400.6-399.9z'%3E%3C/path%3E%3C/svg%3E\");\n}\n\n.delete {\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='64 64 896 896' focusable='false' data-icon='delete' fill='currentColor' aria-hidden='true'%3E%3Cpath d='M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z'%3E%3C/path%3E%3C/svg%3E\");\n}\n\n.save {\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='64 64 896 896' focusable='false' data-icon='check' fill='currentColor' aria-hidden='true'%3E%3Cpath d='M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z'%3E%3C/path%3E%3C/svg%3E\");\n}\n\n.dashboard {\n display: flex;\n align-items: center;\n background-color: white;\n border-radius: 4px;\n}\n\n.panel-button {\n background-color: transparent;\n border: 0;\n box-sizing: border-box;\n cursor: pointer;\n display: block;\n height: 28px;\n outline: none;\n padding: 0;\n width: 28px;\n}\n\n.panel-button:hover {\n background-color: #0000000d;\n}\n\n.icon {\n background-position: 50%;\n background-repeat: no-repeat;\n display: block;\n height: 18px;\n}\n\n.panel-button:not(:last-child) .icon {\n border-right: 1px solid #ddd;\n}\n\n.panel-button-small {\n width: 20px;\n height: 20px;\n}\n\n.panel-button-medium {\n width: 24px;\n height: 24px;\n}\n.panel-button-large {\n width: 28px;\n height: 28px;\n}\n\n.icon-small {\n height: 14px;\n}\n\n.icon-medium {\n height: 16px;\n}\n\n.icon-large {\n height: 18px;\n}\n",".popup-container {\n display: block;\n position: absolute;\n z-index: 1000;\n top: 0;\n left: 0;\n}\n\n.popup-text {\n display: inline-block;\n padding: 4px 16px;\n background-color: #4d4d4d;\n border-radius: 18px;\n color: #fff;\n font-size: 14px;\n}\n\n.popup-text-bottom {\n opacity: 0;\n transform: translateY(16px);\n transition: all 0.2s ease-out;\n transition-delay: 0.25s;\n}\n\n.popup-text-left {\n opacity: 0;\n transform: translateX(16px);\n transition: all 0.3s ease-out;\n}\n\n.popup-text-active {\n transform: translate(0px);\n opacity: 1;\n}\n",".line {\n transform: rotate(44deg);\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23' xmlns:cc='http://creativecommons.org/ns%23' xmlns:dc='http://purl.org/dc/elements/1.1/' fill='%23000000' width='10' height='16' viewBox='-3 0 0.22850401 0.63333199' version='1.1' id='svg1' xml:space='preserve'%3E%3Cdefs id='defs1'/%3E%3Ctitle id='title1'%3Eline-chart%3C/title%3E%3Cmetadata id='metadata1'%3E%3Crdf:RDF%3E%3Ccc:Work rdf:about=''%3E%3Cdc:title%3Eline-chart%3C/dc:title%3E%3C/cc:Work%3E%3C/rdf:RDF%3E%3C/metadata%3E%3Cg style='fill:none' id='g1' transform='matrix(0.04,0,0,0.04,-3.48332,-0.48336)'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='m 14.9997,12.084 c -1.6109,0 -2.9167,1.3058 -2.9167,2.9167 0,1.3212 0.8786,2.4373 2.0833,2.7958 v 4.4083 c -1.2047,0.3585 -2.0833,1.4746 -2.0833,2.7959 0,1.6108 1.3058,2.9166 2.9167,2.9166 1.3212,0 2.4373,-0.8785 2.7959,-2.0833 V 14.1673 C 17.437,12.9625 16.3209,12.084 14.9997,12.084 Z m -1.25,2.9167 c 0,-0.6904 0.5596,-1.25 1.25,-1.25 0.6903,0 1.25,0.5596 1.25,1.25 0,0.6903 -0.5597,1.25 -1.25,1.25 -0.6904,0 -1.25,-0.5597 -1.25,-1.25 z m 2.0833,7.2041 c 0.9407,0.2799 1.6826,1.0218 1.9626,1.9625 V 15.834 c -0.28,0.9407 -1.0219,1.6826 -1.9626,1.9625 z m -0.8333,1.5459 c -0.6904,0 -1.25,0.5596 -1.25,1.25 0,0.6903 0.5596,1.25 1.25,1.25 0.6903,0 1.25,-0.5597 1.25,-1.25 0,-0.6904 -0.5597,-1.25 -1.25,-1.25 z' fill='%2315181a' id='path1'/%3E%3C/g%3E%3C/svg%3E\");\n}\n\n.polygon {\n background-image: url(\"data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M4.99967 2.08398C3.38884 2.08398 2.08301 3.38982 2.08301 5.00065C2.08301 6.32191 2.96155 7.43797 4.16634 7.79654L4.16634 12.2048C2.96155 12.5633 2.08301 13.6794 2.08301 15.0007C2.08301 16.6115 3.38884 17.9173 4.99967 17.9173C6.32093 17.9173 7.437 17.0388 7.79556 15.834H12.2038C12.5624 17.0388 13.6784 17.9173 14.9997 17.9173C16.6105 17.9173 17.9163 16.6115 17.9163 15.0007C17.9163 13.6794 17.0378 12.5633 15.833 12.2048V7.79653C17.0378 7.43797 17.9163 6.32191 17.9163 5.00065C17.9163 3.38982 16.6105 2.08398 14.9997 2.08398C13.6784 2.08398 12.5624 2.96253 12.2038 4.16732L7.79556 4.16732C7.437 2.96253 6.32093 2.08398 4.99967 2.08398ZM3.74967 5.00065C3.74967 4.31029 4.30932 3.75065 4.99967 3.75065C5.69003 3.75065 6.24967 4.31029 6.24967 5.00065C6.24967 5.69101 5.69003 6.25065 4.99967 6.25065C4.30932 6.25065 3.74967 5.69101 3.74967 5.00065ZM5.83301 12.2048C6.77375 12.4847 7.51558 13.2266 7.79556 14.1673L12.2038 14.1673C12.4838 13.2266 13.2256 12.4847 14.1663 12.2048L14.1663 7.79654C13.2256 7.51656 12.4838 6.77473 12.2038 5.83398L7.79556 5.83398C7.51558 6.77472 6.77375 7.51656 5.83301 7.79653L5.83301 12.2048ZM13.7497 5.00065C13.7497 4.31029 14.3093 3.75065 14.9997 3.75065C15.69 3.75065 16.2497 4.31029 16.2497 5.00065C16.2497 5.69101 15.69 6.25065 14.9997 6.25065C14.3093 6.25065 13.7497 5.69101 13.7497 5.00065ZM4.99967 13.7507C4.30932 13.7507 3.74967 14.3103 3.74967 15.0007C3.74967 15.691 4.30932 16.2507 4.99967 16.2507C5.69003 16.2507 6.24967 15.691 6.24967 15.0007C6.24967 14.3103 5.69003 13.7507 4.99967 13.7507ZM13.7497 15.0007C13.7497 14.3103 14.3093 13.7507 14.9997 13.7507C15.69 13.7507 16.2497 14.3103 16.2497 15.0007C16.2497 15.691 15.69 16.2507 14.9997 16.2507C14.3093 16.2507 13.7497 15.691 13.7497 15.0007Z' fill='%2315181A'/%3E%3C/svg%3E%0A\");\n}\n\n.break {\n background-image: url(\"data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.16667 1.66602C4.6269 1.66602 5 2.03911 5 2.49935V5.83268H15V2.49935C15 2.03911 15.3731 1.66602 15.8333 1.66602C16.2936 1.66602 16.6667 2.03911 16.6667 2.49935V5.83268C16.6667 6.75316 15.9205 7.49935 15 7.49935H5C4.07953 7.49935 3.33333 6.75316 3.33333 5.83268V2.49935C3.33333 2.03911 3.70643 1.66602 4.16667 1.66602Z' fill='%2315181A'/%3E%3Cpath d='M4.16667 18.3327C4.6269 18.3327 5 17.9596 5 17.4993V14.166H15V17.4993C15 17.9596 15.3731 18.3327 15.8333 18.3327C16.2936 18.3327 16.6667 17.9596 16.6667 17.4993V14.166C16.6667 13.2455 15.9205 12.4993 15 12.4993H5C4.07953 12.4993 3.33333 13.2455 3.33333 14.166V17.4993C3.33333 17.9596 3.70643 18.3327 4.16667 18.3327Z' fill='%2315181A'/%3E%3Cpath d='M13.3333 9.16602H11.4583C10.9981 9.16602 10.625 9.53911 10.625 9.99935C10.625 10.4596 10.9981 10.8327 11.4583 10.8327H13.3333C13.7936 10.8327 14.1667 10.4596 14.1667 9.99935C14.1667 9.53911 13.7936 9.16602 13.3333 9.16602Z' fill='%2315181A'/%3E%3Cpath d='M8.54167 9.16602H6.66667C6.20643 9.16602 5.83333 9.53911 5.83333 9.99935C5.83333 10.4596 6.20643 10.8327 6.66667 10.8327H8.54167C9.0019 10.8327 9.375 10.4596 9.375 9.99935C9.375 9.53911 9.0019 9.16602 8.54167 9.16602Z' fill='%2315181A'/%3E%3Cpath d='M3.75 9.16601H2.08333C1.6231 9.16601 1.25 9.53911 1.25 9.99935C1.25 10.4596 1.6231 10.8327 2.08333 10.8327H3.75C4.21024 10.8327 4.58333 10.4596 4.58333 9.99935C4.58333 9.53911 4.21024 9.16601 3.75 9.16601Z' fill='%2315181A'/%3E%3Cpath d='M17.9167 9.16601H16.25C15.7898 9.16601 15.4167 9.53911 15.4167 9.99935C15.4167 10.4596 15.7898 10.8327 16.25 10.8327H17.9167C18.3769 10.8327 18.75 10.4596 18.75 9.99935C18.75 9.53911 18.3769 9.16601 17.9167 9.16601Z' fill='%2315181A'/%3E%3C/svg%3E%0A\");\n}\n\n.control-button:first-child {\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n}\n\n/* otherwise if we just .control-button-active, then maplibre will have higher importance */\n.maplibregl-ctrl-group button.control-button-active {\n background-color: #edeaea;\n}\n\n.control-button:disabled {\n opacity: 0.25;\n}\n",".maplibregl-popup-tip,\n.mapboxgl-popup-tip {\n display: none !important;\n}\n\n.maplibregl-popup-content,\n.mapboxgl-popup-content {\n padding: 0 !important;\n}\n"],"mappings":"AAAA,CAAC,WACC,WAAY,MACd,CAEA,CAAC,KACC,iBAAkB,g3BACpB,CAEA,CAAC,OACC,iBAAkB,iiBACpB,CAEA,CAAC,KACC,iBAAkB,qYACpB,CAEA,CAAC,UACC,QAAS,KACT,YAAa,OACb,iBAAkB,KAnBpB,cAoBiB,GACjB,CAEA,CAAC,aACC,iBAAkB,YAClB,OAAQ,EACR,WAAY,WACZ,OAAQ,QACR,QAAS,MACT,OAAQ,KACR,QAAS,KA9BX,QA+BW,EACT,MAAO,IACT,CAEA,CAZC,YAYY,OACX,iBAAkB,SACpB,CAEA,CAAC,KACC,oBAAqB,IACrB,kBAAmB,UACnB,QAAS,MACT,OAAQ,IACV,CAEA,CAvBC,YAuBY,KAAK,aAAa,CAP9B,KAQC,aAAc,IAAI,MAAM,IAC1B,CAEA,CAAC,mBACC,MAAO,KACP,OAAQ,IACV,CAEA,CAAC,oBACC,MAAO,KACP,OAAQ,IACV,CACA,CAAC,mBACC,MAAO,KACP,OAAQ,IACV,CAEA,CAAC,WACC,OAAQ,IACV,CAEA,CAAC,YACC,OAAQ,IACV,CAEA,CAAC,WACC,OAAQ,IACV,CC1EA,CAAC,gBACC,QAAS,MACT,SAAU,SACV,QAAS,KACT,IAAK,EACL,KAAM,CACR,CAEA,CAAC,WACC,QAAS,aATX,QAUW,IAAI,KACb,iBAAkB,QAXpB,cAYiB,KACf,MAAO,KACP,UAAW,IACb,CAEA,CAAC,kBACC,QAAS,EACT,UAAW,WAAW,MACtB,WAAY,IAAI,IAAK,SACrB,iBAAkB,IACpB,CAEA,CAAC,gBACC,QAAS,EACT,UAAW,UAAW,MACtB,WAAY,IAAI,IAAK,QACvB,CAEA,CAAC,kBACC,UAAW,UAAU,GACrB,QAAS,CACX,CCjCA,CAAC,KACC,UAAW,OAAO,OAClB,iBAAkB,m9CACpB,CAEA,CAAC,QACC,iBAAkB,u5DACpB,CAEA,CAAC,MACC,iBAAkB,syDACpB,CAEA,CAAC,cAAc,aACb,uBAAwB,IACxB,wBAAyB,GAC3B,CAGA,CAAC,sBAAsB,MAAM,CAAC,sBAC5B,iBAAkB,OACpB,CAEA,CAVC,cAUc,UACb,QAAS,GACX,CCzBA,CAAC,qBACD,CAAC,mBACC,QAAS,cACX,CAEA,CAAC,yBACD,CAAC,uBAND,QAOW,WACX","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/components/panel/panel.css","../src/components/tooltip/tooltip.css","../src/components/side-control/control.css","../src/draw.css"],"sourcesContent":[".undo {\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='lucide lucide-undo-icon lucide-undo'%3E%3Cpath d='M3 7v6h6'/%3E%3Cpath d='M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13'/%3E%3C/svg%3E\");\n}\n\n.redo {\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='lucide lucide-redo-icon lucide-redo'%3E%3Cpath d='M21 7v6h-6'/%3E%3Cpath d='M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7'/%3E%3C/svg%3E\");\n}\n\n.delete {\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='64 64 896 896' focusable='false' data-icon='delete' fill='currentColor' aria-hidden='true'%3E%3Cpath d='M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z'%3E%3C/path%3E%3C/svg%3E\");\n}\n\n.save {\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='64 64 896 896' focusable='false' data-icon='check' fill='currentColor' aria-hidden='true'%3E%3Cpath d='M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z'%3E%3C/path%3E%3C/svg%3E\");\n}\n\n.dashboard {\n display: flex;\n align-items: center;\n background-color: white;\n border-radius: 4px;\n}\n\n.dashboard-container {\n position: absolute;\n z-index: 1000000;\n pointer-events: auto;\n}\n\n.dashboard-container.hidden {\n opacity: 0;\n pointer-events: none;\n}\n\n.panel-button {\n background-color: transparent;\n border: 0;\n box-sizing: border-box;\n cursor: pointer;\n display: block;\n height: 28px;\n outline: none;\n padding: 0;\n width: 28px;\n}\n\n.panel-button:disabled {\n opacity: 0.25;\n cursor: not-allowed;\n}\n\n.panel-button:hover {\n background-color: #0000000d;\n}\n\n.icon {\n background-position: 50%;\n background-repeat: no-repeat;\n display: block;\n height: 18px;\n}\n\n.panel-button:not(:last-child) .icon {\n border-right: 1px solid #ddd;\n}\n\n.panel-button-small {\n width: 20px;\n height: 20px;\n}\n\n.panel-button-medium {\n width: 24px;\n height: 24px;\n}\n.panel-button-large {\n width: 28px;\n height: 28px;\n}\n\n.icon-small {\n height: 14px;\n}\n\n.icon-medium {\n height: 16px;\n}\n\n.icon-large {\n height: 18px;\n}\n\n.hide-panel {\n visibility: hidden;\n}\n",".popup-container {\n display: block;\n position: absolute;\n z-index: 1000;\n pointer-events: none;\n top: 0;\n left: 0;\n}\n\n.popup-text {\n display: inline-block;\n padding: 4px 16px;\n background-color: #4d4d4d;\n border-radius: 18px;\n color: #fff;\n font-size: 14px;\n}\n\n.popup-text-bottom {\n opacity: 0;\n transform: translateY(16px);\n transition: all 0.2s ease-out;\n transition-delay: 0.25s;\n}\n\n.popup-text-left {\n opacity: 0;\n transform: translateX(16px);\n transition: all 0.3s ease-out;\n}\n\n.popup-text-active {\n transform: translate(0px);\n opacity: 1;\n}\n",".line {\n transform: rotate(44deg);\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23' xmlns:cc='http://creativecommons.org/ns%23' xmlns:dc='http://purl.org/dc/elements/1.1/' fill='%23000000' width='10' height='16' viewBox='-3 0 0.22850401 0.63333199' version='1.1' id='svg1' xml:space='preserve'%3E%3Cdefs id='defs1'/%3E%3Ctitle id='title1'%3Eline-chart%3C/title%3E%3Cmetadata id='metadata1'%3E%3Crdf:RDF%3E%3Ccc:Work rdf:about=''%3E%3Cdc:title%3Eline-chart%3C/dc:title%3E%3C/cc:Work%3E%3C/rdf:RDF%3E%3C/metadata%3E%3Cg style='fill:none' id='g1' transform='matrix(0.04,0,0,0.04,-3.48332,-0.48336)'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='m 14.9997,12.084 c -1.6109,0 -2.9167,1.3058 -2.9167,2.9167 0,1.3212 0.8786,2.4373 2.0833,2.7958 v 4.4083 c -1.2047,0.3585 -2.0833,1.4746 -2.0833,2.7959 0,1.6108 1.3058,2.9166 2.9167,2.9166 1.3212,0 2.4373,-0.8785 2.7959,-2.0833 V 14.1673 C 17.437,12.9625 16.3209,12.084 14.9997,12.084 Z m -1.25,2.9167 c 0,-0.6904 0.5596,-1.25 1.25,-1.25 0.6903,0 1.25,0.5596 1.25,1.25 0,0.6903 -0.5597,1.25 -1.25,1.25 -0.6904,0 -1.25,-0.5597 -1.25,-1.25 z m 2.0833,7.2041 c 0.9407,0.2799 1.6826,1.0218 1.9626,1.9625 V 15.834 c -0.28,0.9407 -1.0219,1.6826 -1.9626,1.9625 z m -0.8333,1.5459 c -0.6904,0 -1.25,0.5596 -1.25,1.25 0,0.6903 0.5596,1.25 1.25,1.25 0.6903,0 1.25,-0.5597 1.25,-1.25 0,-0.6904 -0.5597,-1.25 -1.25,-1.25 z' fill='%2315181a' id='path1'/%3E%3C/g%3E%3C/svg%3E\");\n}\n\n.polygon {\n background-image: url(\"data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M4.99967 2.08398C3.38884 2.08398 2.08301 3.38982 2.08301 5.00065C2.08301 6.32191 2.96155 7.43797 4.16634 7.79654L4.16634 12.2048C2.96155 12.5633 2.08301 13.6794 2.08301 15.0007C2.08301 16.6115 3.38884 17.9173 4.99967 17.9173C6.32093 17.9173 7.437 17.0388 7.79556 15.834H12.2038C12.5624 17.0388 13.6784 17.9173 14.9997 17.9173C16.6105 17.9173 17.9163 16.6115 17.9163 15.0007C17.9163 13.6794 17.0378 12.5633 15.833 12.2048V7.79653C17.0378 7.43797 17.9163 6.32191 17.9163 5.00065C17.9163 3.38982 16.6105 2.08398 14.9997 2.08398C13.6784 2.08398 12.5624 2.96253 12.2038 4.16732L7.79556 4.16732C7.437 2.96253 6.32093 2.08398 4.99967 2.08398ZM3.74967 5.00065C3.74967 4.31029 4.30932 3.75065 4.99967 3.75065C5.69003 3.75065 6.24967 4.31029 6.24967 5.00065C6.24967 5.69101 5.69003 6.25065 4.99967 6.25065C4.30932 6.25065 3.74967 5.69101 3.74967 5.00065ZM5.83301 12.2048C6.77375 12.4847 7.51558 13.2266 7.79556 14.1673L12.2038 14.1673C12.4838 13.2266 13.2256 12.4847 14.1663 12.2048L14.1663 7.79654C13.2256 7.51656 12.4838 6.77473 12.2038 5.83398L7.79556 5.83398C7.51558 6.77472 6.77375 7.51656 5.83301 7.79653L5.83301 12.2048ZM13.7497 5.00065C13.7497 4.31029 14.3093 3.75065 14.9997 3.75065C15.69 3.75065 16.2497 4.31029 16.2497 5.00065C16.2497 5.69101 15.69 6.25065 14.9997 6.25065C14.3093 6.25065 13.7497 5.69101 13.7497 5.00065ZM4.99967 13.7507C4.30932 13.7507 3.74967 14.3103 3.74967 15.0007C3.74967 15.691 4.30932 16.2507 4.99967 16.2507C5.69003 16.2507 6.24967 15.691 6.24967 15.0007C6.24967 14.3103 5.69003 13.7507 4.99967 13.7507ZM13.7497 15.0007C13.7497 14.3103 14.3093 13.7507 14.9997 13.7507C15.69 13.7507 16.2497 14.3103 16.2497 15.0007C16.2497 15.691 15.69 16.2507 14.9997 16.2507C14.3093 16.2507 13.7497 15.691 13.7497 15.0007Z' fill='%2315181A'/%3E%3C/svg%3E%0A\");\n}\n\n.break {\n background-image: url(\"data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.16667 1.66602C4.6269 1.66602 5 2.03911 5 2.49935V5.83268H15V2.49935C15 2.03911 15.3731 1.66602 15.8333 1.66602C16.2936 1.66602 16.6667 2.03911 16.6667 2.49935V5.83268C16.6667 6.75316 15.9205 7.49935 15 7.49935H5C4.07953 7.49935 3.33333 6.75316 3.33333 5.83268V2.49935C3.33333 2.03911 3.70643 1.66602 4.16667 1.66602Z' fill='%2315181A'/%3E%3Cpath d='M4.16667 18.3327C4.6269 18.3327 5 17.9596 5 17.4993V14.166H15V17.4993C15 17.9596 15.3731 18.3327 15.8333 18.3327C16.2936 18.3327 16.6667 17.9596 16.6667 17.4993V14.166C16.6667 13.2455 15.9205 12.4993 15 12.4993H5C4.07953 12.4993 3.33333 13.2455 3.33333 14.166V17.4993C3.33333 17.9596 3.70643 18.3327 4.16667 18.3327Z' fill='%2315181A'/%3E%3Cpath d='M13.3333 9.16602H11.4583C10.9981 9.16602 10.625 9.53911 10.625 9.99935C10.625 10.4596 10.9981 10.8327 11.4583 10.8327H13.3333C13.7936 10.8327 14.1667 10.4596 14.1667 9.99935C14.1667 9.53911 13.7936 9.16602 13.3333 9.16602Z' fill='%2315181A'/%3E%3Cpath d='M8.54167 9.16602H6.66667C6.20643 9.16602 5.83333 9.53911 5.83333 9.99935C5.83333 10.4596 6.20643 10.8327 6.66667 10.8327H8.54167C9.0019 10.8327 9.375 10.4596 9.375 9.99935C9.375 9.53911 9.0019 9.16602 8.54167 9.16602Z' fill='%2315181A'/%3E%3Cpath d='M3.75 9.16601H2.08333C1.6231 9.16601 1.25 9.53911 1.25 9.99935C1.25 10.4596 1.6231 10.8327 2.08333 10.8327H3.75C4.21024 10.8327 4.58333 10.4596 4.58333 9.99935C4.58333 9.53911 4.21024 9.16601 3.75 9.16601Z' fill='%2315181A'/%3E%3Cpath d='M17.9167 9.16601H16.25C15.7898 9.16601 15.4167 9.53911 15.4167 9.99935C15.4167 10.4596 15.7898 10.8327 16.25 10.8327H17.9167C18.3769 10.8327 18.75 10.4596 18.75 9.99935C18.75 9.53911 18.3769 9.16601 17.9167 9.16601Z' fill='%2315181A'/%3E%3C/svg%3E%0A\");\n}\n\n.control-button:first-child {\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n}\n\n/* otherwise if we just .control-button-active, then maplibre will have higher importance */\n.maplibregl-ctrl-group button.control-button-active {\n background-color: #edeaea;\n}\n\n.control-button:disabled {\n opacity: 0.25;\n}\n",".maplibregl-popup-tip,\n.mapboxgl-popup-tip {\n display: none !important;\n}\n\n.maplibregl-popup-content,\n.mapboxgl-popup-content {\n padding: 0 !important;\n}\n"],"mappings":"AAAA,CAAC,KACC,iBAAkB,mUACpB,CAEA,CAAC,KACC,iBAAkB,qUACpB,CAEA,CAAC,OACC,iBAAkB,iiBACpB,CAEA,CAAC,KACC,iBAAkB,qYACpB,CAEA,CAAC,UACC,QAAS,KACT,YAAa,OACb,iBAAkB,KAnBpB,cAoBiB,GACjB,CAEA,CAAC,oBACC,SAAU,SACV,QAAS,QACT,eAAgB,IAClB,CAEA,CANC,mBAMmB,CAAC,OACnB,QAAS,EACT,eAAgB,IAClB,CAEA,CAAC,aACC,iBAAkB,YAClB,OAAQ,EACR,WAAY,WACZ,OAAQ,QACR,QAAS,MACT,OAAQ,KACR,QAAS,KAzCX,QA0CW,EACT,MAAO,IACT,CAEA,CAZC,YAYY,UACX,QAAS,IACT,OAAQ,WACV,CAEA,CAjBC,YAiBY,OACX,iBAAkB,SACpB,CAEA,CAAC,KACC,oBAAqB,IACrB,kBAAmB,UACnB,QAAS,MACT,OAAQ,IACV,CAEA,CA5BC,YA4BY,KAAK,aAAa,CAP9B,KAQC,aAAc,IAAI,MAAM,IAC1B,CAEA,CAAC,mBACC,MAAO,KACP,OAAQ,IACV,CAEA,CAAC,oBACC,MAAO,KACP,OAAQ,IACV,CACA,CAAC,mBACC,MAAO,KACP,OAAQ,IACV,CAEA,CAAC,WACC,OAAQ,IACV,CAEA,CAAC,YACC,OAAQ,IACV,CAEA,CAAC,WACC,OAAQ,IACV,CAEA,CAAC,WACC,WAAY,MACd,CC9FA,CAAC,gBACC,QAAS,MACT,SAAU,SACV,QAAS,KACT,eAAgB,KAChB,IAAK,EACL,KAAM,CACR,CAEA,CAAC,WACC,QAAS,aAVX,QAWW,IAAI,KACb,iBAAkB,QAZpB,cAaiB,KACf,MAAO,KACP,UAAW,IACb,CAEA,CAAC,kBACC,QAAS,EACT,UAAW,WAAW,MACtB,WAAY,IAAI,IAAK,SACrB,iBAAkB,IACpB,CAEA,CAAC,gBACC,QAAS,EACT,UAAW,UAAW,MACtB,WAAY,IAAI,IAAK,QACvB,CAEA,CAAC,kBACC,UAAW,UAAU,GACrB,QAAS,CACX,CClCA,CAAC,KACC,UAAW,OAAO,OAClB,iBAAkB,m9CACpB,CAEA,CAAC,QACC,iBAAkB,u5DACpB,CAEA,CAAC,MACC,iBAAkB,syDACpB,CAEA,CAAC,cAAc,aACb,uBAAwB,IACxB,wBAAyB,GAC3B,CAGA,CAAC,sBAAsB,MAAM,CAAC,sBAC5B,iBAAkB,OACpB,CAEA,CAVC,cAUc,UACb,QAAS,GACX,CCzBA,CAAC,qBACD,CAAC,mBACC,QAAS,cACX,CAEA,CAAC,yBACD,CAAC,uBAND,QAOW,WACX","names":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,25 +1,9 @@
|
|
|
1
1
|
import { CircleLayerSpecification, LineLayerSpecification, FillLayerSpecification } from 'maplibre-gl';
|
|
2
2
|
import mapboxgl from 'mapbox-gl';
|
|
3
3
|
|
|
4
|
-
type
|
|
4
|
+
type UnifiedMap = maplibregl.Map & mapboxgl.Map;
|
|
5
5
|
type IControl = maplibregl.IControl & mapboxgl.IControl;
|
|
6
6
|
|
|
7
|
-
type Func<T> = (event: T) => any;
|
|
8
|
-
type ChangeEvent<T> = {
|
|
9
|
-
[K in keyof T]: {
|
|
10
|
-
type: K;
|
|
11
|
-
data: T[K];
|
|
12
|
-
};
|
|
13
|
-
}[keyof T];
|
|
14
|
-
declare class Observable<T> {
|
|
15
|
-
observers: Set<Func<T>>;
|
|
16
|
-
constructor();
|
|
17
|
-
addObserver(observer: Func<T>): void;
|
|
18
|
-
removeObserver(observer: Func<T>): void;
|
|
19
|
-
unsubscribe(): void;
|
|
20
|
-
notify(args: T): void;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
7
|
type Mode = "line" | "polygon" | null;
|
|
24
8
|
|
|
25
9
|
type AnyFunction = (...args: any[]) => any;
|
|
@@ -42,6 +26,7 @@ interface PanelImpl {
|
|
|
42
26
|
buttons?: {
|
|
43
27
|
delete?: Button;
|
|
44
28
|
undo?: Button;
|
|
29
|
+
redo?: Button;
|
|
45
30
|
save?: SaveButton;
|
|
46
31
|
};
|
|
47
32
|
}
|
|
@@ -75,6 +60,7 @@ interface Locale {
|
|
|
75
60
|
save?: string;
|
|
76
61
|
delete?: string;
|
|
77
62
|
undo?: string;
|
|
63
|
+
redo?: string;
|
|
78
64
|
line?: string;
|
|
79
65
|
polygon?: string;
|
|
80
66
|
break?: string;
|
|
@@ -109,36 +95,12 @@ type RequiredDrawOptions = DeepRequired<Omit<DrawOptions, "layersPaint">> & {
|
|
|
109
95
|
layersPaint: LayersPaint;
|
|
110
96
|
};
|
|
111
97
|
|
|
112
|
-
interface EventData {
|
|
113
|
-
STORE_MUTATED: {
|
|
114
|
-
head: ListNode | null;
|
|
115
|
-
tail: ListNode | null;
|
|
116
|
-
size: number;
|
|
117
|
-
};
|
|
118
|
-
STORE_DETACHED: null;
|
|
119
|
-
}
|
|
120
|
-
type StoreChangeEvent = ChangeEvent<EventData>;
|
|
121
|
-
|
|
122
98
|
declare class ListNode {
|
|
123
99
|
val: Step | null;
|
|
124
100
|
prev: ListNode | null;
|
|
125
101
|
next: ListNode | null;
|
|
126
102
|
constructor(val?: Step | null, next?: ListNode | null, prev?: ListNode | null);
|
|
127
103
|
}
|
|
128
|
-
declare class Store extends Observable<StoreChangeEvent> {
|
|
129
|
-
head: ListNode | null;
|
|
130
|
-
tail: ListNode | null;
|
|
131
|
-
size: number;
|
|
132
|
-
map: Map<StepId, ListNode>;
|
|
133
|
-
constructor(options?: RequiredDrawOptions);
|
|
134
|
-
push(step: Step): void;
|
|
135
|
-
insert(step: Step, current: ListNode): void;
|
|
136
|
-
findStepById(id: StepId): ListNode["val"] | null;
|
|
137
|
-
findNodeById(id: StepId): ListNode | null;
|
|
138
|
-
removeNodeById(id: StepId): ListNode | null;
|
|
139
|
-
reset(): void;
|
|
140
|
-
pingConsumers: () => void;
|
|
141
|
-
}
|
|
142
104
|
|
|
143
105
|
interface ModeEvent {
|
|
144
106
|
geometry: Mode;
|
|
@@ -150,27 +112,27 @@ interface UndoEvent {
|
|
|
150
112
|
id: Uuid;
|
|
151
113
|
total: number;
|
|
152
114
|
timestamp: number;
|
|
153
|
-
target:
|
|
115
|
+
target: UnifiedMap;
|
|
154
116
|
type: "mdl:undo";
|
|
155
117
|
}
|
|
156
118
|
interface RemoveAllEvent {
|
|
157
119
|
originalEvent: MouseEvent;
|
|
158
120
|
type: "mdl:removeall";
|
|
159
|
-
target:
|
|
121
|
+
target: UnifiedMap;
|
|
160
122
|
}
|
|
161
123
|
interface SaveEvent {
|
|
162
124
|
originalEvent: MouseEvent;
|
|
163
125
|
timestamp: number;
|
|
164
126
|
steps: Step[];
|
|
165
127
|
mode: ModeEvent;
|
|
166
|
-
target:
|
|
128
|
+
target: UnifiedMap;
|
|
167
129
|
type: "mdl:save";
|
|
168
130
|
}
|
|
169
131
|
interface PointRightClickRemoveEvent {
|
|
170
132
|
id: Uuid;
|
|
171
133
|
total: number;
|
|
172
134
|
timestamp: number;
|
|
173
|
-
target:
|
|
135
|
+
target: UnifiedMap;
|
|
174
136
|
coordinates: LatLng;
|
|
175
137
|
type: "mdl:rightclickremove";
|
|
176
138
|
}
|
|
@@ -178,7 +140,7 @@ interface PointAddEvent {
|
|
|
178
140
|
id: Uuid;
|
|
179
141
|
total: number;
|
|
180
142
|
timestamp: number;
|
|
181
|
-
target:
|
|
143
|
+
target: UnifiedMap;
|
|
182
144
|
coordinates: LatLng;
|
|
183
145
|
mode: ModeEvent;
|
|
184
146
|
type: "mdl:add";
|
|
@@ -189,7 +151,7 @@ interface PointMoveEvent {
|
|
|
189
151
|
id: Uuid;
|
|
190
152
|
total: number;
|
|
191
153
|
timestamp: number;
|
|
192
|
-
target:
|
|
154
|
+
target: UnifiedMap;
|
|
193
155
|
type: "mdl:moveend";
|
|
194
156
|
}
|
|
195
157
|
interface PointEnterEvent {
|
|
@@ -197,7 +159,7 @@ interface PointEnterEvent {
|
|
|
197
159
|
id: Uuid;
|
|
198
160
|
total: number;
|
|
199
161
|
timestamp: number;
|
|
200
|
-
target:
|
|
162
|
+
target: UnifiedMap;
|
|
201
163
|
type: "mdl:pointenter";
|
|
202
164
|
}
|
|
203
165
|
interface PointLeaveEvent {
|
|
@@ -205,12 +167,12 @@ interface PointLeaveEvent {
|
|
|
205
167
|
id: Uuid;
|
|
206
168
|
total: number;
|
|
207
169
|
timestamp: number;
|
|
208
|
-
target:
|
|
170
|
+
target: UnifiedMap;
|
|
209
171
|
type: "mdl:pointleave";
|
|
210
172
|
}
|
|
211
173
|
interface ModeChangeEvent {
|
|
212
174
|
mode: Mode | "break";
|
|
213
|
-
target:
|
|
175
|
+
target: UnifiedMap;
|
|
214
176
|
type: "mdl:modechanged";
|
|
215
177
|
}
|
|
216
178
|
|
|
@@ -235,7 +197,7 @@ declare class DrawLibre implements IControl {
|
|
|
235
197
|
* to the DOM: the map will insert the control's element into the DOM
|
|
236
198
|
* as necessary.
|
|
237
199
|
*/
|
|
238
|
-
onAdd: (map:
|
|
200
|
+
onAdd: (map: UnifiedMap) => HTMLElement;
|
|
239
201
|
/**
|
|
240
202
|
* DO NOT USE IMPLICITLY. PASS TO map.removeControl().
|
|
241
203
|
*
|
|
@@ -276,7 +238,11 @@ declare class DrawLibre implements IControl {
|
|
|
276
238
|
* @param type - The type of collection to return, either "array" or "ll" (linked list).
|
|
277
239
|
* @returns An array of all steps or the linked list of steps.
|
|
278
240
|
*/
|
|
279
|
-
getAllSteps: (type?: "array" | "linkedlist") =>
|
|
241
|
+
getAllSteps: (type?: "array" | "linkedlist") => Step[] | {
|
|
242
|
+
head: ListNode | null | undefined;
|
|
243
|
+
tail: ListNode | null | undefined;
|
|
244
|
+
size: number | undefined;
|
|
245
|
+
};
|
|
280
246
|
setOptions: (fn: (options: RequiredDrawOptions) => RequiredDrawOptions) => void;
|
|
281
247
|
/**
|
|
282
248
|
* Removes all steps.
|
|
@@ -284,4 +250,4 @@ declare class DrawLibre implements IControl {
|
|
|
284
250
|
removeAllSteps: () => void;
|
|
285
251
|
}
|
|
286
252
|
|
|
287
|
-
export { type ModeChangeEvent, type PointAddEvent, type PointEnterEvent, type PointLeaveEvent, type PointMoveEvent, type PointRightClickRemoveEvent, type RemoveAllEvent, type RequiredDrawOptions, type SaveEvent, type UndoEvent, DrawLibre as default };
|
|
253
|
+
export { type DrawOptions, type ModeChangeEvent, type PointAddEvent, type PointEnterEvent, type PointLeaveEvent, type PointMoveEvent, type PointRightClickRemoveEvent, type RemoveAllEvent, type RequiredDrawOptions, type SaveEvent, type UndoEvent, type UnifiedMap, DrawLibre as default };
|