leaflet-polydraw 0.9.3 → 0.9.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 +27 -21
- package/dist/polydraw.es.js +15001 -15120
- package/dist/polydraw.es.js.map +1 -1
- package/dist/polydraw.umd.min.js +1 -1
- package/dist/polydraw.umd.min.js.map +1 -1
- package/dist/types/coordinate-utils.d.ts +2 -2
- package/dist/types/coordinate-utils.d.ts.map +1 -1
- package/dist/types/geometry-utils.d.ts +6 -0
- package/dist/types/geometry-utils.d.ts.map +1 -1
- package/dist/types/managers/polygon-geometry-manager.d.ts +0 -8
- package/dist/types/managers/polygon-geometry-manager.d.ts.map +1 -1
- package/dist/types/managers/polygon-interaction-manager.d.ts +1 -7
- package/dist/types/managers/polygon-interaction-manager.d.ts.map +1 -1
- package/dist/types/managers/polygon-mutation-manager.d.ts +0 -3
- package/dist/types/managers/polygon-mutation-manager.d.ts.map +1 -1
- package/dist/types/polydraw.d.ts.map +1 -1
- package/dist/types/polygon-helpers.d.ts +1 -1
- package/dist/types/polygon-helpers.d.ts.map +1 -1
- package/dist/types/polygon-information.service.d.ts +1 -2
- package/dist/types/polygon-information.service.d.ts.map +1 -1
- package/dist/types/polygon.util.d.ts.map +1 -1
- package/dist/types/turf-helper.d.ts +12 -30
- package/dist/types/turf-helper.d.ts.map +1 -1
- package/dist/types/types/polydraw-interfaces.d.ts +2 -6
- package/dist/types/types/polydraw-interfaces.d.ts.map +1 -1
- package/package.json +32 -2
package/README.md
CHANGED
|
@@ -124,7 +124,6 @@ const polyDrawControl = L.control
|
|
|
124
124
|
.polydraw({
|
|
125
125
|
position: 'topright',
|
|
126
126
|
config: {
|
|
127
|
-
touchSupport: true,
|
|
128
127
|
mergePolygons: true,
|
|
129
128
|
modes: {
|
|
130
129
|
dragPolygons: true,
|
|
@@ -132,8 +131,6 @@ const polyDrawControl = L.control
|
|
|
132
131
|
dragElbow: true,
|
|
133
132
|
},
|
|
134
133
|
dragPolygons: {
|
|
135
|
-
autoMergeOnIntersect: true,
|
|
136
|
-
autoHoleOnContained: true,
|
|
137
134
|
markerBehavior: 'hide',
|
|
138
135
|
},
|
|
139
136
|
markers: {
|
|
@@ -164,7 +161,6 @@ const polyDrawControl = L.control
|
|
|
164
161
|
|
|
165
162
|
```javascript
|
|
166
163
|
{
|
|
167
|
-
"touchSupport": true,
|
|
168
164
|
"mergePolygons": true,
|
|
169
165
|
"kinks": false,
|
|
170
166
|
"modes": {
|
|
@@ -178,18 +174,12 @@ const polyDrawControl = L.control
|
|
|
178
174
|
"edgeDeletion": true
|
|
179
175
|
},
|
|
180
176
|
"dragPolygons": {
|
|
181
|
-
"realTimeUpdate": false,
|
|
182
|
-
"showDragHandle": false,
|
|
183
177
|
"opacity": 0.7,
|
|
184
178
|
"dragCursor": "move",
|
|
185
179
|
"hoverCursor": "grab",
|
|
186
180
|
"markerBehavior": "hide",
|
|
187
181
|
"markerAnimationDuration": 200,
|
|
188
|
-
"autoMergeOnIntersect": true,
|
|
189
|
-
"autoHoleOnContained": false,
|
|
190
|
-
"dragInteractionBehavior": "auto",
|
|
191
182
|
"modifierSubtract": {
|
|
192
|
-
"enabled": true,
|
|
193
183
|
"keys": {
|
|
194
184
|
"windows": "ctrlKey",
|
|
195
185
|
"mac": "metaKey",
|
|
@@ -199,13 +189,11 @@ const polyDrawControl = L.control
|
|
|
199
189
|
}
|
|
200
190
|
},
|
|
201
191
|
"edgeDeletion": {
|
|
202
|
-
"enabled": true,
|
|
203
192
|
"keys": {
|
|
204
193
|
"windows": "ctrlKey",
|
|
205
194
|
"mac": "metaKey",
|
|
206
195
|
"linux": "ctrlKey"
|
|
207
196
|
},
|
|
208
|
-
"confirmDeletion": false,
|
|
209
197
|
"minVertices": 3
|
|
210
198
|
},
|
|
211
199
|
"markers": {
|
|
@@ -405,7 +393,6 @@ const polyDrawControl = L.control
|
|
|
405
393
|
|
|
406
394
|
| Key | Type | Default | Description |
|
|
407
395
|
| ------------------------------------------------------------------ | ------- | ------------------------------ | --------------------------------------------------------- |
|
|
408
|
-
| **touchSupport** | boolean | `true` | Enable touch support for mobile devices |
|
|
409
396
|
| **mergePolygons** | boolean | `true` | Auto-merge polygons during drawing when they intersect |
|
|
410
397
|
| **kinks** | boolean | `false` | Allow self-intersecting polygons |
|
|
411
398
|
| **modes** | object | | Feature toggles |
|
|
@@ -418,18 +405,12 @@ const polyDrawControl = L.control
|
|
|
418
405
|
| dragPolygons | boolean | `true` | Enable dragging entire polygons |
|
|
419
406
|
| edgeDeletion | boolean | `true` | Enable edge deletion with modifier keys |
|
|
420
407
|
| **dragPolygons** | object | | Polygon dragging configuration |
|
|
421
|
-
| realTimeUpdate | boolean | `false` | Update polygon position in real-time during drag |
|
|
422
|
-
| showDragHandle | boolean | `false` | Show visual drag handle on polygons |
|
|
423
408
|
| opacity | number | `0.7` | Polygon opacity during drag (0-1) |
|
|
424
409
|
| dragCursor | string | `"move"` | Cursor during active dragging |
|
|
425
410
|
| hoverCursor | string | `"grab"` | Cursor when hovering over draggable polygons |
|
|
426
411
|
| markerBehavior | string | `"hide"` | Marker behavior during drag: `"hide"`, `"show"`, `"fade"` |
|
|
427
412
|
| markerAnimationDuration | number | `200` | Duration of marker animations in milliseconds |
|
|
428
|
-
| autoMergeOnIntersect | boolean | `true` | Auto-merge when dragging polygons together |
|
|
429
|
-
| autoHoleOnContained | boolean | `false` | Create holes when dragging inside polygons |
|
|
430
|
-
| dragInteractionBehavior | string | `"auto"` | How drag interactions are handled |
|
|
431
413
|
| **modifierSubtract** | object | | Modifier key subtract configuration |
|
|
432
|
-
| enabled | boolean | `true` | Enable modifier key subtract mode |
|
|
433
414
|
| **keys** | object | | Platform-specific modifier keys |
|
|
434
415
|
| windows | string | `"ctrlKey"` | Windows modifier key |
|
|
435
416
|
| mac | string | `"metaKey"` | Mac modifier key |
|
|
@@ -437,13 +418,11 @@ const polyDrawControl = L.control
|
|
|
437
418
|
| subtractColor | string | `"#D9460F"` | Color for subtract mode visualization |
|
|
438
419
|
| hideMarkersOnDrag | boolean | `true` | Hide markers during subtract drag |
|
|
439
420
|
| **edgeDeletion** | object | | Edge deletion configuration |
|
|
440
|
-
| enabled | boolean | `true` | Enable edge deletion functionality |
|
|
441
421
|
| **keys** | object | | Platform-specific modifier keys |
|
|
442
422
|
| windows | string | `"ctrlKey"` | Windows modifier key |
|
|
443
423
|
| mac | string | `"metaKey"` | Mac modifier key |
|
|
444
424
|
| linux | string | `"ctrlKey"` | Linux modifier key |
|
|
445
425
|
| hoverColor | string | `"#D9460F"` | Color when hovering over deletable edges |
|
|
446
|
-
| confirmDeletion | boolean | `false` | Require confirmation before deleting |
|
|
447
426
|
| minVertices | number | `3` | Minimum vertices required after deletion |
|
|
448
427
|
| **markers** | object | | Marker configuration |
|
|
449
428
|
| deleteMarker | boolean | `true` | Show delete marker |
|
|
@@ -979,6 +958,33 @@ map.on('polygon:created', (e) => {
|
|
|
979
958
|
});
|
|
980
959
|
```
|
|
981
960
|
|
|
961
|
+
## Roadmap & Future Improvements
|
|
962
|
+
|
|
963
|
+
This section outlines planned fixes and new features. Contributions are highly welcome!
|
|
964
|
+
|
|
965
|
+
### Fixes and Core Improvements
|
|
966
|
+
|
|
967
|
+
- **Bezier Curve Refinement**: Improve the bezier curve algorithm for more intuitive results.
|
|
968
|
+
- **Simplification Algorithm Review**: Make simplification less aggressive and more predictable.
|
|
969
|
+
- **Mobile/Touch Support**: Enhance usability on touch devices, especially for p2p drawing.
|
|
970
|
+
- **Visual Optimization for Complex Polygons**: Smartly hide markers on complex polygons to reduce clutter while retaining functionality.
|
|
971
|
+
|
|
972
|
+
### New Features
|
|
973
|
+
|
|
974
|
+
- **Polygon Splitting Tool**: A mode to split a polygon by drawing a line across it.
|
|
975
|
+
- **Undo/Redo History**: Add undo/redo capabilities for all editing actions.
|
|
976
|
+
- **Measurement Tool**: A tool for measuring distances and areas without creating permanent polygons.
|
|
977
|
+
- **Multi-Select and Edit**: Allow users to edit multiple polygons at once.
|
|
978
|
+
- **Geo-data Format Integration**: Add helpers for importing/exporting GeoJSON, WKT, or KML.
|
|
979
|
+
|
|
980
|
+
### Low Priority Ideas
|
|
981
|
+
|
|
982
|
+
- **Topological Operations**: Add advanced GIS operations like intersection and buffering.
|
|
983
|
+
- **Drawing with Curves**: Allow drawing curved segments in point-to-point mode.
|
|
984
|
+
- **Theming and Customization**: Expand the config to allow for full theming.
|
|
985
|
+
- **Extensible Menu**: Allow developers to add custom actions to the menu.
|
|
986
|
+
- **Vertex Snapping**: Add snapping to a grid or other features.
|
|
987
|
+
|
|
982
988
|
## Browser Support
|
|
983
989
|
|
|
984
990
|
> ⚠️ Mobile support is considered **beta** in this version. While basic touch interaction is implemented, advanced workflows may behave inconsistently across mobile browsers. Full mobile compatibility is planned for a future release.
|