draw-libre 0.2.2 → 0.2.4
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 +165 -165
- package/dist/index.css +1 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -0
- package/package.json +19 -8
- package/dist/index.d.mts +0 -246
- package/dist/index.global.js +0 -8
- package/dist/index.mjs +0 -3
package/README.md
CHANGED
|
@@ -1,165 +1,165 @@
|
|
|
1
|
-
<section >
|
|
2
|
-
<h1>DrawLibre</h1>
|
|
3
|
-
<img width=600 alt="GIF" src="https://i.giphy.com/media/v1.Y2lkPTc5MGI3NjExaDZscnowMHNndmtiZzcwb3Bvc2Y2b29qbHdndndndGE3Mzk5Z2Q0cSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/m6lig0ZCfL45FZQo7b/giphy.gif" />
|
|
4
|
-
</section>
|
|
5
|
-
|
|
6
|
-
## Features
|
|
7
|
-
|
|
8
|
-
- Draw linestrings (including closed ones) and polygons
|
|
9
|
-
- Compatible with maplibre-gl.js and mapbox-gl.js (currently supports Mercator projection only)
|
|
10
|
-
- Customizable UI and controls
|
|
11
|
-
- Event-driven architecture for easy integration
|
|
12
|
-
|
|
13
|
-
## Installation
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
npm install draw-libre
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Quick Start
|
|
20
|
-
|
|
21
|
-
```javascript
|
|
22
|
-
import maplibregl from "maplibre-gl";
|
|
23
|
-
import DrawLibre from "draw-libre";
|
|
24
|
-
import "draw-libre/dist/index.css";
|
|
25
|
-
|
|
26
|
-
const map = new maplibregl.Map({
|
|
27
|
-
container: ...,
|
|
28
|
-
style: ...,
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
const draw = DrawLibre.getInstance();
|
|
32
|
-
|
|
33
|
-
map.on("load", (event) => {
|
|
34
|
-
event.target.addControl(draw, "top-left");
|
|
35
|
-
});
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
## API
|
|
39
|
-
|
|
40
|
-
### Configuration
|
|
41
|
-
|
|
42
|
-
```javascript
|
|
43
|
-
const draw = DrawLibre.getInstance({
|
|
44
|
-
modes: {
|
|
45
|
-
initial: null, // default value; can be "line" or "polygon". Initial mode for drawing
|
|
46
|
-
breakGeometry: { visible: true }, // Controls visibility of the break geometry button
|
|
47
|
-
line: {
|
|
48
|
-
closeGeometry: true, // Enables/disables ability to close a LineString
|
|
49
|
-
visible: true, // Controls visibility of the line drawing button
|
|
50
|
-
},
|
|
51
|
-
polygon: { visible: true }, // Controls visibility of the polygon drawing button
|
|
52
|
-
},
|
|
53
|
-
panel: {
|
|
54
|
-
size: "medium", // "large" || "small" - Controls size of the panel that appears after pressing a button
|
|
55
|
-
buttons: {
|
|
56
|
-
delete: { visible: true }, // Controls visibility of the delete all points button
|
|
57
|
-
save: {
|
|
58
|
-
clearOnSave: true, // Whether to clear all points after saving
|
|
59
|
-
visible: true, // Controls visibility of the save button
|
|
60
|
-
},
|
|
61
|
-
undo: { visible: true }, // Controls visibility of the undo button
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
locale: {
|
|
65
|
-
// Customize button labels and tooltips
|
|
66
|
-
break: "Break",
|
|
67
|
-
closeLine: "Close",
|
|
68
|
-
createPolygon: "Create",
|
|
69
|
-
delete: "Delete",
|
|
70
|
-
line: "Line",
|
|
71
|
-
polygon: "Polygon",
|
|
72
|
-
save: "Save",
|
|
73
|
-
undo: "Undo",
|
|
74
|
-
},
|
|
75
|
-
layersPaint: {
|
|
76
|
-
// Customize layer styles here. Refer to MapLibre's layer specifications for options.
|
|
77
|
-
onLinePoint: {}, // CircleLayerSpecification["paint"]
|
|
78
|
-
firstPoint: {}, // CircleLayerSpecification["paint"]
|
|
79
|
-
points: {}, // CircleLayerSpecification["paint"]
|
|
80
|
-
line: {}, // LineLayerSpecification["paint"]
|
|
81
|
-
polygon: {}, // FillLayerSpecification["paint"]
|
|
82
|
-
breakLine: {}, // LineLayerSpecification["paint"]
|
|
83
|
-
},
|
|
84
|
-
dynamicLine: true, // Whether to draw a dynamic line following the cursor after placing the first point
|
|
85
|
-
initial: {
|
|
86
|
-
// Initialize with pre-existing GeoJSON data
|
|
87
|
-
closeGeometry: false, // Specify if the geometry is closed. Must be true if the geometry type is polygon.
|
|
88
|
-
generateId: true, // Whether to generate unique IDs for your geometries. Should be true if there are no IDs for each point in `steps`.
|
|
89
|
-
geometry: "line", // "line" | "polygon" - Specifies the type of geometry to initialize
|
|
90
|
-
steps: [
|
|
91
|
-
// Array of {id?: string | number, lat: number, lng: number}
|
|
92
|
-
// The first and the last point should be the same if the geometry is closed.
|
|
93
|
-
// The closeGeometry also should be true in this case.
|
|
94
|
-
{ lat: 40, lng: 30 },
|
|
95
|
-
{ lat: 31, lng: 21 },
|
|
96
|
-
{ lat: 31, lng: 21 },
|
|
97
|
-
],
|
|
98
|
-
},
|
|
99
|
-
});
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
### Events
|
|
103
|
-
|
|
104
|
-
Import events from the library:
|
|
105
|
-
|
|
106
|
-
```javascript
|
|
107
|
-
import DrawLibre, { type PointAddEvent } from "draw-libre";
|
|
108
|
-
|
|
109
|
-
map.on(mdl:add, (event: PointAddEvent) => {
|
|
110
|
-
console.log("Add event", event);
|
|
111
|
-
});
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
Available events:
|
|
115
|
-
|
|
116
|
-
- `mdl:doubleclick` (PointDoubleClickEvent)
|
|
117
|
-
- `mdl:pointenter` (PointEnterEvent)
|
|
118
|
-
- `mdl:pointleave` (PointLeaveEvent)
|
|
119
|
-
- `mdl:moveend` (PointMoveEvent)
|
|
120
|
-
- `mdl:add` (PointAddEvent)
|
|
121
|
-
- `mdl:undo` (UndoEvent)
|
|
122
|
-
- `mdl:removeall` (RemoveAllEvent)
|
|
123
|
-
- `mdl:save` (SaveEvent)
|
|
124
|
-
- `mdl:mdl:modechanged` (ModeChangeEvent)
|
|
125
|
-
|
|
126
|
-
### Methods
|
|
127
|
-
|
|
128
|
-
```javascript
|
|
129
|
-
const draw = DrawLibre.getInstance();
|
|
130
|
-
|
|
131
|
-
// Find a step by its ID
|
|
132
|
-
draw.findStepById(id: string)
|
|
133
|
-
|
|
134
|
-
// Get all steps, optionally specifying the return type
|
|
135
|
-
draw.getAllSteps(type?: "array" | "linkedlist")
|
|
136
|
-
|
|
137
|
-
// Set new steps. If ID is not provided, it will be generated automatically
|
|
138
|
-
draw.setSteps(steps: {lat: number; lng: number; id?: string}[])
|
|
139
|
-
|
|
140
|
-
// Remove all steps
|
|
141
|
-
draw.removeAllSteps()
|
|
142
|
-
|
|
143
|
-
// Update options. Note that options are immutable, so return a new object with spread values.
|
|
144
|
-
draw.setOptions((options: RequiredDrawOptions) => {
|
|
145
|
-
return {
|
|
146
|
-
...options,
|
|
147
|
-
locale: {
|
|
148
|
-
...options.locale,
|
|
149
|
-
save: "Save update",
|
|
150
|
-
},
|
|
151
|
-
modes: {
|
|
152
|
-
...options.modes,
|
|
153
|
-
line: {
|
|
154
|
-
...options.modes.line,
|
|
155
|
-
closeGeometry: false,
|
|
156
|
-
},
|
|
157
|
-
},
|
|
158
|
-
dynamicLine: false,
|
|
159
|
-
};
|
|
160
|
-
});
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
## License
|
|
164
|
-
|
|
165
|
-
This project is licensed under the [MIT License](LICENSE).
|
|
1
|
+
<section >
|
|
2
|
+
<h1>DrawLibre</h1>
|
|
3
|
+
<img width=600 alt="GIF" src="https://i.giphy.com/media/v1.Y2lkPTc5MGI3NjExaDZscnowMHNndmtiZzcwb3Bvc2Y2b29qbHdndndndGE3Mzk5Z2Q0cSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/m6lig0ZCfL45FZQo7b/giphy.gif" />
|
|
4
|
+
</section>
|
|
5
|
+
|
|
6
|
+
## Features
|
|
7
|
+
|
|
8
|
+
- Draw linestrings (including closed ones) and polygons
|
|
9
|
+
- Compatible with maplibre-gl.js and mapbox-gl.js (currently supports Mercator projection only)
|
|
10
|
+
- Customizable UI and controls
|
|
11
|
+
- Event-driven architecture for easy integration
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install draw-libre
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Quick Start
|
|
20
|
+
|
|
21
|
+
```javascript
|
|
22
|
+
import maplibregl from "maplibre-gl";
|
|
23
|
+
import DrawLibre from "draw-libre";
|
|
24
|
+
import "draw-libre/dist/index.css";
|
|
25
|
+
|
|
26
|
+
const map = new maplibregl.Map({
|
|
27
|
+
container: ...,
|
|
28
|
+
style: ...,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const draw = DrawLibre.getInstance();
|
|
32
|
+
|
|
33
|
+
map.on("load", (event) => {
|
|
34
|
+
event.target.addControl(draw, "top-left");
|
|
35
|
+
});
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## API
|
|
39
|
+
|
|
40
|
+
### Configuration
|
|
41
|
+
|
|
42
|
+
```javascript
|
|
43
|
+
const draw = DrawLibre.getInstance({
|
|
44
|
+
modes: {
|
|
45
|
+
initial: null, // default value; can be "line" or "polygon". Initial mode for drawing
|
|
46
|
+
breakGeometry: { visible: true }, // Controls visibility of the break geometry button
|
|
47
|
+
line: {
|
|
48
|
+
closeGeometry: true, // Enables/disables ability to close a LineString
|
|
49
|
+
visible: true, // Controls visibility of the line drawing button
|
|
50
|
+
},
|
|
51
|
+
polygon: { visible: true }, // Controls visibility of the polygon drawing button
|
|
52
|
+
},
|
|
53
|
+
panel: {
|
|
54
|
+
size: "medium", // "large" || "small" - Controls size of the panel that appears after pressing a button
|
|
55
|
+
buttons: {
|
|
56
|
+
delete: { visible: true }, // Controls visibility of the delete all points button
|
|
57
|
+
save: {
|
|
58
|
+
clearOnSave: true, // Whether to clear all points after saving
|
|
59
|
+
visible: true, // Controls visibility of the save button
|
|
60
|
+
},
|
|
61
|
+
undo: { visible: true }, // Controls visibility of the undo button
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
locale: {
|
|
65
|
+
// Customize button labels and tooltips
|
|
66
|
+
break: "Break",
|
|
67
|
+
closeLine: "Close",
|
|
68
|
+
createPolygon: "Create",
|
|
69
|
+
delete: "Delete",
|
|
70
|
+
line: "Line",
|
|
71
|
+
polygon: "Polygon",
|
|
72
|
+
save: "Save",
|
|
73
|
+
undo: "Undo",
|
|
74
|
+
},
|
|
75
|
+
layersPaint: {
|
|
76
|
+
// Customize layer styles here. Refer to MapLibre's layer specifications for options.
|
|
77
|
+
onLinePoint: {}, // CircleLayerSpecification["paint"]
|
|
78
|
+
firstPoint: {}, // CircleLayerSpecification["paint"]
|
|
79
|
+
points: {}, // CircleLayerSpecification["paint"]
|
|
80
|
+
line: {}, // LineLayerSpecification["paint"]
|
|
81
|
+
polygon: {}, // FillLayerSpecification["paint"]
|
|
82
|
+
breakLine: {}, // LineLayerSpecification["paint"]
|
|
83
|
+
},
|
|
84
|
+
dynamicLine: true, // Whether to draw a dynamic line following the cursor after placing the first point
|
|
85
|
+
initial: {
|
|
86
|
+
// Initialize with pre-existing GeoJSON data
|
|
87
|
+
closeGeometry: false, // Specify if the geometry is closed. Must be true if the geometry type is polygon.
|
|
88
|
+
generateId: true, // Whether to generate unique IDs for your geometries. Should be true if there are no IDs for each point in `steps`.
|
|
89
|
+
geometry: "line", // "line" | "polygon" - Specifies the type of geometry to initialize
|
|
90
|
+
steps: [
|
|
91
|
+
// Array of {id?: string | number, lat: number, lng: number}
|
|
92
|
+
// The first and the last point should be the same if the geometry is closed.
|
|
93
|
+
// The closeGeometry also should be true in this case.
|
|
94
|
+
{ lat: 40, lng: 30 },
|
|
95
|
+
{ lat: 31, lng: 21 },
|
|
96
|
+
{ lat: 31, lng: 21 },
|
|
97
|
+
],
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Events
|
|
103
|
+
|
|
104
|
+
Import events from the library:
|
|
105
|
+
|
|
106
|
+
```javascript
|
|
107
|
+
import DrawLibre, { type PointAddEvent } from "draw-libre";
|
|
108
|
+
|
|
109
|
+
map.on(mdl:add, (event: PointAddEvent) => {
|
|
110
|
+
console.log("Add event", event);
|
|
111
|
+
});
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Available events:
|
|
115
|
+
|
|
116
|
+
- `mdl:doubleclick` (PointDoubleClickEvent)
|
|
117
|
+
- `mdl:pointenter` (PointEnterEvent)
|
|
118
|
+
- `mdl:pointleave` (PointLeaveEvent)
|
|
119
|
+
- `mdl:moveend` (PointMoveEvent)
|
|
120
|
+
- `mdl:add` (PointAddEvent)
|
|
121
|
+
- `mdl:undo` (UndoEvent)
|
|
122
|
+
- `mdl:removeall` (RemoveAllEvent)
|
|
123
|
+
- `mdl:save` (SaveEvent)
|
|
124
|
+
- `mdl:mdl:modechanged` (ModeChangeEvent)
|
|
125
|
+
|
|
126
|
+
### Methods
|
|
127
|
+
|
|
128
|
+
```javascript
|
|
129
|
+
const draw = DrawLibre.getInstance();
|
|
130
|
+
|
|
131
|
+
// Find a step by its ID
|
|
132
|
+
draw.findStepById(id: string)
|
|
133
|
+
|
|
134
|
+
// Get all steps, optionally specifying the return type
|
|
135
|
+
draw.getAllSteps(type?: "array" | "linkedlist")
|
|
136
|
+
|
|
137
|
+
// Set new steps. If ID is not provided, it will be generated automatically
|
|
138
|
+
draw.setSteps(steps: {lat: number; lng: number; id?: string}[])
|
|
139
|
+
|
|
140
|
+
// Remove all steps
|
|
141
|
+
draw.removeAllSteps()
|
|
142
|
+
|
|
143
|
+
// Update options. Note that options are immutable, so return a new object with spread values.
|
|
144
|
+
draw.setOptions((options: RequiredDrawOptions) => {
|
|
145
|
+
return {
|
|
146
|
+
...options,
|
|
147
|
+
locale: {
|
|
148
|
+
...options.locale,
|
|
149
|
+
save: "Save update",
|
|
150
|
+
},
|
|
151
|
+
modes: {
|
|
152
|
+
...options.modes,
|
|
153
|
+
line: {
|
|
154
|
+
...options.modes.line,
|
|
155
|
+
closeGeometry: false,
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
dynamicLine: false,
|
|
159
|
+
};
|
|
160
|
+
});
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## License
|
|
164
|
+
|
|
165
|
+
This project is licensed under the [MIT License](LICENSE).
|
package/dist/index.css
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
1
|
.hide-panel{visibility:hidden}.undo{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")}.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}.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: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}.popup-container{display:block;position:absolute;z-index:1000;top:0;left:0;height:50px}.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{background-image:url("data:image/svg+xml,%3Csvg fill='%23000000' viewBox='-3 0 32 32' version='1.1' xmlns='http://www.w3.org/2000/svg'%3E%3Ctitle%3Eline-chart%3C/title%3E%3Cpath d='M23.36 9.32c-1.32 0-2.36 1.080-2.36 2.36 0 0.28 0.040 0.56 0.12 0.8l-4.8 4.080c-0.32-0.2-0.72-0.28-1.16-0.28s-0.88 0.12-1.24 0.36l-2.72-2.2c0.080-0.24 0.12-0.44 0.12-0.72 0-1.32-1.080-2.36-2.36-2.36-1.32 0-2.36 1.080-2.36 2.36 0 0.36 0.080 0.68 0.2 0.96l-3.44 3.44c-0.28-0.12-0.64-0.2-0.96-0.2-1.32 0-2.36 1.080-2.36 2.36 0 1.32 1.080 2.36 2.36 2.36s2.36-1.080 2.36-2.36c0-0.36-0.080-0.68-0.2-0.96l3.44-3.44c0.28 0.12 0.64 0.2 0.96 0.2 0.44 0 0.88-0.12 1.24-0.36l2.76 2.12c-0.080 0.24-0.080 0.44-0.080 0.72 0 1.32 1.080 2.36 2.36 2.36s2.36-1.080 2.36-2.36c0-0.28-0.040-0.56-0.12-0.8l4.8-4.080c0.32 0.2 0.72 0.28 1.16 0.28 1.32 0 2.36-1.080 2.36-2.36-0.040-1.2-1.16-2.28-2.44-2.28zM2.36 21c-0.36 0-0.68-0.32-0.68-0.68 0-0.4 0.32-0.68 0.68-0.68s0.68 0.32 0.68 0.68c0 0.36-0.28 0.68-0.68 0.68zM8.24 13.76c0-0.4 0.32-0.68 0.68-0.68s0.68 0.32 0.68 0.68-0.32 0.68-0.68 0.68c-0.36 0-0.68-0.32-0.68-0.68zM15.2 19.28c-0.4 0-0.68-0.32-0.68-0.68s0.32-0.68 0.68-0.68 0.68 0.32 0.68 0.68c-0.040 0.4-0.28 0.68-0.68 0.68zM23.36 12.36c-0.36 0-0.68-0.32-0.68-0.68 0-0.4 0.32-0.68 0.68-0.68 0.4 0 0.68 0.32 0.68 0.68 0 0.4-0.32 0.68-0.68 0.68z'%3E%3C/path%3E%3C/svg%3E")}.polygon{background-image:url("data:image/svg+xml,%3Csvg fill='%23000000' viewBox='0 0 256 256' id='Flat' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M233.46,97.46a36,36,0,0,0-50.92-50.92h0a36.18,36.18,0,0,0-4.12,5l-22.54-6.14A36,36,0,0,0,94.54,22.54h0a36.07,36.07,0,0,0-7.79,39.24L57.2,88.38a36.06,36.06,0,0,0-42.66,6.16h0a36,36,0,0,0,45.73,55.2l65.27,47.87a36,36,0,1,0,59.92-15.07,37.69,37.69,0,0,0-2.85-2.55L208,108A35.87,35.87,0,0,0,233.46,97.46Zm-93.73,80.8L74.46,130.39a36.19,36.19,0,0,0-1.21-24.17l29.55-26.6a35.92,35.92,0,0,0,46.78-11.11l22.54,6.14a35.88,35.88,0,0,0,10.42,22.81,37.69,37.69,0,0,0,2.85,2.55L160,172A35.89,35.89,0,0,0,139.73,178.26ZM216.49,63.51a12,12,0,1,1-17,0h0A12,12,0,0,1,216.49,63.51Zm-105-24a12,12,0,1,1,0,17,12,12,0,0,1,0-17Zm-80,89a12,12,0,0,1,0-17h0a12,12,0,1,1,0,17Zm137,88a12,12,0,0,1-17-17h0a12,12,0,0,1,17,17Z'/%3E%3C/svg%3E")}.break{background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7.68377 0.0513439C8.20771 -0.123304 8.77403 0.159856 8.94868 0.683799L9.94868 3.6838C10.1233 4.20774 9.84017 4.77406 9.31622 4.94871C8.79228 5.12336 8.22596 4.8402 8.05131 4.31625L7.05131 1.31625C6.87667 0.792312 7.15983 0.225992 7.68377 0.0513439Z' fill='%230F0F0F'/%3E%3Cpath d='M20.8596 9.54591L16.9706 13.435C16.58 13.8255 15.9469 13.8255 15.5563 13.435C15.1658 13.0445 15.1658 12.4113 15.5563 12.0208L19.4454 8.1317C20.4217 7.15539 20.4217 5.57247 19.4454 4.59616C18.4691 3.61985 16.8862 3.61985 15.9099 4.59616L12.0208 8.48525C11.6303 8.87578 10.9971 8.87578 10.6066 8.48525C10.2161 8.09473 10.2161 7.46156 10.6066 7.07104L14.4957 3.18195C16.253 1.42459 19.1023 1.42459 20.8596 3.18195C22.617 4.93931 22.617 7.78855 20.8596 9.54591Z' fill='%230F0F0F'/%3E%3Cpath d='M3.18198 14.4957L7.07106 10.6066C7.46159 10.216 8.09475 10.216 8.48528 10.6066C8.8758 10.9971 8.8758 11.6303 8.48528 12.0208L4.59619 15.9099C3.61988 16.8862 3.61988 18.4691 4.59619 19.4454C5.5725 20.4217 7.15541 20.4217 8.13172 19.4454L12.0208 15.5563C12.4113 15.1658 13.0445 15.1658 13.435 15.5563C13.8256 15.9468 13.8256 16.58 13.435 16.9705L9.54594 20.8596C7.78858 22.617 4.93934 22.617 3.18198 20.8596C1.42462 19.1023 1.42462 16.253 3.18198 14.4957Z' fill='%230F0F0F'/%3E%3Cpath d='M2.29289 2.29292C2.68341 1.9024 3.31658 1.9024 3.7071 2.29292L6.7071 5.29292C7.09763 5.68344 7.09763 6.31661 6.7071 6.70713C6.31658 7.09766 5.68341 7.09766 5.29289 6.70713L2.29289 3.70713C1.90237 3.31661 1.90237 2.68344 2.29289 2.29292Z' fill='%230F0F0F'/%3E%3Cpath d='M20.2929 21.7071C20.6834 22.0977 21.3166 22.0977 21.7071 21.7071C22.0976 21.3166 22.0976 20.6834 21.7071 20.2929L18.7071 17.2929C18.3166 16.9024 17.6834 16.9024 17.2929 17.2929C16.9024 17.6834 16.9024 18.3166 17.2929 18.7071L20.2929 21.7071Z' fill='%230F0F0F'/%3E%3Cpath d='M15.0513 23.3163C15.226 23.8402 15.7923 24.1234 16.3162 23.9487C16.8402 23.7741 17.1233 23.2077 16.9487 22.6838L15.9487 19.6838C15.774 19.1599 15.2077 18.8767 14.6838 19.0513C14.1598 19.226 13.8767 19.7923 14.0513 20.3163L15.0513 23.3163Z' fill='%230F0F0F'/%3E%3Cpath d='M0.0513134 7.6838C-0.123334 8.20774 0.159826 8.77406 0.683769 8.94871L3.68377 9.94871C4.20771 10.1234 4.77403 9.8402 4.94868 9.31625C5.12333 8.79231 4.84017 8.22599 4.31622 8.05134L1.31622 7.05134C0.792281 6.8767 0.225961 7.15986 0.0513134 7.6838Z' fill='%230F0F0F'/%3E%3Cpath d='M23.3162 15.0513C23.8402 15.226 24.1233 15.7923 23.9487 16.3163C23.774 16.8402 23.2077 17.1234 22.6838 16.9487L19.6838 15.9487C19.1598 15.7741 18.8767 15.2077 19.0513 14.6838C19.226 14.1599 19.7923 13.8767 20.3162 14.0513L23.3162 15.0513Z' fill='%230F0F0F'/%3E%3C/svg%3E")}.control-button:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.control-button-active{background-color:#f0f0f0!important}.control-button:disabled{opacity:.25}.maplibregl-popup-tip,.mapboxgl-popup-tip{display:none!important}.maplibregl-popup-content,.mapboxgl-popup-content{padding:0!important}
|
|
2
|
+
/*# sourceMappingURL=index.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/last-point-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}\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 height: 50px;\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 background-image: url(\"data:image/svg+xml,%3Csvg fill='%23000000' viewBox='-3 0 32 32' version='1.1' xmlns='http://www.w3.org/2000/svg'%3E%3Ctitle%3Eline-chart%3C/title%3E%3Cpath d='M23.36 9.32c-1.32 0-2.36 1.080-2.36 2.36 0 0.28 0.040 0.56 0.12 0.8l-4.8 4.080c-0.32-0.2-0.72-0.28-1.16-0.28s-0.88 0.12-1.24 0.36l-2.72-2.2c0.080-0.24 0.12-0.44 0.12-0.72 0-1.32-1.080-2.36-2.36-2.36-1.32 0-2.36 1.080-2.36 2.36 0 0.36 0.080 0.68 0.2 0.96l-3.44 3.44c-0.28-0.12-0.64-0.2-0.96-0.2-1.32 0-2.36 1.080-2.36 2.36 0 1.32 1.080 2.36 2.36 2.36s2.36-1.080 2.36-2.36c0-0.36-0.080-0.68-0.2-0.96l3.44-3.44c0.28 0.12 0.64 0.2 0.96 0.2 0.44 0 0.88-0.12 1.24-0.36l2.76 2.12c-0.080 0.24-0.080 0.44-0.080 0.72 0 1.32 1.080 2.36 2.36 2.36s2.36-1.080 2.36-2.36c0-0.28-0.040-0.56-0.12-0.8l4.8-4.080c0.32 0.2 0.72 0.28 1.16 0.28 1.32 0 2.36-1.080 2.36-2.36-0.040-1.2-1.16-2.28-2.44-2.28zM2.36 21c-0.36 0-0.68-0.32-0.68-0.68 0-0.4 0.32-0.68 0.68-0.68s0.68 0.32 0.68 0.68c0 0.36-0.28 0.68-0.68 0.68zM8.24 13.76c0-0.4 0.32-0.68 0.68-0.68s0.68 0.32 0.68 0.68-0.32 0.68-0.68 0.68c-0.36 0-0.68-0.32-0.68-0.68zM15.2 19.28c-0.4 0-0.68-0.32-0.68-0.68s0.32-0.68 0.68-0.68 0.68 0.32 0.68 0.68c-0.040 0.4-0.28 0.68-0.68 0.68zM23.36 12.36c-0.36 0-0.68-0.32-0.68-0.68 0-0.4 0.32-0.68 0.68-0.68 0.4 0 0.68 0.32 0.68 0.68 0 0.4-0.32 0.68-0.68 0.68z'%3E%3C/path%3E%3C/svg%3E\");\n}\n\n.polygon {\n background-image: url(\"data:image/svg+xml,%3Csvg fill='%23000000' viewBox='0 0 256 256' id='Flat' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M233.46,97.46a36,36,0,0,0-50.92-50.92h0a36.18,36.18,0,0,0-4.12,5l-22.54-6.14A36,36,0,0,0,94.54,22.54h0a36.07,36.07,0,0,0-7.79,39.24L57.2,88.38a36.06,36.06,0,0,0-42.66,6.16h0a36,36,0,0,0,45.73,55.2l65.27,47.87a36,36,0,1,0,59.92-15.07,37.69,37.69,0,0,0-2.85-2.55L208,108A35.87,35.87,0,0,0,233.46,97.46Zm-93.73,80.8L74.46,130.39a36.19,36.19,0,0,0-1.21-24.17l29.55-26.6a35.92,35.92,0,0,0,46.78-11.11l22.54,6.14a35.88,35.88,0,0,0,10.42,22.81,37.69,37.69,0,0,0,2.85,2.55L160,172A35.89,35.89,0,0,0,139.73,178.26ZM216.49,63.51a12,12,0,1,1-17,0h0A12,12,0,0,1,216.49,63.51Zm-105-24a12,12,0,1,1,0,17,12,12,0,0,1,0-17Zm-80,89a12,12,0,0,1,0-17h0a12,12,0,1,1,0,17Zm137,88a12,12,0,0,1-17-17h0a12,12,0,0,1,17,17Z'/%3E%3C/svg%3E\");\n}\n\n.break {\n background-image: url(\"data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7.68377 0.0513439C8.20771 -0.123304 8.77403 0.159856 8.94868 0.683799L9.94868 3.6838C10.1233 4.20774 9.84017 4.77406 9.31622 4.94871C8.79228 5.12336 8.22596 4.8402 8.05131 4.31625L7.05131 1.31625C6.87667 0.792312 7.15983 0.225992 7.68377 0.0513439Z' fill='%230F0F0F'/%3E%3Cpath d='M20.8596 9.54591L16.9706 13.435C16.58 13.8255 15.9469 13.8255 15.5563 13.435C15.1658 13.0445 15.1658 12.4113 15.5563 12.0208L19.4454 8.1317C20.4217 7.15539 20.4217 5.57247 19.4454 4.59616C18.4691 3.61985 16.8862 3.61985 15.9099 4.59616L12.0208 8.48525C11.6303 8.87578 10.9971 8.87578 10.6066 8.48525C10.2161 8.09473 10.2161 7.46156 10.6066 7.07104L14.4957 3.18195C16.253 1.42459 19.1023 1.42459 20.8596 3.18195C22.617 4.93931 22.617 7.78855 20.8596 9.54591Z' fill='%230F0F0F'/%3E%3Cpath d='M3.18198 14.4957L7.07106 10.6066C7.46159 10.216 8.09475 10.216 8.48528 10.6066C8.8758 10.9971 8.8758 11.6303 8.48528 12.0208L4.59619 15.9099C3.61988 16.8862 3.61988 18.4691 4.59619 19.4454C5.5725 20.4217 7.15541 20.4217 8.13172 19.4454L12.0208 15.5563C12.4113 15.1658 13.0445 15.1658 13.435 15.5563C13.8256 15.9468 13.8256 16.58 13.435 16.9705L9.54594 20.8596C7.78858 22.617 4.93934 22.617 3.18198 20.8596C1.42462 19.1023 1.42462 16.253 3.18198 14.4957Z' fill='%230F0F0F'/%3E%3Cpath d='M2.29289 2.29292C2.68341 1.9024 3.31658 1.9024 3.7071 2.29292L6.7071 5.29292C7.09763 5.68344 7.09763 6.31661 6.7071 6.70713C6.31658 7.09766 5.68341 7.09766 5.29289 6.70713L2.29289 3.70713C1.90237 3.31661 1.90237 2.68344 2.29289 2.29292Z' fill='%230F0F0F'/%3E%3Cpath d='M20.2929 21.7071C20.6834 22.0977 21.3166 22.0977 21.7071 21.7071C22.0976 21.3166 22.0976 20.6834 21.7071 20.2929L18.7071 17.2929C18.3166 16.9024 17.6834 16.9024 17.2929 17.2929C16.9024 17.6834 16.9024 18.3166 17.2929 18.7071L20.2929 21.7071Z' fill='%230F0F0F'/%3E%3Cpath d='M15.0513 23.3163C15.226 23.8402 15.7923 24.1234 16.3162 23.9487C16.8402 23.7741 17.1233 23.2077 16.9487 22.6838L15.9487 19.6838C15.774 19.1599 15.2077 18.8767 14.6838 19.0513C14.1598 19.226 13.8767 19.7923 14.0513 20.3163L15.0513 23.3163Z' fill='%230F0F0F'/%3E%3Cpath d='M0.0513134 7.6838C-0.123334 8.20774 0.159826 8.77406 0.683769 8.94871L3.68377 9.94871C4.20771 10.1234 4.77403 9.8402 4.94868 9.31625C5.12333 8.79231 4.84017 8.22599 4.31622 8.05134L1.31622 7.05134C0.792281 6.8767 0.225961 7.15986 0.0513134 7.6838Z' fill='%230F0F0F'/%3E%3Cpath d='M23.3162 15.0513C23.8402 15.226 24.1233 15.7923 23.9487 16.3163C23.774 16.8402 23.2077 17.1234 22.6838 16.9487L19.6838 15.9487C19.1598 15.7741 18.8767 15.2077 19.0513 14.6838C19.226 14.1599 19.7923 13.8767 20.3162 14.0513L23.3162 15.0513Z' fill='%230F0F0F'/%3E%3C/svg%3E\");\n}\n\n.control-button:first-child {\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n}\n\n.control-button-active {\n background-color: #f0f0f0 !important;\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,MACf,CAEA,CAAC,aACC,iBAAkB,YAClB,OAAQ,EACR,WAAY,WACZ,OAAQ,QACR,QAAS,MACT,OAAQ,KACR,QAAS,KA5BX,QA6BW,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,CCxEA,CAAC,gBACC,QAAS,MACT,SAAU,SACV,QAAS,KACT,IAAK,EACL,KAAM,EACN,OAAQ,IACV,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,iBAAkB,oyCACpB,CAEA,CAAC,QACC,iBAAkB,00BACpB,CAEA,CAAC,MACC,iBAAkB,grFACpB,CAEA,CAAC,cAAc,aACb,uBAAwB,IACxB,wBAAyB,GAC3B,CAEA,CAAC,sBACC,iBAAkB,iBACpB,CAEA,CATC,cASc,UACb,QAAS,GACX,CCvBA,CAAC,qBACD,CAAC,mBACC,QAAS,cACX,CAEA,CAAC,yBACD,CAAC,uBAND,QAOW,WACX","names":[]}
|