@florasync/leaflet-geokit 0.4.0 → 0.6.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/CHANGELOG.md +32 -8
- package/README.md +32 -14
- package/dist/django/index.js +2616 -2179
- package/dist/django/index.js.map +1 -1
- package/dist/leaflet-geokit.es.js +2598 -2161
- package/dist/leaflet-geokit.es.js.map +1 -1
- package/dist/leaflet-geokit.external.es.js +1030 -593
- package/dist/leaflet-geokit.external.es.js.map +1 -1
- package/dist/leaflet-geokit.umd.js +48 -15
- package/dist/leaflet-geokit.umd.js.map +1 -1
- package/dist/preact/{index-BM2U4rKn.js → index-CC8_JrcA.js} +1048 -611
- package/dist/preact/index-CC8_JrcA.js.map +1 -0
- package/dist/preact/index.js +1 -1
- package/dist/preact-bundled/index.js +2506 -2069
- package/dist/preact-bundled/index.js.map +1 -1
- package/dist/react/{index-BM2U4rKn.js → index-CC8_JrcA.js} +1048 -611
- package/dist/react/index-CC8_JrcA.js.map +1 -0
- package/dist/react/index.js +1 -1
- package/dist/react-bundled/index.js +2505 -2068
- package/dist/react-bundled/index.js.map +1 -1
- package/dist/types/src/lib/MapController.d.ts +5 -0
- package/dist/types/src/lib/draw/L.Draw.Move.d.ts +49 -0
- package/dist/types/src/types/public.d.ts +2 -0
- package/dist/types/tests/draw-move.spec.d.ts +1 -0
- package/dist/types/tests/ensure-element.spec.d.ts +1 -0
- package/dist/types/tests/external-entry.spec.d.ts +1 -0
- package/dist/types/tests/leaflet-guards.spec.d.ts +1 -0
- package/dist/types/tests/preact-shim.spec.d.ts +1 -0
- package/package.json +14 -7
- package/dist/preact/index-BM2U4rKn.js.map +0 -1
- package/dist/react/index-BM2U4rKn.js.map +0 -1
|
@@ -61,6 +61,8 @@ export declare class MapController {
|
|
|
61
61
|
private vertexMenuEl;
|
|
62
62
|
private vertexMenuCleanup;
|
|
63
63
|
private activeCakeSession;
|
|
64
|
+
private moveConfirmationUI;
|
|
65
|
+
private activeMoveHandler;
|
|
64
66
|
constructor(opts: MapControllerOptions);
|
|
65
67
|
private resolveLeaflet;
|
|
66
68
|
init(): Promise<void>;
|
|
@@ -88,6 +90,7 @@ export declare class MapController {
|
|
|
88
90
|
setRulerUnits(system: MeasurementSystem): void;
|
|
89
91
|
private buildDrawOptions;
|
|
90
92
|
private applyLayerCakeToolbarIcon;
|
|
93
|
+
private applyMoveToolbarIcon;
|
|
91
94
|
private addRulerControl;
|
|
92
95
|
private installRulerPrecisionPatch;
|
|
93
96
|
private rebuildRulerControl;
|
|
@@ -113,4 +116,6 @@ export declare class MapController {
|
|
|
113
116
|
private showVertexMenu;
|
|
114
117
|
private findNearestVertex;
|
|
115
118
|
private deleteVertex;
|
|
119
|
+
private showMoveConfirmationUI;
|
|
120
|
+
private hideMoveConfirmationUI;
|
|
116
121
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as L from "leaflet";
|
|
2
|
+
declare const DrawMove_base: any;
|
|
3
|
+
/**
|
|
4
|
+
* DrawMove: A custom Leaflet.draw handler that enables moving/translating existing features.
|
|
5
|
+
* This handler activates a "move mode" where users can click and drag features to new positions.
|
|
6
|
+
*/
|
|
7
|
+
export declare class DrawMove extends DrawMove_base {
|
|
8
|
+
static TYPE: string;
|
|
9
|
+
private _featureGroup;
|
|
10
|
+
private _selectedLayer;
|
|
11
|
+
private _originalLatLngs;
|
|
12
|
+
private _dragStartLatLng;
|
|
13
|
+
private _isDragging;
|
|
14
|
+
private _pendingMove;
|
|
15
|
+
constructor(map: L.Map, options?: {
|
|
16
|
+
featureGroup: L.FeatureGroup;
|
|
17
|
+
} & any);
|
|
18
|
+
enable(): void;
|
|
19
|
+
disable(): void;
|
|
20
|
+
addHooks(): void;
|
|
21
|
+
removeHooks(): void;
|
|
22
|
+
private _enableLayerHover;
|
|
23
|
+
private _disableLayerHover;
|
|
24
|
+
private _onLayerMouseOver;
|
|
25
|
+
private _onLayerMouseOut;
|
|
26
|
+
private _onLayerMouseDown;
|
|
27
|
+
private _storeOriginalLatLngs;
|
|
28
|
+
private _onMouseMove;
|
|
29
|
+
private _offsetLatLngs;
|
|
30
|
+
private _onMouseUp;
|
|
31
|
+
private _cleanupDragging;
|
|
32
|
+
/**
|
|
33
|
+
* Confirm the pending move and dispatch the final event.
|
|
34
|
+
*/
|
|
35
|
+
confirmMove(): void;
|
|
36
|
+
/**
|
|
37
|
+
* Cancel the pending move and revert the layer to its original position.
|
|
38
|
+
*/
|
|
39
|
+
cancelMove(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Check if there's a pending move awaiting confirmation.
|
|
42
|
+
*/
|
|
43
|
+
hasPendingMove(): boolean;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Ensure DrawMove is registered with a given Leaflet namespace.
|
|
47
|
+
*/
|
|
48
|
+
export declare function ensureDrawMoveRegistered(Lns: typeof L): void;
|
|
49
|
+
export {};
|
|
@@ -42,6 +42,8 @@ export interface DrawControlsConfig {
|
|
|
42
42
|
/** Draw a Layer Cake base circle + manager to create concentric donut polygons. */
|
|
43
43
|
cake?: boolean;
|
|
44
44
|
marker?: boolean;
|
|
45
|
+
/** Move/translate existing features. */
|
|
46
|
+
move?: boolean;
|
|
45
47
|
edit?: boolean;
|
|
46
48
|
delete?: boolean;
|
|
47
49
|
ruler?: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@src/index";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@src/index";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@florasync/leaflet-geokit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Framework-agnostic Leaflet + Leaflet.draw web component with TypeScript, verbose logging, and tests.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/leaflet-geokit.umd.js",
|
|
@@ -80,6 +80,8 @@
|
|
|
80
80
|
"test:e2e": "playwright test",
|
|
81
81
|
"e2e:install": "playwright install --with-deps",
|
|
82
82
|
"prepare": "husky",
|
|
83
|
+
"spec-kitty:init": "spec-kitty init . --ai claude",
|
|
84
|
+
"spec-kitty:doctor": "spec-kitty doctor",
|
|
83
85
|
"prepack": "npm run build",
|
|
84
86
|
"pack:dry": "npm pack --dry-run",
|
|
85
87
|
"release:dry": "npm run typecheck && npm run test:unit && npm run build && npm pack --dry-run"
|
|
@@ -122,6 +124,7 @@
|
|
|
122
124
|
}
|
|
123
125
|
},
|
|
124
126
|
"devDependencies": {
|
|
127
|
+
"@eslint/js": "^10.0.1",
|
|
125
128
|
"@playwright/test": "^1.58.2",
|
|
126
129
|
"@preact/preset-vite": "^2.8.0",
|
|
127
130
|
"@testing-library/dom": "^10.4.0",
|
|
@@ -133,12 +136,13 @@
|
|
|
133
136
|
"@types/node": "^22.0.0",
|
|
134
137
|
"@types/react": "^18.3.12",
|
|
135
138
|
"@types/react-dom": "^18.3.1",
|
|
136
|
-
"@typescript-eslint/eslint-plugin": "^8.0
|
|
137
|
-
"@typescript-eslint/parser": "^8.0
|
|
138
|
-
"@vitest/coverage-v8": "^
|
|
139
|
+
"@typescript-eslint/eslint-plugin": "^8.56.0",
|
|
140
|
+
"@typescript-eslint/parser": "^8.56.0",
|
|
141
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
139
142
|
"baseline-browser-mapping": "^2.9.17",
|
|
140
|
-
"eslint": "^
|
|
141
|
-
"
|
|
143
|
+
"eslint": "^10.0.0",
|
|
144
|
+
"globals": "^17.3.0",
|
|
145
|
+
"happy-dom": "^20.6.3",
|
|
142
146
|
"husky": "^9.1.7",
|
|
143
147
|
"lint-staged": "^15.2.10",
|
|
144
148
|
"preact": "^10.28.3",
|
|
@@ -148,7 +152,7 @@
|
|
|
148
152
|
"rollup-plugin-visualizer": "^6.0.5",
|
|
149
153
|
"typescript": "^5.5.4",
|
|
150
154
|
"vite": "^7.1.4",
|
|
151
|
-
"vitest": "^
|
|
155
|
+
"vitest": "^4.0.18"
|
|
152
156
|
},
|
|
153
157
|
"lint-staged": {
|
|
154
158
|
"*.{ts,tsx,js,jsx}": [
|
|
@@ -158,5 +162,8 @@
|
|
|
158
162
|
"*.{json,md,css,scss,html,yml,yaml}": [
|
|
159
163
|
"prettier --write"
|
|
160
164
|
]
|
|
165
|
+
},
|
|
166
|
+
"overrides": {
|
|
167
|
+
"minimatch": "^10.2.1"
|
|
161
168
|
}
|
|
162
169
|
}
|