leaflet-polydraw 0.8.5

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 (59) hide show
  1. package/LICENCE +21 -0
  2. package/README.md +1006 -0
  3. package/dist/icons/icon-activate.svg +1 -0
  4. package/dist/icons/icon-add-elbow.svg +128 -0
  5. package/dist/icons/icon-bbox.svg +47 -0
  6. package/dist/icons/icon-bezier.svg +132 -0
  7. package/dist/icons/icon-draw.svg +1 -0
  8. package/dist/icons/icon-erase.svg +3 -0
  9. package/dist/icons/icon-info-white.svg +25 -0
  10. package/dist/icons/icon-settings-white.svg +15 -0
  11. package/dist/icons/icon-simplify.svg +61 -0
  12. package/dist/icons/icon-simplify2.svg +46 -0
  13. package/dist/icons/icon-subtract.svg +1 -0
  14. package/dist/icons/icon-trash-hover-white.svg +16 -0
  15. package/dist/icons/icon-trash-white.svg +16 -0
  16. package/dist/leaflet-polydraw.css +1 -0
  17. package/dist/polydraw.es.js +20688 -0
  18. package/dist/polydraw.es.js.map +1 -0
  19. package/dist/polydraw.umd.min.js +2 -0
  20. package/dist/polydraw.umd.min.js.map +1 -0
  21. package/dist/styles/polydraw.css +419 -0
  22. package/dist/types/buttons.d.ts +14 -0
  23. package/dist/types/buttons.d.ts.map +1 -0
  24. package/dist/types/coordinate-utils.d.ts +21 -0
  25. package/dist/types/coordinate-utils.d.ts.map +1 -0
  26. package/dist/types/enums.d.ts +27 -0
  27. package/dist/types/enums.d.ts.map +1 -0
  28. package/dist/types/geometry-utils.d.ts +24 -0
  29. package/dist/types/geometry-utils.d.ts.map +1 -0
  30. package/dist/types/icon-factory.d.ts +13 -0
  31. package/dist/types/icon-factory.d.ts.map +1 -0
  32. package/dist/types/index.d.ts +1 -0
  33. package/dist/types/managers/mode-manager.d.ts +91 -0
  34. package/dist/types/managers/mode-manager.d.ts.map +1 -0
  35. package/dist/types/managers/polygon-draw-manager.d.ts +88 -0
  36. package/dist/types/managers/polygon-draw-manager.d.ts.map +1 -0
  37. package/dist/types/managers/polygon-geometry-manager.d.ts +75 -0
  38. package/dist/types/managers/polygon-geometry-manager.d.ts.map +1 -0
  39. package/dist/types/managers/polygon-interaction-manager.d.ts +116 -0
  40. package/dist/types/managers/polygon-interaction-manager.d.ts.map +1 -0
  41. package/dist/types/managers/polygon-mutation-manager.d.ts +163 -0
  42. package/dist/types/managers/polygon-mutation-manager.d.ts.map +1 -0
  43. package/dist/types/map-state.d.ts +22 -0
  44. package/dist/types/map-state.d.ts.map +1 -0
  45. package/dist/types/polydraw.d.ts +87 -0
  46. package/dist/types/polydraw.d.ts.map +1 -0
  47. package/dist/types/polygon-helpers.d.ts +35 -0
  48. package/dist/types/polygon-helpers.d.ts.map +1 -0
  49. package/dist/types/polygon-information.service.d.ts +27 -0
  50. package/dist/types/polygon-information.service.d.ts.map +1 -0
  51. package/dist/types/polygon.util.d.ts +32 -0
  52. package/dist/types/polygon.util.d.ts.map +1 -0
  53. package/dist/types/turf-helper.d.ts +141 -0
  54. package/dist/types/turf-helper.d.ts.map +1 -0
  55. package/dist/types/types/polydraw-interfaces.d.ts +351 -0
  56. package/dist/types/types/polydraw-interfaces.d.ts.map +1 -0
  57. package/dist/types/utils.d.ts +57 -0
  58. package/dist/types/utils.d.ts.map +1 -0
  59. package/package.json +79 -0
