@florasync/leaflet-geokit 0.8.3 → 0.9.1
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/ARCHITECTURE.md +195 -0
- package/CHANGELOG.md +8 -0
- package/README.md +146 -11
- package/custom-toolbar.html +165 -0
- package/dist/django/index.js +8993 -5090
- package/dist/django/index.js.map +1 -1
- package/dist/leaflet-geokit.es.js +21536 -5994
- package/dist/leaflet-geokit.es.js.map +1 -1
- package/dist/leaflet-geokit.external.es.js +18006 -2461
- package/dist/leaflet-geokit.external.es.js.map +1 -1
- package/dist/leaflet-geokit.umd.js +263 -60
- package/dist/leaflet-geokit.umd.js.map +1 -1
- package/dist/preact/index-DCKj0r6a.js +8545 -0
- package/dist/preact/index-DCKj0r6a.js.map +1 -0
- package/dist/preact/index.js +1 -1
- package/dist/preact-bundled/index.js +9002 -5089
- package/dist/preact-bundled/index.js.map +1 -1
- package/dist/react/index-DCKj0r6a.js +8545 -0
- package/dist/react/index-DCKj0r6a.js.map +1 -0
- package/dist/react/index.js +1 -1
- package/dist/react-bundled/index.js +9040 -5127
- package/dist/react-bundled/index.js.map +1 -1
- package/dist/types/components/LeafletDrawMapElement.d.ts +42 -3
- package/dist/types/django/index.d.ts +2 -2
- package/dist/types/external.d.ts +9 -3
- package/dist/types/index.d.ts +9 -3
- package/dist/types/lib/FeatureStore.d.ts +2 -2
- package/dist/types/lib/LayerRegistry.d.ts +19 -0
- package/dist/types/lib/MapController.d.ts +95 -5
- package/dist/types/lib/draw/L.Draw.Move.d.ts +1 -0
- package/dist/types/lib/draw/move-pointer.d.ts +12 -0
- package/dist/types/lib/layer-cake/LayerCakeManager.d.ts +10 -2
- package/dist/types/lib/layer-style-panel.d.ts +3 -0
- package/dist/types/lib/marker-icons.d.ts +1 -1
- package/dist/types/lib/providers.d.ts +64 -0
- package/dist/types/lib/snapping.d.ts +30 -0
- package/dist/types/lib/tool-buttons.d.ts +3 -1
- package/dist/types/lib/tool-capabilities.d.ts +27 -0
- package/dist/types/lib/toolbar-accessibility.d.ts +3 -0
- package/dist/types/lib/toolbar-layout.d.ts +14 -0
- package/dist/types/lib/toolbar-styles.d.ts +2 -0
- package/dist/types/preact/core.d.ts +2 -2
- package/dist/types/preact/index.d.ts +2 -2
- package/dist/types/preact-bundled/index.d.ts +3 -3
- package/dist/types/react/core.d.ts +2 -2
- package/dist/types/react/index.d.ts +2 -2
- package/dist/types/react-bundled/index.d.ts +3 -3
- package/dist/types/types/events.d.ts +15 -1
- package/dist/types/types/layers.d.ts +65 -0
- package/dist/types/types/public.d.ts +160 -5
- package/dist/types/utils/geojson-pipeline.d.ts +51 -0
- package/dist/types/utils/geojson.d.ts +15 -2
- package/dist/types/utils/grower-geometry.d.ts +107 -0
- package/docs/accessibility.md +142 -0
- package/docs/api-reference.md +249 -0
- package/docs/custom-toolbar.md +168 -0
- package/docs/diagnostics.md +216 -0
- package/docs/geojson-pipelines.md +145 -0
- package/docs/google-maps-adapter-spike.md +77 -0
- package/docs/grower-geometry.md +237 -0
- package/docs/grower-measurement.md +23 -0
- package/docs/integration-recipes.md +301 -0
- package/docs/layers.md +136 -0
- package/docs/providers.md +191 -0
- package/docs/release-verification.md +75 -0
- package/docs/shims/django.md +102 -0
- package/docs/shims/preact.md +98 -0
- package/docs/shims/react.md +98 -0
- package/docs/snapping-and-measurements.md +42 -0
- package/docs/tool-capabilities.md +131 -0
- package/docs/tool-lifecycle.md +124 -0
- package/docs/toolbar-layout.md +158 -0
- package/docs/toolbar-styling.md +118 -0
- package/package.json +35 -3
- package/dist/preact/index-BMfJn-mD.js +0 -4632
- package/dist/preact/index-BMfJn-mD.js.map +0 -1
- package/dist/react/index-BMfJn-mD.js +0 -4632
- package/dist/react/index-BMfJn-mD.js.map +0 -1
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { Feature, FeatureCollection } from "geojson";
|
|
2
|
-
import type {
|
|
3
|
-
import {
|
|
4
|
-
import { type
|
|
2
|
+
import type { MapLayer, LayerStyle, LayerCakeSessionUpdate } from "../types/layers.js";
|
|
3
|
+
import type { GeoJSONImportOptions, GeoJSONExportOptions, LeafletDrawMapElementAPI, IntegratedToolEventEmitter, IntegratedToolHooks, MarkerIconConfig, MeasurementSystem, SnappingOptions, MeasurementOverlayOptions, ToolButtonConfig, ToolButtonName, ToolCapabilities, ToolToolbarGroupConfig, ToolTriggerOptions } from "../types/public.js";
|
|
4
|
+
import { type StatusEventDetail } from "../types/events.js";
|
|
5
|
+
import { type LogLevel } from "../utils/logger.js";
|
|
6
|
+
import type { BasemapAdapter, ProviderDiagnostics } from "../lib/providers.js";
|
|
5
7
|
import type * as LeafletNS from "leaflet";
|
|
6
8
|
export declare class LeafletDrawMapElement extends HTMLElement implements LeafletDrawMapElementAPI {
|
|
7
9
|
private _root;
|
|
@@ -36,9 +38,18 @@ export declare class LeafletDrawMapElement extends HTMLElement implements Leafle
|
|
|
36
38
|
private _markerIconConfig;
|
|
37
39
|
private _toolButtonConfig;
|
|
38
40
|
private _toolbarGroups;
|
|
41
|
+
private _snapping;
|
|
42
|
+
private _measurementOverlay;
|
|
43
|
+
private _internalToolEvents;
|
|
44
|
+
private _toolCommandSequence;
|
|
45
|
+
private _activeTool;
|
|
46
|
+
private _providerCapabilityError;
|
|
47
|
+
private _lastCapabilities;
|
|
48
|
+
private _configurationUpdate;
|
|
39
49
|
private _status;
|
|
40
50
|
private _externalToolTriggerListener;
|
|
41
51
|
private _externalToolDeactivateListener;
|
|
52
|
+
private _externalToolCommandListener;
|
|
42
53
|
constructor();
|
|
43
54
|
private _controlsFromAttributes;
|
|
44
55
|
private _mapConfig;
|
|
@@ -49,6 +60,13 @@ export declare class LeafletDrawMapElement extends HTMLElement implements Leafle
|
|
|
49
60
|
private _updateTileLayer;
|
|
50
61
|
private _handleTileProviderError;
|
|
51
62
|
private _emitTileProviderChanged;
|
|
63
|
+
private _toolProviderCapability;
|
|
64
|
+
/** Call after ready; reconnect restores attribute-configured raster tiles. */
|
|
65
|
+
setBasemapAdapter(adapter: BasemapAdapter | null): void;
|
|
66
|
+
getProviderDiagnostics(): ProviderDiagnostics | null;
|
|
67
|
+
getToolCapabilities(): ToolCapabilities;
|
|
68
|
+
setToolSelection(featureIds: readonly string[]): void;
|
|
69
|
+
private _emitToolCapabilities;
|
|
52
70
|
private _isMarkerIconAttribute;
|
|
53
71
|
private _effectiveMarkerIconConfig;
|
|
54
72
|
private _syncMarkerIconConfig;
|
|
@@ -95,6 +113,10 @@ export declare class LeafletDrawMapElement extends HTMLElement implements Leafle
|
|
|
95
113
|
set toolButtonConfig(v: ToolButtonConfig | null | undefined);
|
|
96
114
|
get toolbarGroups(): ToolToolbarGroupConfig[] | null | undefined;
|
|
97
115
|
set toolbarGroups(v: ToolToolbarGroupConfig[] | null | undefined);
|
|
116
|
+
get snapping(): SnappingOptions | null | undefined;
|
|
117
|
+
set snapping(value: SnappingOptions | null | undefined);
|
|
118
|
+
get measurementOverlay(): MeasurementOverlayOptions | null | undefined;
|
|
119
|
+
set measurementOverlay(value: MeasurementOverlayOptions | null | undefined);
|
|
98
120
|
get leafletInstance(): typeof LeafletNS | undefined;
|
|
99
121
|
set leafletInstance(v: typeof LeafletNS | undefined);
|
|
100
122
|
get toolHooks(): IntegratedToolHooks | undefined;
|
|
@@ -125,6 +147,12 @@ export declare class LeafletDrawMapElement extends HTMLElement implements Leafle
|
|
|
125
147
|
properties?: Record<string, any>;
|
|
126
148
|
}): Promise<string | null>;
|
|
127
149
|
setMeasurementUnits(system: MeasurementSystem): Promise<void>;
|
|
150
|
+
getSnappingOptions(): SnappingOptions | null;
|
|
151
|
+
getMeasurementOverlayOptions(): MeasurementOverlayOptions | null;
|
|
152
|
+
private _nextToolCommandId;
|
|
153
|
+
private _emitToolTriggerRequested;
|
|
154
|
+
private _baseToolEventDetail;
|
|
155
|
+
private _emitStandaloneToolFailure;
|
|
128
156
|
activateTool(tool: ToolButtonName, options?: ToolTriggerOptions): Promise<boolean>;
|
|
129
157
|
triggerTool(tool: ToolButtonName, options?: ToolTriggerOptions): Promise<boolean>;
|
|
130
158
|
deactivateTool(options?: ToolTriggerOptions): Promise<boolean>;
|
|
@@ -132,10 +160,21 @@ export declare class LeafletDrawMapElement extends HTMLElement implements Leafle
|
|
|
132
160
|
loadGeoJSONFromText(text: string, options?: GeoJSONImportOptions): Promise<void>;
|
|
133
161
|
private _setImportLoadingStatus;
|
|
134
162
|
private _performImport;
|
|
163
|
+
getLayers(): MapLayer[];
|
|
164
|
+
setLayerVisibility(id: string, visible: boolean): Promise<void>;
|
|
165
|
+
setLayerStyle(id: string, style: LayerStyle): Promise<void>;
|
|
166
|
+
reorderLayers(ids: readonly string[]): Promise<void>;
|
|
167
|
+
focusLayer(id: string): Promise<void>;
|
|
168
|
+
removeLayer(id: string): Promise<void>;
|
|
169
|
+
getLayerCakeSession(): import("../types/layers.js").LayerCakeSession | null;
|
|
170
|
+
updateLayerCakeSession(update: LayerCakeSessionUpdate): Promise<void>;
|
|
171
|
+
saveLayerCakeSession(): Promise<void>;
|
|
172
|
+
cancelLayerCakeSession(): Promise<void>;
|
|
135
173
|
private _importWithController;
|
|
136
174
|
private _exportWithController;
|
|
137
175
|
private _currentConfig;
|
|
138
176
|
private _applyThemeStyles;
|
|
177
|
+
private _emitToolLifecycleEvent;
|
|
139
178
|
private _emitToolTriggerResult;
|
|
140
179
|
private _syncStatusFromController;
|
|
141
180
|
private _emitError;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../index";
|
|
2
|
-
import type { LeafletDrawMapElement } from "../components/LeafletDrawMapElement";
|
|
1
|
+
import "../index.js";
|
|
2
|
+
import type { LeafletDrawMapElement } from "../components/LeafletDrawMapElement.js";
|
|
3
3
|
export type DjangoShimPhase = "mount" | "parse" | "sync";
|
|
4
4
|
export interface DjangoShimErrorContext {
|
|
5
5
|
phase: DjangoShimPhase;
|
package/dist/types/external.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import { LeafletDrawMapElement } from "./components/LeafletDrawMapElement";
|
|
1
|
+
import { LeafletDrawMapElement } from "./components/LeafletDrawMapElement.js";
|
|
2
2
|
export { LeafletDrawMapElement };
|
|
3
|
-
export * from "./types/public";
|
|
4
|
-
export * from "./types/events";
|
|
3
|
+
export * from "./types/public.js";
|
|
4
|
+
export * from "./types/events.js";
|
|
5
|
+
export * from "./utils/geojson-pipeline.js";
|
|
6
|
+
export * from "./lib/providers.js";
|
|
7
|
+
export { GROWER_PRESETS, boundingBoxGeoJSON, bufferGeoJSON, centroidGeoJSON, createBedWidthGuides, createIrrigationZones, createRowSpacingGuides, formatMeasurements, measureGeoJSON, mergeGeoJSON, simplifyGeoJSON, splitGeoJSON, } from "./utils/grower-geometry.js";
|
|
8
|
+
export type { AreaUnit, BufferedGeoJSON, DistanceUnit, FormattedGeoJSONMeasurements, FormattedQuantity, GeoJSONMeasurements, GrowerGeometryError, GrowerGeometryErrorCode, GrowerGeometryResult, IrrigationZoneOptions, MeasurementFormatOptions, RowSpacingGuideOptions, SimplifyGeoJSONOptions, SplitterGeometry, SupportedGeoJSON, } from "./utils/grower-geometry.js";
|
|
9
|
+
export { findSnap } from "./lib/snapping.js";
|
|
10
|
+
export type { SnapLatLng, SnapResult, SnapScreenPoint, SnapTarget, } from "./lib/snapping.js";
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import { LeafletDrawMapElement } from "./components/LeafletDrawMapElement";
|
|
1
|
+
import { LeafletDrawMapElement } from "./components/LeafletDrawMapElement.js";
|
|
2
2
|
export { LeafletDrawMapElement };
|
|
3
|
-
export * from "./types/public";
|
|
4
|
-
export * from "./types/events";
|
|
3
|
+
export * from "./types/public.js";
|
|
4
|
+
export * from "./types/events.js";
|
|
5
|
+
export * from "./utils/geojson-pipeline.js";
|
|
6
|
+
export * from "./lib/providers.js";
|
|
7
|
+
export { GROWER_PRESETS, boundingBoxGeoJSON, bufferGeoJSON, centroidGeoJSON, createBedWidthGuides, createIrrigationZones, createRowSpacingGuides, formatMeasurements, measureGeoJSON, mergeGeoJSON, simplifyGeoJSON, splitGeoJSON, } from "./utils/grower-geometry.js";
|
|
8
|
+
export type { AreaUnit, BufferedGeoJSON, DistanceUnit, FormattedGeoJSONMeasurements, FormattedQuantity, GeoJSONMeasurements, GrowerGeometryError, GrowerGeometryErrorCode, GrowerGeometryResult, IrrigationZoneOptions, MeasurementFormatOptions, RowSpacingGuideOptions, SimplifyGeoJSONOptions, SplitterGeometry, SupportedGeoJSON, } from "./utils/grower-geometry.js";
|
|
9
|
+
export { findSnap } from "./lib/snapping.js";
|
|
10
|
+
export type { SnapLatLng, SnapResult, SnapScreenPoint, SnapTarget, } from "./lib/snapping.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Feature, FeatureCollection } from "geojson";
|
|
2
|
-
import { type BoundsPair } from "../utils/geojson";
|
|
3
|
-
import { type Logger } from "../utils/logger";
|
|
2
|
+
import { type BoundsPair } from "../utils/geojson.js";
|
|
3
|
+
import { type Logger } from "../utils/logger.js";
|
|
4
4
|
/**
|
|
5
5
|
* FeatureStore
|
|
6
6
|
* - Maintains a stable, id-centric in-memory FeatureCollection
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { LayerDefinition, LayerKind, LayerSnapshot, LayerStyle, MapLayer } from "../types/layers.js";
|
|
2
|
+
export declare function validateLayerStyle(value: LayerStyle): LayerStyle;
|
|
3
|
+
/** Framework- and renderer-independent registry. All returned values are detached. */
|
|
4
|
+
export declare class LayerRegistry {
|
|
5
|
+
private layers;
|
|
6
|
+
getLayers(): MapLayer[];
|
|
7
|
+
get(id: string): MapLayer;
|
|
8
|
+
add(featureIds: string[], definition?: LayerDefinition, kind?: LayerKind): string;
|
|
9
|
+
setLayerVisibility(id: string, visible: boolean): void;
|
|
10
|
+
setLayerStyle(id: string, style: LayerStyle): void;
|
|
11
|
+
reorderLayers(ids: readonly string[]): void;
|
|
12
|
+
removeLayer(id: string): void;
|
|
13
|
+
removeFeature(id: string): void;
|
|
14
|
+
clearData(): void;
|
|
15
|
+
snapshot(): LayerSnapshot;
|
|
16
|
+
/** Validate everything before mutation, including unique membership and known feature ids. */
|
|
17
|
+
static parseSnapshot(value: unknown, featureIds: readonly string[]): LayerSnapshot;
|
|
18
|
+
restore(snapshot: LayerSnapshot): void;
|
|
19
|
+
}
|
|
@@ -2,12 +2,17 @@ import * as BundledL from "leaflet";
|
|
|
2
2
|
import "leaflet-draw";
|
|
3
3
|
import "leaflet-ruler";
|
|
4
4
|
import type { Feature, FeatureCollection } from "geojson";
|
|
5
|
-
import type { DrawControlsConfig, GeoJSONExportOptions, GeoJSONImportOptions, MapConfig, MeasurementSystem, IntegratedToolEventEmitter, IntegratedToolHooks, ToolButtonConfig, ToolButtonName, ToolToolbarGroupConfig, ToolTriggerEventDetail, ToolTriggerOptions } from "../types/public";
|
|
6
|
-
import type { ErrorEventDetail } from "../types/events";
|
|
7
|
-
import { type Logger } from "../utils/logger";
|
|
8
|
-
import {
|
|
9
|
-
import type
|
|
5
|
+
import type { DrawControlsConfig, GeoJSONExportOptions, GeoJSONImportOptions, MapConfig, MeasurementSystem, SnappingOptions, MeasurementOverlayOptions, IntegratedToolEventEmitter, IntegratedToolHooks, ToolButtonConfig, ToolButtonName, ToolCapabilities, ToolProviderCapability, ToolCommandEventDetail, ToolEventDetail, ToolLifecycleEventName, ToolToolbarGroupConfig, ToolTriggerEventDetail, ToolTriggerOptions } from "../types/public.js";
|
|
6
|
+
import type { ErrorEventDetail } from "../types/events.js";
|
|
7
|
+
import { type Logger } from "../utils/logger.js";
|
|
8
|
+
import type { MapLayer, LayerStyle, LayerCakeSessionUpdate, LayerStyleRequestDetail } from "../types/layers.js";
|
|
9
|
+
import { type NormalizedMarkerIconConfig } from "../lib/marker-icons.js";
|
|
10
|
+
import type { TileURLTemplate } from "../lib/TileProviderFactory.js";
|
|
11
|
+
import type { BasemapAdapter, ProviderDiagnostics } from "../lib/providers.js";
|
|
10
12
|
export interface MapControllerCallbacks {
|
|
13
|
+
onLayerEvent?: (name: string, detail: unknown) => void;
|
|
14
|
+
onLayerStyleRequested?: (detail: LayerStyleRequestDetail) => boolean;
|
|
15
|
+
onToolCapabilitiesChanged?: (detail: ToolCapabilities) => void;
|
|
11
16
|
onReady?: (detail: {
|
|
12
17
|
bounds?: [[number, number], [number, number]];
|
|
13
18
|
}) => void;
|
|
@@ -27,6 +32,7 @@ export interface MapControllerCallbacks {
|
|
|
27
32
|
onError?: (detail: ErrorEventDetail) => void;
|
|
28
33
|
onTileError?: (error: unknown) => void;
|
|
29
34
|
onToolTrigger?: (detail: ToolTriggerEventDetail) => void;
|
|
35
|
+
onToolEvent?: (eventName: ToolLifecycleEventName, detail: ToolEventDetail) => void;
|
|
30
36
|
onSaved?: (detail: {
|
|
31
37
|
geoJSON: FeatureCollection;
|
|
32
38
|
featureCount: number;
|
|
@@ -53,6 +59,10 @@ export interface MapControllerOptions {
|
|
|
53
59
|
toolButtonConfig?: ToolButtonConfig | null;
|
|
54
60
|
/** Optional additional toolbar groups rendered over the map. */
|
|
55
61
|
toolbarGroups?: ToolToolbarGroupConfig[] | null;
|
|
62
|
+
/** Opt-in screen-space snapping for drawing and vertex editing. */
|
|
63
|
+
snapping?: SnappingOptions | null;
|
|
64
|
+
/** Opt-in live length/area/perimeter feedback while drawing or editing. */
|
|
65
|
+
measurementOverlay?: MeasurementOverlayOptions | null;
|
|
56
66
|
}
|
|
57
67
|
interface TileLayerCallbacks {
|
|
58
68
|
onTileError?: (error: unknown) => void;
|
|
@@ -66,8 +76,13 @@ export declare class MapController {
|
|
|
66
76
|
private options;
|
|
67
77
|
private L;
|
|
68
78
|
private store;
|
|
79
|
+
private layerRegistry;
|
|
80
|
+
private featureLayers;
|
|
81
|
+
private closeLayerStylePanel;
|
|
69
82
|
private map;
|
|
70
83
|
private tileLayer;
|
|
84
|
+
private adapterAttribution;
|
|
85
|
+
private providerDiagnostics;
|
|
71
86
|
private drawnItems;
|
|
72
87
|
private drawControl;
|
|
73
88
|
private rulerControl;
|
|
@@ -82,14 +97,48 @@ export declare class MapController {
|
|
|
82
97
|
private vertexMenuCleanup;
|
|
83
98
|
private vertexEditSurfaceCleanup;
|
|
84
99
|
private activeCakeSession;
|
|
100
|
+
private cakeSessionCommand;
|
|
85
101
|
private moveConfirmationUI;
|
|
86
102
|
private activeMoveHandler;
|
|
87
103
|
private markerIconConfig;
|
|
88
104
|
private markerIcon;
|
|
89
105
|
private toolButtonConfig;
|
|
90
106
|
private toolbarGroups;
|
|
107
|
+
private activeToolCommand;
|
|
108
|
+
private pendingToolCommand;
|
|
109
|
+
private observedNativeToolbarCommand;
|
|
110
|
+
private commandSequence;
|
|
111
|
+
private toolErrors;
|
|
112
|
+
private toolSelection;
|
|
113
|
+
private toolProvider;
|
|
114
|
+
private capabilityNotificationPending;
|
|
115
|
+
private lastCapabilities;
|
|
116
|
+
private toolEscapeKeyHandler;
|
|
117
|
+
private measurementPreviousFocus;
|
|
118
|
+
private snappingOptions;
|
|
119
|
+
private measurementOverlayOptions;
|
|
120
|
+
private interactionCleanup;
|
|
121
|
+
private measurementOverlayElement;
|
|
122
|
+
private snapFeedbackMarker;
|
|
123
|
+
private lastMeasurementFeature;
|
|
124
|
+
private lastMeasurementLatLng;
|
|
91
125
|
private emitToolEvent;
|
|
92
126
|
constructor(opts: MapControllerOptions);
|
|
127
|
+
private nextCommandId;
|
|
128
|
+
getToolCapabilities(): ToolCapabilities;
|
|
129
|
+
setToolSelection(ids: readonly string[]): void;
|
|
130
|
+
setToolProvider(provider: ToolProviderCapability): void;
|
|
131
|
+
/** Update structural options before rebuilding, retaining the existing feature store. */
|
|
132
|
+
configure(map: MapConfig, controls: DrawControlsConfig): void;
|
|
133
|
+
private notifyToolCapabilities;
|
|
134
|
+
private toolEventDetail;
|
|
135
|
+
private emitToolLifecycle;
|
|
136
|
+
private beginToolCommand;
|
|
137
|
+
private startPersistentTool;
|
|
138
|
+
private clearActiveTool;
|
|
139
|
+
private cancelActiveTool;
|
|
140
|
+
private completeActiveTool;
|
|
141
|
+
private failToolCommand;
|
|
93
142
|
setToolObservers(options: {
|
|
94
143
|
toolHooks?: IntegratedToolHooks;
|
|
95
144
|
toolEventEmitter?: IntegratedToolEventEmitter;
|
|
@@ -99,13 +148,33 @@ export declare class MapController {
|
|
|
99
148
|
syncDrawControl?: boolean;
|
|
100
149
|
}): void;
|
|
101
150
|
setToolButtonConfig(config: ToolButtonConfig | null | undefined): void;
|
|
151
|
+
setSnappingOptions(options: SnappingOptions | null | undefined): void;
|
|
152
|
+
getSnappingOptions(): SnappingOptions | null;
|
|
153
|
+
setMeasurementOverlayOptions(options: MeasurementOverlayOptions | null | undefined): void;
|
|
154
|
+
getMeasurementOverlayOptions(): MeasurementOverlayOptions | null;
|
|
102
155
|
setToolbarGroups(groups: ToolToolbarGroupConfig[] | null | undefined): void;
|
|
103
156
|
activateTool(tool: ToolButtonName, options?: ToolTriggerOptions): boolean;
|
|
104
157
|
triggerTool(tool: ToolButtonName, options?: ToolTriggerOptions): boolean;
|
|
105
158
|
deactivateTool(options?: ToolTriggerOptions): boolean;
|
|
159
|
+
handleToolCommand(detail: ToolCommandEventDetail): boolean;
|
|
160
|
+
private executeToolCommand;
|
|
161
|
+
private preparePersistentTool;
|
|
162
|
+
private disablePhysicalTool;
|
|
106
163
|
private resolveLeaflet;
|
|
107
164
|
init(): Promise<void>;
|
|
108
165
|
destroy(): Promise<void>;
|
|
166
|
+
getLayers(): MapLayer[];
|
|
167
|
+
private applyLayerRegistry;
|
|
168
|
+
setLayerVisibility(id: string, visible: boolean): void;
|
|
169
|
+
setLayerStyle(id: string, style: LayerStyle): void;
|
|
170
|
+
reorderLayers(ids: readonly string[]): void;
|
|
171
|
+
focusLayer(id: string): Promise<void>;
|
|
172
|
+
removeLayer(id: string): Promise<void>;
|
|
173
|
+
getLayerCakeSession(): import("../types/layers.js").LayerCakeSession | null;
|
|
174
|
+
updateLayerCakeSession(update: LayerCakeSessionUpdate): void;
|
|
175
|
+
saveLayerCakeSession(): void;
|
|
176
|
+
cancelLayerCakeSession(): void;
|
|
177
|
+
private emitCakeEvent;
|
|
109
178
|
getGeoJSON(): Promise<FeatureCollection>;
|
|
110
179
|
exportGeoJSON(options?: GeoJSONExportOptions): Promise<FeatureCollection>;
|
|
111
180
|
importGeoJSON(fc: FeatureCollection, options?: GeoJSONImportOptions): Promise<string[]>;
|
|
@@ -117,6 +186,9 @@ export declare class MapController {
|
|
|
117
186
|
fitBoundsToData(paddingRatio?: number): Promise<void>;
|
|
118
187
|
fitBounds(boundsTuple: [[number, number], [number, number]], paddingRatio?: number): Promise<void>;
|
|
119
188
|
setView(lat: number, lng: number, zoom?: number): Promise<void>;
|
|
189
|
+
getProviderDiagnostics(): ProviderDiagnostics | null;
|
|
190
|
+
/** Basemap-only swap: preserve the map, drawing engine and feature store. */
|
|
191
|
+
setBasemapAdapter(adapter: BasemapAdapter): void;
|
|
120
192
|
setTileLayer(config: TileURLTemplate, callbacks?: TileLayerCallbacks): void;
|
|
121
193
|
/**
|
|
122
194
|
* Merge all visible polygon features into a single polygon feature.
|
|
@@ -140,9 +212,16 @@ export declare class MapController {
|
|
|
140
212
|
private syncDrawMarkerOptions;
|
|
141
213
|
private reapplyMarkerIconsToExistingLayers;
|
|
142
214
|
private applyToolButtonCustomizations;
|
|
215
|
+
private handleToolbarTrigger;
|
|
216
|
+
private observePersistentToolStart;
|
|
217
|
+
private cleanupSupersededNativeTool;
|
|
218
|
+
private handlePersistentToolStop;
|
|
219
|
+
private failActiveTool;
|
|
143
220
|
private emitToolTrigger;
|
|
144
221
|
private findLeafletDrawHandler;
|
|
145
222
|
private disableActiveToolHandlers;
|
|
223
|
+
private canTriggerRulerTool;
|
|
224
|
+
private isRulerActive;
|
|
146
225
|
private triggerRulerTool;
|
|
147
226
|
private applyLayerCakeToolbarIcon;
|
|
148
227
|
private applyMoveToolbarIcon;
|
|
@@ -164,6 +243,17 @@ export declare class MapController {
|
|
|
164
243
|
*/
|
|
165
244
|
private installPolygonFinishPatch;
|
|
166
245
|
private patchLeafletDrawBugs;
|
|
246
|
+
private getSnapTargets;
|
|
247
|
+
private findSnapResult;
|
|
248
|
+
private eventLatLng;
|
|
249
|
+
private showSnapFeedback;
|
|
250
|
+
private geometryFeatureForHandler;
|
|
251
|
+
private renderMeasurement;
|
|
252
|
+
private refreshMeasurementOverlay;
|
|
253
|
+
private hideLiveOverlays;
|
|
254
|
+
private installEditMarkerSnap;
|
|
255
|
+
private installEditHandlerSnap;
|
|
256
|
+
private installInteractionIntegrations;
|
|
167
257
|
private bindDrawEvents;
|
|
168
258
|
private _error;
|
|
169
259
|
private installVertexEditSurfaceMenu;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type * as L from "leaflet";
|
|
2
|
+
/** One pointer transport for bundled and host-provided Leaflet runtimes.
|
|
3
|
+
* Capture on the stable map container, not a path which can leave the SVG viewport.
|
|
4
|
+
* No compatibility mouse listeners: preventDefault on pointerdown suppresses them.
|
|
5
|
+
*/
|
|
6
|
+
export declare function bindMovePointer(map: L.Map, layers: L.FeatureGroup, handlers: {
|
|
7
|
+
start: (event: L.LeafletMouseEvent) => void;
|
|
8
|
+
move: (event: L.LeafletMouseEvent) => void;
|
|
9
|
+
end: (event: L.LeafletMouseEvent) => void;
|
|
10
|
+
cancel: () => void;
|
|
11
|
+
pending: () => boolean;
|
|
12
|
+
}): () => void;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as L from "leaflet";
|
|
2
|
-
import type { MeasurementSystem } from "../../types/public";
|
|
2
|
+
import type { MeasurementSystem } from "../../types/public.js";
|
|
3
|
+
import { type LayerCakeSession, type LayerCakeSessionUpdate } from "../../types/layers.js";
|
|
3
4
|
export declare class LayerCakeManager {
|
|
5
|
+
private onChange?;
|
|
4
6
|
private map;
|
|
5
7
|
private layers;
|
|
6
8
|
private controlsGroup;
|
|
@@ -10,11 +12,17 @@ export declare class LayerCakeManager {
|
|
|
10
12
|
private detachMapListeners;
|
|
11
13
|
private renderScheduled;
|
|
12
14
|
private measurementSystem;
|
|
13
|
-
|
|
15
|
+
private name;
|
|
16
|
+
private style;
|
|
17
|
+
private destroyed;
|
|
18
|
+
private saving;
|
|
19
|
+
constructor(map: L.Map, initialCircle: L.Circle, onSave: (geojson: GeoJSON.FeatureCollection) => void, measurementSystem?: MeasurementSystem, onChange?: ((session: LayerCakeSession) => void) | undefined);
|
|
14
20
|
private installEditEventBridges;
|
|
15
21
|
private requestRenderControls;
|
|
16
22
|
private addLayer;
|
|
17
23
|
addRing(): void;
|
|
24
|
+
snapshot(): LayerCakeSession;
|
|
25
|
+
update(update: LayerCakeSessionUpdate): void;
|
|
18
26
|
save(): void;
|
|
19
27
|
private getLargestCircle;
|
|
20
28
|
private syncCenters;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type MapLayer, type LayerStyle } from "../types/layers.js";
|
|
2
|
+
/** Small default panel. Hosts can cancel the public request and render their own. */
|
|
3
|
+
export declare function openLayerStylePanel(root: HTMLElement, layers: MapLayer[], apply: (id: string, style: LayerStyle) => void): () => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MarkerIconConfig, MarkerIconPoint } from "../types/public";
|
|
1
|
+
import type { MarkerIconConfig, MarkerIconPoint } from "../types/public.js";
|
|
2
2
|
export declare const DEFAULT_MARKER_ICON_SIZE: MarkerIconPoint;
|
|
3
3
|
export declare const DEFAULT_MARKER_ICON_ANCHOR: MarkerIconPoint;
|
|
4
4
|
export declare const DEFAULT_MARKER_POPUP_ANCHOR: MarkerIconPoint;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type * as Leaflet from "leaflet";
|
|
2
|
+
import type { TileProviderConfig, TileURLTemplate } from "./TileProviderFactory.js";
|
|
3
|
+
/** Technical potential is not a license to cache a vendor's data. */
|
|
4
|
+
export type OfflineSupport = "unsupported" | "host-managed" | "unknown";
|
|
5
|
+
export type ApiKeyRequirement = "none" | "required" | "host-defined";
|
|
6
|
+
export interface ProviderCapabilities {
|
|
7
|
+
attributionRequired: boolean;
|
|
8
|
+
offline: OfflineSupport;
|
|
9
|
+
apiKey: ApiKeyRequirement;
|
|
10
|
+
}
|
|
11
|
+
/** Raster resolution does not own the map or drawing engine. */
|
|
12
|
+
export interface RasterTileProvider {
|
|
13
|
+
kind: "raster";
|
|
14
|
+
capabilities: ProviderCapabilities;
|
|
15
|
+
resolve(): TileURLTemplate;
|
|
16
|
+
}
|
|
17
|
+
/** An optional renderer bridge must return a fresh, unmounted Leaflet layer.
|
|
18
|
+
* The layer owns renderer/event cleanup in onRemove. Global protocols are host-owned.
|
|
19
|
+
*/
|
|
20
|
+
export interface VectorBasemapProvider {
|
|
21
|
+
kind: "vector";
|
|
22
|
+
capabilities: ProviderCapabilities;
|
|
23
|
+
createLayer(leaflet: typeof Leaflet): Leaflet.Layer;
|
|
24
|
+
}
|
|
25
|
+
export type BasemapProvider = RasterTileProvider | VectorBasemapProvider;
|
|
26
|
+
/** Drawing is independent of basemap vendors; native renderer replacements
|
|
27
|
+
* must implement this separate port before claiming drawing parity.
|
|
28
|
+
*/
|
|
29
|
+
export interface DrawEngineAdapter<TContext, TDocument, TCommand> {
|
|
30
|
+
attach(context: TContext): void;
|
|
31
|
+
read(): TDocument;
|
|
32
|
+
write(document: TDocument): void;
|
|
33
|
+
execute(command: TCommand): boolean;
|
|
34
|
+
dispose(): void;
|
|
35
|
+
}
|
|
36
|
+
export interface ProviderDiagnostics {
|
|
37
|
+
kind: "raster" | "vector";
|
|
38
|
+
attribution: "present" | "missing";
|
|
39
|
+
attributionRequired: boolean;
|
|
40
|
+
offline: OfflineSupport;
|
|
41
|
+
apiKey: ApiKeyRequirement;
|
|
42
|
+
drawing: "leaflet-draw";
|
|
43
|
+
/** Static capability report, not a network/credentials/renderer health probe. */
|
|
44
|
+
scope: "configuration";
|
|
45
|
+
}
|
|
46
|
+
/** Explicit field selection: never return URL, style, key, or arbitrary provider metadata. */
|
|
47
|
+
export declare function getProviderDiagnostics(provider: BasemapProvider, attribution: string): ProviderDiagnostics;
|
|
48
|
+
export declare function createRasterProvider(config: TileProviderConfig): RasterTileProvider;
|
|
49
|
+
/** Existing custom tile-url behavior, without guessing licensing or authentication. */
|
|
50
|
+
export declare function createCustomRasterProvider(config: TileURLTemplate): RasterTileProvider;
|
|
51
|
+
export interface BasemapAdapter {
|
|
52
|
+
provider: BasemapProvider;
|
|
53
|
+
/** Trusted host-supplied attribution HTML, never unsanitized remote input. */
|
|
54
|
+
attribution: string;
|
|
55
|
+
}
|
|
56
|
+
/** Feasibility shim: host injects a MapLibre-to-Leaflet bridge and owns PMTiles
|
|
57
|
+
* protocol registration. No MapLibre, PMTiles, Google SDK, or keys in core.
|
|
58
|
+
*/
|
|
59
|
+
export declare function createMapLibreBasemapAdapter(options: {
|
|
60
|
+
createLayer: (leaflet: typeof Leaflet) => Leaflet.Layer;
|
|
61
|
+
attribution: string;
|
|
62
|
+
offline?: OfflineSupport;
|
|
63
|
+
apiKey?: ApiKeyRequirement;
|
|
64
|
+
}): BasemapAdapter;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Feature } from "geojson";
|
|
2
|
+
import type { SnapMode, SnappingOptions } from "../types/public.js";
|
|
3
|
+
export interface SnapScreenPoint {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
}
|
|
7
|
+
export interface SnapLatLng {
|
|
8
|
+
lat: number;
|
|
9
|
+
lng: number;
|
|
10
|
+
}
|
|
11
|
+
export interface SnapTarget {
|
|
12
|
+
featureId: string;
|
|
13
|
+
layerId: string;
|
|
14
|
+
layerKind: string;
|
|
15
|
+
visible: boolean;
|
|
16
|
+
feature: Feature;
|
|
17
|
+
}
|
|
18
|
+
export interface SnapResult {
|
|
19
|
+
latlng: SnapLatLng;
|
|
20
|
+
point: SnapScreenPoint;
|
|
21
|
+
distancePx: number;
|
|
22
|
+
mode: SnapMode;
|
|
23
|
+
targetFeatureId?: string;
|
|
24
|
+
targetLayerId?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Find the closest candidate in rendered screen space. This deliberately receives
|
|
28
|
+
* projection functions so it can be unit-tested without a Leaflet map.
|
|
29
|
+
*/
|
|
30
|
+
export declare function findSnap(raw: SnapLatLng, targets: readonly SnapTarget[], project: (latlng: SnapLatLng) => SnapScreenPoint, unproject: (point: SnapScreenPoint) => SnapLatLng, options?: SnappingOptions, excludedFeatureId?: string): SnapResult | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ToolButtonConfig, ToolButtonName, ToolToolbarGroupConfig } from "../types/public";
|
|
1
|
+
import type { ToolButtonConfig, ToolButtonName, ToolToolbarGroupConfig } from "../types/public.js";
|
|
2
2
|
export interface ToolButtonTriggerContext {
|
|
3
3
|
source: "toolbar" | "leaflet-toolbar";
|
|
4
4
|
groupId?: string;
|
|
@@ -9,3 +9,5 @@ export interface ApplyToolButtonOptions {
|
|
|
9
9
|
onTrigger?: (tool: ToolButtonName, context: ToolButtonTriggerContext) => void;
|
|
10
10
|
}
|
|
11
11
|
export declare function applyToolButtonConfig(container: HTMLElement, config: ToolButtonConfig | null | undefined, options?: ApplyToolButtonOptions): void;
|
|
12
|
+
/** Reflect the controller's current mode, not just the last clicked button. */
|
|
13
|
+
export declare function setActiveToolbarTool(container: HTMLElement, tool: ToolButtonName | null): void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { DrawControlsConfig, ToolButtonConfig, ToolButtonName, ToolCapabilities, ToolCapability, ToolProviderCapability, ToolToolbarGroupConfig } from "../types/public.js";
|
|
2
|
+
interface ToolDefinition {
|
|
3
|
+
control?: keyof DrawControlsConfig;
|
|
4
|
+
attribute?: string;
|
|
5
|
+
behavior: ToolCapability["behavior"];
|
|
6
|
+
mutates?: boolean;
|
|
7
|
+
needsLayers?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/** Complete, compile-time checked inventory of the existing command bus. */
|
|
10
|
+
export declare const TOOL_REGISTRY: Record<ToolButtonName, ToolDefinition>;
|
|
11
|
+
export interface ToolCapabilityContext {
|
|
12
|
+
ready: boolean;
|
|
13
|
+
readOnly: boolean;
|
|
14
|
+
controls: DrawControlsConfig;
|
|
15
|
+
available: Partial<Record<ToolButtonName, boolean>>;
|
|
16
|
+
layerCount: number;
|
|
17
|
+
selectedFeatureIds: readonly string[];
|
|
18
|
+
activeTool: ToolButtonName | null;
|
|
19
|
+
config?: ToolButtonConfig | null;
|
|
20
|
+
groups?: ToolToolbarGroupConfig[] | null;
|
|
21
|
+
errors?: Partial<Record<ToolButtonName, string>>;
|
|
22
|
+
provider: ToolProviderCapability;
|
|
23
|
+
}
|
|
24
|
+
export declare function buildToolCapabilities(context: ToolCapabilityContext): ToolCapabilities;
|
|
25
|
+
/** Apply the same snapshot to managed controls that hosts consume. */
|
|
26
|
+
export declare function reflectToolCapabilities(container: HTMLElement, snapshot: ToolCapabilities): void;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare function installToolbarAccessibility(container: HTMLElement): void;
|
|
2
|
+
/** Persistent live regions: never inject HTML from tool errors or host labels. */
|
|
3
|
+
export declare function announceToolStatus(container: HTMLElement, message: string, error?: boolean): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ToolToolbarGroupConfig, ToolToolbarPosition, ToolToolbarZone } from "../types/public.js";
|
|
2
|
+
export declare function toolbarZone(position?: string): ToolToolbarZone;
|
|
3
|
+
export declare function usesToolbarLayout(group: ToolToolbarGroupConfig): boolean;
|
|
4
|
+
export declare function resolveToolbarPlacement(group: ToolToolbarGroupConfig, width: number): {
|
|
5
|
+
position: ToolToolbarPosition;
|
|
6
|
+
orientation: "vertical" | "horizontal";
|
|
7
|
+
order: number;
|
|
8
|
+
overflow: "wrap" | "scroll";
|
|
9
|
+
offset: [number, number];
|
|
10
|
+
};
|
|
11
|
+
export declare function createToolbarLayout(entries: {
|
|
12
|
+
element: HTMLElement;
|
|
13
|
+
config: ToolToolbarGroupConfig;
|
|
14
|
+
}[]): HTMLElement;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/** Public toolbar styling contract, also installed for external Leaflet runtimes. */
|
|
2
|
+
export declare const toolbarStyles = "\n.leaflet-geokit-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n}\ngeokit-toolbar-layout {\n position: absolute;\n z-index: var(--geokit-toolbar-z-index, 1000);\n inset: calc(var(--_geokit-native-top, 0px) + var(--geokit-safe-area-top, env(safe-area-inset-top, 0px)))\n var(--geokit-safe-area-right, env(safe-area-inset-right, 0px))\n calc(var(--_geokit-native-bottom, 0px) + var(--geokit-safe-area-bottom, env(safe-area-inset-bottom, 0px)))\n var(--geokit-safe-area-left, env(safe-area-inset-left, 0px));\n display: grid;\n grid-template-columns: repeat(2, minmax(0, 1fr));\n gap: var(--geokit-zone-gap, var(--_geokit-zone-gap, 8px));\n min-width: 0;\n min-height: 0;\n pointer-events: none;\n}\ngeokit-toolbar-layout[data-narrow=\"true\"] { grid-template-columns: minmax(0, 1fr); }\ngeokit-toolbar-layout[data-dense=\"true\"] { --_geokit-zone-gap: 4px; --_geokit-row-inset: 0px; --_geokit-toolbar-padding: 0px; }\n[data-geokit-zone] {\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n min-width: 0;\n min-height: 0;\n gap: var(--geokit-zone-gap, var(--_geokit-zone-gap, 8px));\n overflow: auto;\n pointer-events: none;\n}\n[data-geokit-zone][hidden] { display: none; }\n[data-geokit-zone$=\"start\"] { align-items: flex-start; }\n[data-geokit-zone^=\"bottom\"] { justify-content: safe flex-end; }\n[data-geokit-zone=\"center-end\"] { justify-content: safe center; }\ngeokit-toolbar-layout .leaflet-geokit-toolbar-group.leaflet-bar {\n position: relative;\n inset: auto;\n box-sizing: border-box;\n min-width: 0;\n min-height: 0;\n max-width: calc(100% - 2 * min(var(--geokit-toolbar-offset-x, var(--_geokit-layout-x, 10px)), 10%));\n max-height: calc(100% - 2 * min(var(--geokit-toolbar-offset-y, var(--_geokit-layout-y, 10px)), 10%));\n margin-inline: min(var(--geokit-toolbar-offset-x, var(--_geokit-layout-x, 10px)), 10%);\n margin-block: min(var(--geokit-toolbar-offset-y, var(--_geokit-layout-y, 10px)), var(--_geokit-row-inset, 10%));\n flex-wrap: var(--geokit-toolbar-wrap, var(--_geokit-wrap, wrap));\n order: var(--geokit-toolbar-order, var(--_geokit-order, 0));\n overflow: auto;\n pointer-events: auto;\n overscroll-behavior: contain;\n}\ngeokit-toolbar-layout[data-narrow=\"true\"] .leaflet-geokit-toolbar-group {\n --_geokit-touch-size: 48px;\n width: calc(100% - 2 * min(var(--geokit-toolbar-offset-x, var(--_geokit-layout-x, 10px)), 10%));\n}\n.leaflet-geokit-toolbar-group.leaflet-bar {\n position: absolute;\n z-index: var(--geokit-toolbar-z-index, 1000);\n display: flex;\n flex-direction: var(--geokit-toolbar-direction, var(--_geokit-direction, column));\n gap: var(--geokit-toolbar-gap, var(--_geokit-gap, 6px));\n padding: var(--geokit-toolbar-padding, var(--_geokit-toolbar-padding, 6px));\n border: var(--geokit-toolbar-border, 1px solid rgba(15, 23, 18, .16));\n border-radius: var(--geokit-toolbar-radius, 16px);\n background: var(--geokit-toolbar-background, rgba(255, 255, 255, .94));\n box-shadow: var(--geokit-toolbar-shadow, 0 1px 5px rgba(0, 0, 0, .35));\n}\n.leaflet-geokit-toolbar-group[data-geokit-toolbar-position^=\"top\"] {\n top: var(--geokit-toolbar-offset-y, var(--_geokit-offset-y, 10px));\n}\n.leaflet-geokit-toolbar-group[data-geokit-toolbar-position^=\"bottom\"] {\n bottom: var(--geokit-toolbar-offset-y, var(--_geokit-offset-y, 10px));\n}\n.leaflet-geokit-toolbar-group[data-geokit-toolbar-position$=\"left\"] {\n left: var(--geokit-toolbar-offset-x, var(--_geokit-offset-x, 10px));\n}\n.leaflet-geokit-toolbar-group[data-geokit-toolbar-position$=\"right\"] {\n right: var(--geokit-toolbar-offset-x, var(--_geokit-offset-x, 10px));\n}\n.leaflet-geokit-toolbar-button {\n touch-action: manipulation;\n box-sizing: border-box;\n flex: none;\n display: block;\n position: relative;\n width: var(--geokit-tool-size, var(--_geokit-touch-size, 44px));\n height: var(--geokit-tool-size, var(--_geokit-touch-size, 44px));\n padding: 0;\n border: var(--geokit-tool-border, 1px solid rgba(15, 23, 18, .18));\n border-radius: var(--geokit-tool-radius, 12px);\n background: var(--geokit-tool-background, #fff);\n color: var(--geokit-tool-color, #1f5134);\n box-shadow: var(--geokit-tool-shadow, 0 2px 6px rgba(15, 23, 18, .16));\n cursor: pointer;\n}\n.leaflet-geokit-toolbar-button:hover:not(:disabled),\n.leaflet-geokit-toolbar-button:focus-visible {\n background: var(--geokit-tool-hover-background, #f0f8ed);\n}\n.leaflet-geokit-toolbar-button[aria-pressed=\"true\"] {\n background: var(--geokit-tool-active-background, #dceddf);\n color: var(--geokit-tool-active-color, #16452b);\n box-shadow: inset 0 0 0 2px currentColor;\n}\n.leaflet-geokit-toolbar-button:focus-visible {\n outline: var(--geokit-tool-focus-ring, 2px solid #2f8f5f);\n outline-offset: 2px;\n}\n.leaflet-geokit-toolbar-button:disabled {\n opacity: var(--geokit-tool-disabled-opacity, .5);\n cursor: not-allowed;\n border-style: dashed;\n}\n.leaflet-geokit-tool-button-icon {\n position: absolute;\n display: block;\n left: 50%;\n top: 50%;\n width: var(--geokit-icon-size, var(--_geokit-icon-width, 18px));\n height: var(--geokit-icon-size, var(--_geokit-icon-height, 18px));\n transform: translate(-50%, -50%);\n pointer-events: none;\n}\n.leaflet-geokit-tool-button-icon > :not(slot),\n.leaflet-geokit-tool-button-icon > slot > *,\n.leaflet-geokit-tool-button-icon > slot::slotted(*) {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: contain;\n}\n.leaflet-geokit-tool-badge {\n position: absolute;\n right: -4px;\n top: -4px;\n pointer-events: none;\n color: var(--geokit-badge-color, #fff);\n background: var(--geokit-badge-background, #1f5134);\n border-radius: var(--geokit-badge-radius, 8px);\n font: 11px system-ui, sans-serif;\n}\n.leaflet-geokit-tool-tooltip {\n position: absolute;\n bottom: 100%;\n right: 0;\n width: max-content;\n max-width: 240px;\n padding: 4px 8px;\n visibility: hidden;\n pointer-events: none;\n z-index: var(--geokit-popover-z-index, 10001);\n color: var(--geokit-tooltip-color, #fff);\n background: var(--geokit-tooltip-background, #163323);\n border-radius: var(--geokit-tooltip-radius, 4px);\n font: 12px system-ui, sans-serif;\n}\n.leaflet-geokit-toolbar-button:hover .leaflet-geokit-tool-tooltip,\n.leaflet-geokit-toolbar-button:focus-visible .leaflet-geokit-tool-tooltip {\n visibility: visible;\n}\n[data-geokit-tool-popover=\"true\"] {\n position: absolute;\n z-index: var(--geokit-popover-z-index, 10001);\n max-width: var(--geokit-popover-max-width, 260px);\n padding: var(--geokit-popover-padding, 10px 12px);\n border: var(--geokit-popover-border, 1px solid rgba(0, 0, 0, .22));\n border-radius: var(--geokit-popover-radius, 8px);\n background: var(--geokit-popover-background, #fff);\n color: var(--geokit-popover-color, #163323);\n box-shadow: var(--geokit-popover-shadow, 0 8px 24px rgba(0, 0, 0, .24));\n font: var(--geokit-popover-font, 13px system-ui, sans-serif);\n line-height: 1.35;\n}\n[data-geokit-tool-popover=\"true\"] > strong {\n display: block;\n margin-bottom: 4px;\n}\n@media (prefers-reduced-motion: reduce) {\n [data-geokit-map-container] *, [data-geokit-map-container] *::before, [data-geokit-map-container] *::after {\n animation-duration: var(--geokit-reduced-motion-duration, 0s) !important;\n transition-duration: var(--geokit-reduced-motion-duration, 0s) !important;\n scroll-behavior: auto !important;\n }\n}\n@media (forced-colors: active), (prefers-contrast: more) {\n [data-geokit-map-container] {\n --geokit-toolbar-background: Canvas;\n --geokit-toolbar-border: 1px solid CanvasText;\n --geokit-tool-background: Canvas;\n --geokit-tool-color: CanvasText;\n --geokit-tool-border: 1px solid ButtonText;\n --geokit-tool-focus-ring: 3px solid Highlight;\n --geokit-tool-active-background: Highlight;\n --geokit-tool-active-color: HighlightText;\n --geokit-tool-hover-background: Canvas;\n --geokit-popover-background: Canvas;\n --geokit-popover-color: CanvasText;\n --geokit-popover-border: 1px solid CanvasText;\n --geokit-panel-background: Canvas;\n --geokit-panel-color: CanvasText;\n --geokit-tool-disabled-opacity: 1;\n }\n .leaflet-geokit-toolbar-button[aria-pressed=\"true\"] { outline: 2px solid Highlight; }\n}\n";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { LeafletDrawMapElement } from "../components/LeafletDrawMapElement";
|
|
2
|
-
import type { IntegratedToolEventEmitter, IntegratedToolHooks, ToolButtonConfig, ToolToolbarGroupConfig } from "../types/public";
|
|
1
|
+
import type { LeafletDrawMapElement } from "../components/LeafletDrawMapElement.js";
|
|
2
|
+
import type { IntegratedToolEventEmitter, IntegratedToolHooks, ToolButtonConfig, ToolToolbarGroupConfig } from "../types/public.js";
|
|
3
3
|
type Primitive = string | number | boolean | null | undefined;
|
|
4
4
|
type LeafletMode = "external" | "bundled";
|
|
5
5
|
export interface PreactLeafletGeoKitProps {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type PreactLeafletGeoKitProps } from "../preact/core";
|
|
1
|
+
import { type PreactLeafletGeoKitProps } from "../preact/core.js";
|
|
2
2
|
export type { PreactLeafletGeoKitProps };
|
|
3
3
|
export declare const PreactLeafletGeoKit: (props: PreactLeafletGeoKitProps) => import("preact").VNode<import("preact").Attributes & {
|
|
4
|
-
ref: import("preact/hooks").MutableRef<import("
|
|
4
|
+
ref: import("preact/hooks").MutableRef<import("../index.js").LeafletDrawMapElement | null>;
|
|
5
5
|
className: string | undefined;
|
|
6
6
|
style: string;
|
|
7
7
|
}>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "../index";
|
|
2
|
-
import { type PreactLeafletGeoKitProps } from "../preact/core";
|
|
1
|
+
import "../index.js";
|
|
2
|
+
import { type PreactLeafletGeoKitProps } from "../preact/core.js";
|
|
3
3
|
export type { PreactLeafletGeoKitProps };
|
|
4
4
|
export declare const PreactLeafletGeoKit: (props: PreactLeafletGeoKitProps) => import("preact").VNode<import("preact").Attributes & {
|
|
5
|
-
ref: import("preact/hooks").MutableRef<import("../index").LeafletDrawMapElement | null>;
|
|
5
|
+
ref: import("preact/hooks").MutableRef<import("../index.js").LeafletDrawMapElement | null>;
|
|
6
6
|
className: string | undefined;
|
|
7
7
|
style: string;
|
|
8
8
|
}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { LeafletDrawMapElement } from "../components/LeafletDrawMapElement";
|
|
3
|
-
import type { IntegratedToolEventEmitter, IntegratedToolHooks, ToolButtonConfig, ToolToolbarGroupConfig } from "../types/public";
|
|
2
|
+
import type { LeafletDrawMapElement } from "../components/LeafletDrawMapElement.js";
|
|
3
|
+
import type { IntegratedToolEventEmitter, IntegratedToolHooks, ToolButtonConfig, ToolToolbarGroupConfig } from "../types/public.js";
|
|
4
4
|
type Primitive = string | number | boolean | null | undefined;
|
|
5
5
|
type LeafletMode = "external" | "bundled";
|
|
6
6
|
export interface ReactLeafletGeoKitProps {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type ReactLeafletGeoKitProps } from "../react/core";
|
|
1
|
+
import { type ReactLeafletGeoKitProps } from "../react/core.js";
|
|
2
2
|
export type { ReactLeafletGeoKitProps };
|
|
3
3
|
export declare const ReactLeafletGeoKit: (props: ReactLeafletGeoKitProps) => import("react").ReactElement<{
|
|
4
|
-
ref: import("react").MutableRefObject<import("
|
|
4
|
+
ref: import("react").MutableRefObject<import("../index.js").LeafletDrawMapElement | null>;
|
|
5
5
|
className: string | undefined;
|
|
6
6
|
}, string | import("react").JSXElementConstructor<any>>;
|
|
7
7
|
export default ReactLeafletGeoKit;
|