@@ -0,0 +1,419 @@
1
+ /* Add application styles & imports to this file! */
2
+
3
+ html,
4
+ body {
5
+ height: 100%;
6
+ }
7
+
8
+ #blitz-app {
9
+ height: 100%;
10
+ }
11
+
12
+ .polygon-marker {
13
+ background-color: #e0f8c5;
14
+ box-shadow:
15
+ 0 0 0 2px #50622b,
16
+ 0 0 10px rgba(0, 0, 0, 0.35);
17
+ width: 12px !important;
18
+ height: 12px !important;
19
+ margin-left: -6px !important;
20
+ margin-top: -6px !important;
21
+ border-radius: 50%;
22
+ cursor: move;
23
+ outline: none;
24
+ transition: background-color 0.25s;
25
+ }
26
+
27
+ .polygon-marker.menu {
28
+ margin-left: -11px !important;
29
+ margin-top: -11px !important;
30
+ background-color: rgb(134, 162, 214);
31
+ background-image: url('../icons/icon-settings-white.svg');
32
+ -ms-background-size: 20px 20px;
33
+ background-size: 20px 20px;
34
+ background-repeat: no-repeat;
35
+ background-position: center;
36
+ width: 24px !important;
37
+ height: 24px !important;
38
+ z-index: 10000;
39
+ cursor: pointer;
40
+ }
41
+
42
+ .polygon-marker.info {
43
+ margin-left: -11px !important;
44
+ margin-top: -11px !important;
45
+ background-color: rgb(134, 162, 214);
46
+ background-image: url('../icons/icon-info-white.svg');
47
+ -ms-background-size: 24px 24px;
48
+ background-size: 24px 24px;
49
+ background-repeat: no-repeat;
50
+ background-position: center;
51
+ width: 24px !important;
52
+ height: 24px !important;
53
+ z-index: 10000;
54
+ cursor: pointer;
55
+ }
56
+
57
+ .polygon-marker:hover {
58
+ width: 18px !important;
59
+ height: 18px !important;
60
+ margin-left: -9px !important;
61
+ margin-top: -9px !important;
62
+ }
63
+
64
+ .polygon-marker.menu:hover {
65
+ background-color: red;
66
+ width: 24px !important;
67
+ height: 24px !important;
68
+ z-index: 10000;
69
+ margin-left: -11px !important;
70
+ margin-top: -11px !important;
71
+ }
72
+
73
+ .polygon-marker.info:hover {
74
+ background-color: rgb(134, 162, 214);
75
+ width: 24px !important;
76
+ height: 24px !important;
77
+ z-index: 10000;
78
+ margin-left: -11px !important;
79
+ margin-top: -11px !important;
80
+ }
81
+
82
+ .polygon-marker.delete {
83
+ margin-left: -11px !important;
84
+ margin-top: -11px !important;
85
+ background-color: rgb(100, 93, 93);
86
+ background-image: url('../icons/icon-trash-white.svg');
87
+ -ms-background-size: 24px 24px;
88
+ background-size: 24px 24px;
89
+ background-repeat: no-repeat;
90
+ background-position: center;
91
+ width: 24px !important;
92
+ height: 24px !important;
93
+ z-index: 10000;
94
+ cursor: pointer;
95
+ }
96
+
97
+ .polygon-marker.delete:hover {
98
+ background-color: rgb(92, 81, 81);
99
+ background-image: url('../icons/icon-trash-hover-white.svg');
100
+ width: 24px !important;
101
+ height: 24px !important;
102
+ z-index: 10000;
103
+ margin-left: -11px !important;
104
+ margin-top: -11px !important;
105
+ }
106
+
107
+ .polygon-marker.hole {
108
+ background-color: #ffcccc;
109
+ box-shadow:
110
+ 0 0 0 2px #aa0000,
111
+ 0 0 10px rgba(0, 0, 0, 0.35);
112
+ width: 12px !important;
113
+ height: 12px !important;
114
+ margin-left: -6px !important;
115
+ margin-top: -6px !important;
116
+ border-radius: 50%;
117
+ cursor: move;
118
+ outline: none;
119
+ transition: background-color 0.25s;
120
+ }
121
+
122
+ .polygon-marker.hole:hover {
123
+ background-color: #d4a5b8;
124
+ width: 18px !important;
125
+ height: 18px !important;
126
+ margin-left: -9px !important;
127
+ margin-top: -9px !important;
128
+ }
129
+
130
+ .marker-menu-inner-wrapper {
131
+ display: flex;
132
+ flex-direction: column;
133
+ }
134
+
135
+ .marker-menu-header {
136
+ font-weight: 600;
137
+ }
138
+
139
+ .marker-menu-content {
140
+ display: flex;
141
+ justify-content: space-between;
142
+ }
143
+
144
+ .marker-menu-button {
145
+ padding: 4px;
146
+ border: 1px solid #aaaaaa;
147
+ }
148
+
149
+ .marker-menu-separator {
150
+ padding: 4px;
151
+ }
152
+
153
+ .info-marker,
154
+ .alter-marker {
155
+ background-color: blue;
156
+ width: 100%;
157
+ display: flex;
158
+ flex-direction: row-reverse;
159
+
160
+ a.leaflet-popup-close-button {
161
+ top: -12px;
162
+ right: -12.5px;
163
+ z-index: 3;
164
+ color: #fff;
165
+ &:hover {
166
+ color: #fff;
167
+ }
168
+ }
169
+
170
+ .leaflet-popup-tip {
171
+ display: none;
172
+ }
173
+ .leaflet-popup-content-wrapper {
174
+ background: #e93434;
175
+ color: #ffffff;
176
+ .leaflet-popup-content {
177
+ margin: 0;
178
+ line-height: 1.4;
179
+ }
180
+ }
181
+ .leaflet-popup-content-wrapper {
182
+ padding: 0;
183
+ }
184
+ .leaflet-popup-tip-container {
185
+ width: 19px;
186
+ height: 19px;
187
+ position: absolute;
188
+ /* left: 50%; */
189
+ /* margin-left: -20px; */
190
+ /* overflow: hidden; */
191
+ /* pointer-events: none; */
192
+ background-color: #80be50;
193
+ border: 2px solid white;
194
+ top: -11px;
195
+ left: 8px;
196
+ /* border-top-left-radius: 50%; */
197
+ /* border-top-right-radius: 50%; */
198
+ /* border-bottom-right-radius: 50%; */
199
+ border-radius: 50%;
200
+ z-index: 1;
201
+ }
202
+ }
203
+
204
+ .alter-marker-outer-wrapper {
205
+ overflow: hidden;
206
+ background-color: transparent;
207
+ border-radius: 10px;
208
+ }
209
+ .alter-marker-wrapper {
210
+ height: 40px;
211
+ border: 2px solid #fff;
212
+ background-color: #80be50;
213
+ color: #fff;
214
+ /* border-radius: 10px; */
215
+ padding: 0 6px;
216
+ text-align: center;
217
+
218
+ -moz-border-radius: 10px 0 10px 10px;
219
+ -webkit-border-radius: 10px 0 10px 10px;
220
+ border-radius: 10px 0 10px 10px;
221
+ -moz-box-shadow: 3px 4px 20px rgba(0, 0, 0, 0.5);
222
+ -webkit-box-shadow: 3px 4px 20px rgba(0, 0, 0, 0.5);
223
+ box-shadow: 3px 4px 20px rgba(0, 0, 0, 0.5);
224
+ text-align: center;
225
+
226
+ .inverted-corner {
227
+ width: 24px;
228
+ height: 24px;
229
+ border: 2px solid #fff;
230
+ border-radius: 50%;
231
+ background-color: #80be50;
232
+ margin-top: -14px;
233
+ float: right;
234
+ margin-right: -20px;
235
+ }
236
+
237
+ .content {
238
+ width: 100%;
239
+ min-height: 40px;
240
+ margin-right: 12px;
241
+ }
242
+ .marker-menu-content {
243
+ .marker-menu-button {
244
+ width: 22px;
245
+ height: 22px;
246
+ background-repeat: no-repeat;
247
+ background-size: 22px, 22px;
248
+ background-position: center;
249
+ padding: 4px;
250
+ border: 1px solid #fff;
251
+ margin: 4px;
252
+ border-radius: 4px;
253
+ cursor: pointer;
254
+
255
+ &.simplify {
256
+ background-image: url('../icons/icon-simplify2.svg');
257
+ }
258
+ &.double-elbows {
259
+ background-image: url('../icons/icon-add-elbow.svg');
260
+ }
261
+ &.bbox {
262
+ background-image: url('../icons/icon-bbox.svg');
263
+ }
264
+ &.bezier {
265
+ background-image: url('../icons/icon-bezier.svg');
266
+ }
267
+ }
268
+ }
269
+ }
270
+
271
+ .alter-marker-wrapper .row.bottom-separator {
272
+ border-bottom: 1px dashed #fff;
273
+ }
274
+ .alter-marker-wrapper .row {
275
+ display: -webkit-box;
276
+ display: flex;
277
+ white-space: nowrap;
278
+ }
279
+ .alter-marker-wrapper .header {
280
+ padding-right: 4px;
281
+ width: 100%;
282
+ text-align: left;
283
+ }
284
+ .alter-marker-wrapper .area,
285
+ .alter-marker-wrapper .header {
286
+ font-size: 12px;
287
+ font-weight: 600;
288
+ line-height: 20px;
289
+ }
290
+
291
+ .alter-marker-wrapper .unit {
292
+ font-size: 11px;
293
+ font-weight: 400;
294
+ line-height: 20px;
295
+ }
296
+ .alter-marker-wrapper .unit .sup {
297
+ font-size: smaller;
298
+ font-weight: 400;
299
+ line-height: 20px;
300
+ position: relative;
301
+ top: -2px;
302
+ }
303
+ .leaflet-popup-content {
304
+ margin: 0 !important;
305
+ line-height: 1.4;
306
+ }
307
+
308
+ .right-margin {
309
+ margin-right: 8px;
310
+ }
311
+
312
+ .info-marker-outer-wrapper {
313
+ overflow: hidden;
314
+ background-color: transparent;
315
+ border-radius: 10px;
316
+ }
317
+ .info-marker-wrapper {
318
+ height: 40px;
319
+ border: 2px solid #fff;
320
+ background-color: #80be50;
321
+ color: #fff;
322
+ /* border-radius: 10px; */
323
+ padding: 0 6px;
324
+ text-align: center;
325
+
326
+ -moz-border-radius: 10px 0 10px 10px;
327
+ -webkit-border-radius: 10px 0 10px 10px;
328
+ border-radius: 10px 0 10px 10px;
329
+ -moz-box-shadow: 3px 4px 20px rgba(0, 0, 0, 0.5);
330
+ -webkit-box-shadow: 3px 4px 20px rgba(0, 0, 0, 0.5);
331
+ box-shadow: 3px 4px 20px rgba(0, 0, 0, 0.5);
332
+ text-align: center;
333
+ }
334
+ .info-marker-wrapper .inverted-corner {
335
+ width: 24px;
336
+ height: 24px;
337
+ border: 2px solid #fff;
338
+ border-radius: 50%;
339
+ background-color: #80be50;
340
+ margin-top: -14px;
341
+ float: right;
342
+ margin-right: -20px;
343
+ }
344
+
345
+ .content {
346
+ width: 100%;
347
+ min-height: 40px;
348
+ margin-right: 12px;
349
+ }
350
+
351
+ .info-marker-wrapper .row.bottom-separator {
352
+ border-bottom: 1px dashed #fff;
353
+ }
354
+ .info-marker-wrapper .row {
355
+ display: -webkit-box;
356
+ display: flex;
357
+ white-space: nowrap;
358
+ }
359
+ .info-marker-wrapper .header {
360
+ padding-right: 4px;
361
+ width: 100%;
362
+ text-align: left;
363
+ }
364
+ .info-marker-wrapper .area,
365
+ .info-marker-wrapper .header {
366
+ font-size: 12px;
367
+ font-weight: 600;
368
+ line-height: 20px;
369
+ }
370
+
371
+ .info-marker-wrapper .unit {
372
+ font-size: 11px;
373
+ font-weight: 400;
374
+ line-height: 20px;
375
+ }
376
+ .info-marker-wrapper .unit .sup {
377
+ font-size: smaller;
378
+ font-weight: 400;
379
+ line-height: 20px;
380
+ position: relative;
381
+ top: -2px;
382
+ }
383
+ .leaflet-popup-content {
384
+ margin: 0 !important;
385
+ line-height: 1.4;
386
+ }
387
+
388
+ .right-margin {
389
+ margin-right: 8px;
390
+ }
391
+
392
+ /* Hidden marker styles */
393
+ .polydraw-hidden-marker {
394
+ opacity: 0.2;
395
+ transform: scale(0.5);
396
+ transition:
397
+ opacity 0.2s ease,
398
+ transform 0.2s ease;
399
+ background-color: #e0f8c5 !important;
400
+ box-shadow: none !important;
401
+ border: none !important;
402
+ z-index: 1;
403
+ }
404
+
405
+ .polydraw-hidden-marker:hover {
406
+ opacity: 1 !important;
407
+ transform: scale(1) !important;
408
+ background-color: #e0f8c5 !important;
409
+ box-shadow:
410
+ 0 0 0 2px #50622b,
411
+ 0 0 10px rgba(0, 0, 0, 0.35) !important;
412
+ border-radius: 50% !important;
413
+ z-index: 10000 !important;
414
+ }
415
+
416
+ /* Ensure hidden markers are still draggable */
417
+ .polydraw-hidden-marker.leaflet-marker-draggable {
418
+ cursor: move !important;
419
+ }
@@ -0,0 +1,14 @@
1
+ import { PolydrawConfig } from './types/polydraw-interfaces';
2
+ /**
3
+ * Creates the button elements for the Polydraw control.
4
+ * @param container The main container element.
5
+ * @param subContainer The sub-container for additional buttons.
6
+ * @param onActivateToggle Callback for activate button.
7
+ * @param onDrawClick Callback for draw button.
8
+ * @param onSubtractClick Callback for subtract button.
9
+ * @param onEraseClick Callback for erase button.
10
+ * @param onStartClick Callback for start button.
11
+ * @param onHoleClick Callback for hole button.
12
+ */
13
+ export declare function createButtons(container: HTMLElement, subContainer: HTMLElement, config: PolydrawConfig, onActivateToggle: () => void, onDrawClick: () => void, onSubtractClick: () => void, onEraseClick: () => void, onPointToPointClick: () => void): void;
14
+ //# sourceMappingURL=buttons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buttons.d.ts","sourceRoot":"","sources":["../../src/buttons.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,WAAW,EACtB,YAAY,EAAE,WAAW,EACzB,MAAM,EAAE,cAAc,EACtB,gBAAgB,EAAE,MAAM,IAAI,EAC5B,WAAW,EAAE,MAAM,IAAI,EACvB,eAAe,EAAE,MAAM,IAAI,EAC3B,YAAY,EAAE,MAAM,IAAI,EACxB,mBAAmB,EAAE,MAAM,IAAI,QA6EhC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * CoordinateUtils - Handles coordinate conversions and transformations
3
+ * This is a small, focused module for coordinate-related operations
4
+ */
5
+ import * as L from 'leaflet';
6
+ import type { TurfHelper } from './turf-helper';
7
+ export declare class CoordinateUtils {
8
+ /**
9
+ * Convert coordinate arrays to proper format for polygon creation
10
+ */
11
+ static convertToCoords(latlngs: L.LatLngLiteral[][], turfHelper: TurfHelper): any[];
12
+ /**
13
+ * Apply offset to polygon coordinates
14
+ */
15
+ static offsetPolygonCoordinates(latLngs: any, offsetLat: number, offsetLng: number): any;
16
+ /**
17
+ * Get latitude/longitude information string
18
+ */
19
+ static getLatLngInfoString(latlng: L.LatLngLiteral): string;
20
+ }
21
+ //# sourceMappingURL=coordinate-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinate-utils.d.ts","sourceRoot":"","sources":["../../src/coordinate-utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAG7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,qBAAa,eAAe;IAC1B;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,OAAO,EAAE,CAAC,CAAC,aAAa,EAAE,EAAE,EAAE,UAAU,EAAE,UAAU,GAAG,GAAG,EAAE;IAiDnF;;OAEG;IACH,MAAM,CAAC,wBAAwB,CAAC,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,GAAG;IAIxF;;OAEG;IACH,MAAM,CAAC,mBAAmB,CAAC,MAAM,EAAE,CAAC,CAAC,aAAa,GAAG,MAAM;CAsB5D"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Enum for drawing modes in Polydraw.
3
+ */
4
+ export declare enum DrawMode {
5
+ Off = 0,
6
+ Add = 1,
7
+ Edit = 2,
8
+ Subtract = 4,
9
+ AppendMarker = 8,
10
+ LoadPredefined = 16,
11
+ PointToPoint = 32
12
+ }
13
+ /**
14
+ * Enum for marker positions.
15
+ */
16
+ export declare enum MarkerPosition {
17
+ SouthWest = 0,
18
+ South = 1,
19
+ SouthEast = 2,
20
+ East = 3,
21
+ NorthEast = 4,
22
+ North = 5,
23
+ NorthWest = 6,
24
+ West = 7,
25
+ Hole = 8
26
+ }
27
+ //# sourceMappingURL=enums.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../src/enums.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,oBAAY,QAAQ;IAClB,GAAG,IAAI;IACP,GAAG,IAAI;IACP,IAAI,IAAI;IACR,QAAQ,IAAI;IACZ,YAAY,IAAI;IAChB,cAAc,KAAK;IACnB,YAAY,KAAK;CAClB;AACD;;GAEG;AAGH,oBAAY,cAAc;IACxB,SAAS,IAAI;IACb,KAAK,IAAI;IACT,SAAS,IAAI;IACb,IAAI,IAAI;IACR,SAAS,IAAI;IACb,KAAK,IAAI;IACT,SAAS,IAAI;IACb,IAAI,IAAI;IACR,IAAI,IAAI;CAGT"}
@@ -0,0 +1,24 @@
1
+ export declare class GeometryUtils {
2
+ /**
3
+ * Calculate angle between three points
4
+ */
5
+ static calculateAngle(p1: L.LatLngLiteral, p2: L.LatLngLiteral, p3: L.LatLngLiteral): number;
6
+ /**
7
+ * Calculate distance from point to line between two other points
8
+ */
9
+ static calculateDistanceFromLine(p1: L.LatLngLiteral, point: L.LatLngLiteral, p2: L.LatLngLiteral): number;
10
+ /**
11
+ * Calculate centroid of polygon
12
+ * @deprecated Use PolygonUtil.getCenter() instead for consistency
13
+ */
14
+ static calculateCentroid(latlngs: L.LatLngLiteral[]): L.LatLngLiteral;
15
+ /**
16
+ * Calculate distance between two points
17
+ */
18
+ static calculateDistance(p1: L.LatLngLiteral, p2: L.LatLngLiteral): number;
19
+ /**
20
+ * Apply offset to polygon coordinates
21
+ */
22
+ static offsetPolygonCoordinates(latLngs: any, offsetLat: number, offsetLng: number): any;
23
+ }
24
+ //# sourceMappingURL=geometry-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geometry-utils.d.ts","sourceRoot":"","sources":["../../src/geometry-utils.ts"],"names":[],"mappings":"AAOA,qBAAa,aAAa;IACxB;;OAEG;IACH,MAAM,CAAC,cAAc,CAAC,EAAE,EAAE,CAAC,CAAC,aAAa,EAAE,EAAE,EAAE,CAAC,CAAC,aAAa,EAAE,EAAE,EAAE,CAAC,CAAC,aAAa,GAAG,MAAM;IAc5F;;OAEG;IACH,MAAM,CAAC,yBAAyB,CAC9B,EAAE,EAAE,CAAC,CAAC,aAAa,EACnB,KAAK,EAAE,CAAC,CAAC,aAAa,EACtB,EAAE,EAAE,CAAC,CAAC,aAAa,GAClB,MAAM;IA8BT;;;OAGG;IACH,MAAM,CAAC,iBAAiB,CAAC,OAAO,EAAE,CAAC,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC,aAAa;IAMrE;;OAEG;IACH,MAAM,CAAC,iBAAiB,CAAC,EAAE,EAAE,CAAC,CAAC,aAAa,EAAE,EAAE,EAAE,CAAC,CAAC,aAAa,GAAG,MAAM;IAM1E;;OAEG;IACH,MAAM,CAAC,wBAAwB,CAAC,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,GAAG;CAqBzF"}
@@ -0,0 +1,13 @@
1
+ import * as L from 'leaflet';
2
+ /**
3
+ * Factory for creating Leaflet DivIcons.
4
+ */
5
+ export declare class IconFactory {
6
+ /**
7
+ * Creates a DivIcon with the given class names.
8
+ * @param classNames Array of class names to apply.
9
+ * @returns A Leaflet DivIcon.
10
+ */
11
+ static createDivIcon(classNames: string[]): L.DivIcon;
12
+ }
13
+ //# sourceMappingURL=icon-factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon-factory.d.ts","sourceRoot":"","sources":["../../src/icon-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAE7B;;GAEG;AACH,qBAAa,WAAW;IACtB;;;;OAIG;IACH,MAAM,CAAC,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,OAAO;CAItD"}
@@ -0,0 +1 @@
1
+ export { default } from "./polydraw";
@@ -0,0 +1,91 @@
1
+ import { DrawMode } from '../enums';
2
+ import type { PolydrawConfig } from '../types/polydraw-interfaces';
3
+ /**
4
+ * Represents the current state of all user interactions in Polydraw
5
+ */
6
+ export interface InteractionState {
7
+ polygonDragging: boolean;
8
+ markerDragging: boolean;
9
+ edgeClicking: boolean;
10
+ polygonClicking: boolean;
11
+ canStartDrawing: boolean;
12
+ canCompletePolygon: boolean;
13
+ mapDragging: boolean;
14
+ mapZooming: boolean;
15
+ mapDoubleClickZoom: boolean;
16
+ currentMode: DrawMode;
17
+ isDrawingActive: boolean;
18
+ isModifierKeyHeld: boolean;
19
+ showCrosshairCursor: boolean;
20
+ showDragCursor: boolean;
21
+ }
22
+ /**
23
+ * Centralized manager for all interaction states in Polydraw.
24
+ * Acts as a single source of truth for what interactions are enabled/disabled.
25
+ */
26
+ export declare class ModeManager {
27
+ private state;
28
+ private config;
29
+ constructor(config: PolydrawConfig);
30
+ /**
31
+ * Create the initial interaction state
32
+ */
33
+ private createInitialState;
34
+ /**
35
+ * Update the interaction state when the draw mode changes
36
+ */
37
+ updateStateForMode(mode: DrawMode): void;
38
+ /**
39
+ * Set interaction state for Off mode (normal editing)
40
+ */
41
+ private setOffModeState;
42
+ /**
43
+ * Set interaction state for drawing modes (Add, Subtract)
44
+ */
45
+ private setDrawingModeState;
46
+ /**
47
+ * Set interaction state for Point-to-Point mode
48
+ */
49
+ private setPointToPointModeState;
50
+ /**
51
+ * Update modifier key state
52
+ */
53
+ setModifierKeyState(isHeld: boolean): void;
54
+ /**
55
+ * Check if a specific action is currently allowed
56
+ */
57
+ canPerformAction(action: InteractionAction): boolean;
58
+ /**
59
+ * Check if any drawing mode is active
60
+ */
61
+ isInDrawingMode(): boolean;
62
+ /**
63
+ * Check if currently in Off mode (normal editing)
64
+ */
65
+ isInOffMode(): boolean;
66
+ /**
67
+ * Get the current draw mode
68
+ */
69
+ getCurrentMode(): DrawMode;
70
+ /**
71
+ * Get read-only access to the current state
72
+ */
73
+ getState(): Readonly<InteractionState>;
74
+ /**
75
+ * Check if crosshair cursor should be shown
76
+ */
77
+ shouldShowCrosshairCursor(): boolean;
78
+ /**
79
+ * Check if drag cursor should be shown
80
+ */
81
+ shouldShowDragCursor(): boolean;
82
+ /**
83
+ * Update configuration and recalculate state
84
+ */
85
+ updateConfig(config: PolydrawConfig): void;
86
+ }
87
+ /**
88
+ * All possible interaction actions that can be checked
89
+ */
90
+ export type InteractionAction = 'polygonDrag' | 'markerDrag' | 'edgeClick' | 'polygonClick' | 'startDrawing' | 'completePolygon' | 'mapDrag' | 'mapZoom' | 'mapDoubleClickZoom';
91
+ //# sourceMappingURL=mode-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mode-manager.d.ts","sourceRoot":"","sources":["../../../src/managers/mode-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAE/B,eAAe,EAAE,OAAO,CAAC;IACzB,cAAc,EAAE,OAAO,CAAC;IACxB,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;IAGzB,eAAe,EAAE,OAAO,CAAC;IACzB,kBAAkB,EAAE,OAAO,CAAC;IAG5B,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,kBAAkB,EAAE,OAAO,CAAC;IAG5B,WAAW,EAAE,QAAQ,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;IACzB,iBAAiB,EAAE,OAAO,CAAC;IAG3B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,cAAc,EAAE,OAAO,CAAC;CACzB;AAED;;;GAGG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,KAAK,CAAmB;IAChC,OAAO,CAAC,MAAM,CAAiB;gBAEnB,MAAM,EAAE,cAAc;IAKlC;;OAEG;IACH,OAAO,CAAC,kBAAkB;IA4B1B;;OAEG;IACH,kBAAkB,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI;IAsBxC;;OAEG;IACH,OAAO,CAAC,eAAe;IAqBvB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAqB3B;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAqBhC;;OAEG;IACH,mBAAmB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI;IAU1C;;OAEG;IACH,gBAAgB,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO;IAyBpD;;OAEG;IACH,eAAe,IAAI,OAAO;IAI1B;;OAEG;IACH,WAAW,IAAI,OAAO;IAItB;;OAEG;IACH,cAAc,IAAI,QAAQ;IAI1B;;OAEG;IACH,QAAQ,IAAI,QAAQ,CAAC,gBAAgB,CAAC;IAItC;;OAEG;IACH,yBAAyB,IAAI,OAAO;IAIpC;;OAEG;IACH,oBAAoB,IAAI,OAAO;IAI/B;;OAEG;IACH,YAAY,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI;CAK3C;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GACzB,aAAa,GACb,YAAY,GACZ,WAAW,GACX,cAAc,GACd,cAAc,GACd,iBAAiB,GACjB,SAAS,GACT,SAAS,GACT,oBAAoB,CAAC"}