@classic-homes/maps-react 0.1.4 → 0.1.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.
- package/dist/index.cjs +812 -144
- package/dist/index.d.cts +10 -3
- package/dist/index.d.ts +10 -3
- package/dist/index.js +723 -140
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React25 = require('react');
|
|
4
4
|
var clsx = require('clsx');
|
|
5
5
|
var tailwindMerge = require('tailwind-merge');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -12,6 +12,8 @@ var mapsCore = require('@classic-homes/maps-core');
|
|
|
12
12
|
var ReactDOM = require('react-dom');
|
|
13
13
|
var classVarianceAuthority = require('class-variance-authority');
|
|
14
14
|
require('@classic-homes/maps-core/styles/basemap-switcher.css');
|
|
15
|
+
require('@classic-homes/maps-core/styles/layer-manager.css');
|
|
16
|
+
var themeReact = require('@classic-homes/theme-react');
|
|
15
17
|
|
|
16
18
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
19
|
|
|
@@ -33,7 +35,7 @@ function _interopNamespace(e) {
|
|
|
33
35
|
return Object.freeze(n);
|
|
34
36
|
}
|
|
35
37
|
|
|
36
|
-
var
|
|
38
|
+
var React25__namespace = /*#__PURE__*/_interopNamespace(React25);
|
|
37
39
|
var maplibregl__default = /*#__PURE__*/_interopDefault(maplibregl);
|
|
38
40
|
var ReactDOM__namespace = /*#__PURE__*/_interopNamespace(ReactDOM);
|
|
39
41
|
|
|
@@ -41,7 +43,7 @@ var ReactDOM__namespace = /*#__PURE__*/_interopNamespace(ReactDOM);
|
|
|
41
43
|
function cn(...inputs) {
|
|
42
44
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
43
45
|
}
|
|
44
|
-
var MapSkeleton =
|
|
46
|
+
var MapSkeleton = React25__namespace.forwardRef(
|
|
45
47
|
({ height = 400, className, ...props }, ref) => {
|
|
46
48
|
const heightStyle = typeof height === "number" ? `${height}px` : height;
|
|
47
49
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -95,7 +97,7 @@ var MapSkeleton = React6__namespace.forwardRef(
|
|
|
95
97
|
}
|
|
96
98
|
);
|
|
97
99
|
MapSkeleton.displayName = "MapSkeleton";
|
|
98
|
-
var MapError =
|
|
100
|
+
var MapError = React25__namespace.forwardRef(
|
|
99
101
|
({ message = "Failed to load map", height = 400, onRetry, className, ...props }, ref) => {
|
|
100
102
|
const heightStyle = typeof height === "number" ? `${height}px` : height;
|
|
101
103
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -149,7 +151,7 @@ var MapError = React6__namespace.forwardRef(
|
|
|
149
151
|
}
|
|
150
152
|
);
|
|
151
153
|
MapError.displayName = "MapError";
|
|
152
|
-
var MapEmpty =
|
|
154
|
+
var MapEmpty = React25__namespace.forwardRef(
|
|
153
155
|
({ message = "No map data to display", height = 400, className, ...props }, ref) => {
|
|
154
156
|
const heightStyle = typeof height === "number" ? `${height}px` : height;
|
|
155
157
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -192,7 +194,7 @@ var MapEmpty = React6__namespace.forwardRef(
|
|
|
192
194
|
}
|
|
193
195
|
);
|
|
194
196
|
MapEmpty.displayName = "MapEmpty";
|
|
195
|
-
var MapContainer =
|
|
197
|
+
var MapContainer = React25__namespace.forwardRef(
|
|
196
198
|
({
|
|
197
199
|
title,
|
|
198
200
|
description,
|
|
@@ -241,8 +243,8 @@ var MapContainer = React6__namespace.forwardRef(
|
|
|
241
243
|
);
|
|
242
244
|
MapContainer.displayName = "MapContainer";
|
|
243
245
|
function useMapTheme(preference = "auto") {
|
|
244
|
-
const [isDark, setIsDark] =
|
|
245
|
-
const updateTheme =
|
|
246
|
+
const [isDark, setIsDark] = React25.useState(false);
|
|
247
|
+
const updateTheme = React25.useCallback(() => {
|
|
246
248
|
if (preference !== "auto") {
|
|
247
249
|
setIsDark(preference === "dark");
|
|
248
250
|
return;
|
|
@@ -252,7 +254,7 @@ function useMapTheme(preference = "auto") {
|
|
|
252
254
|
setIsDark(hasDarkClass);
|
|
253
255
|
}
|
|
254
256
|
}, [preference]);
|
|
255
|
-
|
|
257
|
+
React25.useEffect(() => {
|
|
256
258
|
updateTheme();
|
|
257
259
|
if (preference !== "auto" || typeof document === "undefined") return;
|
|
258
260
|
const observer = new MutationObserver((mutations) => {
|
|
@@ -282,8 +284,8 @@ function useMapTheme(preference = "auto") {
|
|
|
282
284
|
};
|
|
283
285
|
}
|
|
284
286
|
function useReducedMotion() {
|
|
285
|
-
const [prefersReducedMotion2, setPrefersReducedMotion] =
|
|
286
|
-
|
|
287
|
+
const [prefersReducedMotion2, setPrefersReducedMotion] = React25.useState(false);
|
|
288
|
+
React25.useEffect(() => {
|
|
287
289
|
if (typeof window === "undefined") return;
|
|
288
290
|
const mediaQuery = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
289
291
|
setPrefersReducedMotion(mediaQuery.matches);
|
|
@@ -297,9 +299,9 @@ function useReducedMotion() {
|
|
|
297
299
|
}, []);
|
|
298
300
|
return prefersReducedMotion2;
|
|
299
301
|
}
|
|
300
|
-
var MapContext =
|
|
302
|
+
var MapContext = React25__namespace.createContext(null);
|
|
301
303
|
function useMap() {
|
|
302
|
-
const context =
|
|
304
|
+
const context = React25__namespace.useContext(MapContext);
|
|
303
305
|
if (!context) {
|
|
304
306
|
throw new Error("useMap must be used within a Map component");
|
|
305
307
|
}
|
|
@@ -309,7 +311,7 @@ function useMapInstance() {
|
|
|
309
311
|
const { map, loaded } = useMap();
|
|
310
312
|
return loaded ? map : null;
|
|
311
313
|
}
|
|
312
|
-
var
|
|
314
|
+
var Map2 = React25__namespace.forwardRef(
|
|
313
315
|
({
|
|
314
316
|
// Base props
|
|
315
317
|
title,
|
|
@@ -363,33 +365,33 @@ var Map = React6__namespace.forwardRef(
|
|
|
363
365
|
onZoom,
|
|
364
366
|
onError
|
|
365
367
|
}, ref) => {
|
|
366
|
-
const containerRef =
|
|
367
|
-
const mapRef =
|
|
368
|
-
const [mapLoaded, setMapLoaded] =
|
|
369
|
-
const [mapError, setMapError] =
|
|
370
|
-
const [styleVersion, setStyleVersion] =
|
|
371
|
-
const activeStyleOverrideRef =
|
|
368
|
+
const containerRef = React25__namespace.useRef(null);
|
|
369
|
+
const mapRef = React25__namespace.useRef(null);
|
|
370
|
+
const [mapLoaded, setMapLoaded] = React25__namespace.useState(false);
|
|
371
|
+
const [mapError, setMapError] = React25__namespace.useState(null);
|
|
372
|
+
const [styleVersion, setStyleVersion] = React25__namespace.useState(0);
|
|
373
|
+
const activeStyleOverrideRef = React25__namespace.useRef(
|
|
372
374
|
null
|
|
373
375
|
);
|
|
374
|
-
const setMapStyle =
|
|
376
|
+
const setMapStyle = React25__namespace.useCallback((style) => {
|
|
375
377
|
activeStyleOverrideRef.current = style;
|
|
376
378
|
mapRef.current?.setStyle(style);
|
|
377
379
|
}, []);
|
|
378
|
-
const customControlRegistryRef =
|
|
380
|
+
const customControlRegistryRef = React25__namespace.useRef({
|
|
379
381
|
"top-left": [],
|
|
380
382
|
"top-right": [],
|
|
381
383
|
"bottom-left": [],
|
|
382
384
|
"bottom-right": []
|
|
383
385
|
});
|
|
384
|
-
const [, forceUpdate] =
|
|
386
|
+
const [, forceUpdate] = React25__namespace.useReducer((x) => x + 1, 0);
|
|
385
387
|
const prefersReducedMotion2 = useReducedMotion();
|
|
386
388
|
const { style: themeStyle } = useMapTheme(themePref);
|
|
387
|
-
const onLoadRef =
|
|
389
|
+
const onLoadRef = React25__namespace.useRef(onLoad);
|
|
388
390
|
onLoadRef.current = onLoad;
|
|
389
|
-
const onErrorRef =
|
|
391
|
+
const onErrorRef = React25__namespace.useRef(onError);
|
|
390
392
|
onErrorRef.current = onError;
|
|
391
393
|
const mapStyle = customStyle || themeStyle;
|
|
392
|
-
const controlOffsets =
|
|
394
|
+
const controlOffsets = React25__namespace.useMemo(() => {
|
|
393
395
|
const offsets = {
|
|
394
396
|
"top-left": 0,
|
|
395
397
|
"top-right": 0,
|
|
@@ -419,7 +421,7 @@ var Map = React6__namespace.forwardRef(
|
|
|
419
421
|
geolocateControl,
|
|
420
422
|
geolocateControlPosition
|
|
421
423
|
]);
|
|
422
|
-
const registerControl =
|
|
424
|
+
const registerControl = React25__namespace.useCallback(
|
|
423
425
|
(id, position, height2) => {
|
|
424
426
|
const registry = customControlRegistryRef.current;
|
|
425
427
|
const positionControls = registry[position] || [];
|
|
@@ -440,13 +442,13 @@ var Map = React6__namespace.forwardRef(
|
|
|
440
442
|
},
|
|
441
443
|
[]
|
|
442
444
|
);
|
|
443
|
-
const unregisterControl =
|
|
445
|
+
const unregisterControl = React25__namespace.useCallback((id, position) => {
|
|
444
446
|
const registry = customControlRegistryRef.current;
|
|
445
447
|
const positionControls = registry[position] || [];
|
|
446
448
|
registry[position] = positionControls.filter((c) => c.id !== id);
|
|
447
449
|
forceUpdate();
|
|
448
450
|
}, []);
|
|
449
|
-
const getCustomControlOffset =
|
|
451
|
+
const getCustomControlOffset = React25__namespace.useCallback((id, position) => {
|
|
450
452
|
const registry = customControlRegistryRef.current;
|
|
451
453
|
const positionControls = registry[position] || [];
|
|
452
454
|
let offset = 0;
|
|
@@ -460,7 +462,7 @@ var Map = React6__namespace.forwardRef(
|
|
|
460
462
|
center,
|
|
461
463
|
zoom
|
|
462
464
|
});
|
|
463
|
-
|
|
465
|
+
React25__namespace.useEffect(() => {
|
|
464
466
|
if (!containerRef.current || mapRef.current) return;
|
|
465
467
|
try {
|
|
466
468
|
const map = new maplibregl__default.default.Map({
|
|
@@ -540,8 +542,8 @@ var Map = React6__namespace.forwardRef(
|
|
|
540
542
|
onErrorRef.current?.({ type: "error", message: errorMessage, error: err });
|
|
541
543
|
}
|
|
542
544
|
}, []);
|
|
543
|
-
const styleInitialized =
|
|
544
|
-
|
|
545
|
+
const styleInitialized = React25__namespace.useRef(false);
|
|
546
|
+
React25__namespace.useEffect(() => {
|
|
545
547
|
if (!mapRef.current || !mapLoaded) return;
|
|
546
548
|
if (!styleInitialized.current) {
|
|
547
549
|
styleInitialized.current = true;
|
|
@@ -550,12 +552,12 @@ var Map = React6__namespace.forwardRef(
|
|
|
550
552
|
if (activeStyleOverrideRef.current) return;
|
|
551
553
|
mapRef.current.setStyle(mapStyle);
|
|
552
554
|
}, [mapStyle, mapLoaded]);
|
|
553
|
-
|
|
555
|
+
React25__namespace.useEffect(() => {
|
|
554
556
|
if (customStyle) {
|
|
555
557
|
activeStyleOverrideRef.current = null;
|
|
556
558
|
}
|
|
557
559
|
}, [customStyle]);
|
|
558
|
-
|
|
560
|
+
React25__namespace.useEffect(() => {
|
|
559
561
|
const map = mapRef.current;
|
|
560
562
|
if (!map || !mapLoaded) return;
|
|
561
563
|
const createEventParams = (e) => ({
|
|
@@ -689,7 +691,7 @@ var Map = React6__namespace.forwardRef(
|
|
|
689
691
|
);
|
|
690
692
|
}
|
|
691
693
|
);
|
|
692
|
-
|
|
694
|
+
Map2.displayName = "Map";
|
|
693
695
|
var Source = ({
|
|
694
696
|
id,
|
|
695
697
|
type,
|
|
@@ -710,9 +712,9 @@ var Source = ({
|
|
|
710
712
|
children
|
|
711
713
|
}) => {
|
|
712
714
|
const { map, loaded, styleVersion } = useMap();
|
|
713
|
-
const sourceAdded =
|
|
714
|
-
const initialFitDone =
|
|
715
|
-
const fitBoundsParamsRef =
|
|
715
|
+
const sourceAdded = React25__namespace.useRef(false);
|
|
716
|
+
const initialFitDone = React25__namespace.useRef(false);
|
|
717
|
+
const fitBoundsParamsRef = React25__namespace.useRef({
|
|
716
718
|
shouldFitBounds,
|
|
717
719
|
data,
|
|
718
720
|
fitBoundsPadding,
|
|
@@ -728,7 +730,7 @@ var Source = ({
|
|
|
728
730
|
fitBoundsAnimate,
|
|
729
731
|
type
|
|
730
732
|
};
|
|
731
|
-
const performFitBounds =
|
|
733
|
+
const performFitBounds = React25__namespace.useCallback(
|
|
732
734
|
(cancelledRef) => {
|
|
733
735
|
const params = fitBoundsParamsRef.current;
|
|
734
736
|
if (cancelledRef.current || !params.shouldFitBounds || initialFitDone.current) return;
|
|
@@ -772,7 +774,7 @@ var Source = ({
|
|
|
772
774
|
},
|
|
773
775
|
[map]
|
|
774
776
|
);
|
|
775
|
-
|
|
777
|
+
React25__namespace.useEffect(() => {
|
|
776
778
|
if (!map || !loaded || sourceAdded.current) return;
|
|
777
779
|
if (map.getSource(id)) {
|
|
778
780
|
sourceAdded.current = true;
|
|
@@ -922,24 +924,39 @@ var Source = ({
|
|
|
922
924
|
styleVersion
|
|
923
925
|
// re-add source after basemap style changes
|
|
924
926
|
]);
|
|
925
|
-
|
|
927
|
+
React25__namespace.useEffect(() => {
|
|
926
928
|
if (!map || !loaded || !sourceAdded.current || type !== "geojson") return;
|
|
927
929
|
const source = map.getSource(id);
|
|
928
930
|
if (!source) return;
|
|
931
|
+
let cancelled = false;
|
|
929
932
|
try {
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
933
|
+
const newData = typeof data === "string" ? data : data && typeof data === "object" ? data : null;
|
|
934
|
+
if (!newData) return;
|
|
935
|
+
const handleSourceData = (e) => {
|
|
936
|
+
if (cancelled) return;
|
|
937
|
+
if (e.sourceId === id && e.isSourceLoaded) {
|
|
938
|
+
map.off("sourcedata", handleSourceData);
|
|
939
|
+
map.triggerRepaint();
|
|
940
|
+
}
|
|
941
|
+
};
|
|
942
|
+
if (cluster) {
|
|
943
|
+
map.on("sourcedata", handleSourceData);
|
|
934
944
|
}
|
|
945
|
+
source.setData(newData);
|
|
946
|
+
return () => {
|
|
947
|
+
cancelled = true;
|
|
948
|
+
if (cluster) {
|
|
949
|
+
map.off("sourcedata", handleSourceData);
|
|
950
|
+
}
|
|
951
|
+
};
|
|
935
952
|
} catch (err) {
|
|
936
953
|
console.error(`[maps-react] Failed to update source "${id}" data:`, err);
|
|
937
954
|
}
|
|
938
|
-
}, [map, loaded, id, type, data]);
|
|
955
|
+
}, [map, loaded, id, type, data, cluster]);
|
|
939
956
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
940
957
|
};
|
|
941
958
|
Source.displayName = "Source";
|
|
942
|
-
var Marker =
|
|
959
|
+
var Marker = React25__namespace.forwardRef(
|
|
943
960
|
({
|
|
944
961
|
id,
|
|
945
962
|
coordinates,
|
|
@@ -955,27 +972,27 @@ var Marker = React6__namespace.forwardRef(
|
|
|
955
972
|
children
|
|
956
973
|
}, ref) => {
|
|
957
974
|
const { map, loaded } = useMap();
|
|
958
|
-
const markerRef =
|
|
959
|
-
const elementRef =
|
|
960
|
-
const originalLngLatRef =
|
|
961
|
-
const clickHandlerRef =
|
|
962
|
-
const [mounted, setMounted] =
|
|
963
|
-
const onClickRef =
|
|
975
|
+
const markerRef = React25__namespace.useRef(null);
|
|
976
|
+
const elementRef = React25__namespace.useRef(null);
|
|
977
|
+
const originalLngLatRef = React25__namespace.useRef();
|
|
978
|
+
const clickHandlerRef = React25__namespace.useRef(null);
|
|
979
|
+
const [mounted, setMounted] = React25__namespace.useState(false);
|
|
980
|
+
const onClickRef = React25__namespace.useRef(onClick);
|
|
964
981
|
onClickRef.current = onClick;
|
|
965
|
-
const onDragRef =
|
|
982
|
+
const onDragRef = React25__namespace.useRef(onDrag);
|
|
966
983
|
onDragRef.current = onDrag;
|
|
967
|
-
const onDragEndRef =
|
|
984
|
+
const onDragEndRef = React25__namespace.useRef(onDragEnd);
|
|
968
985
|
onDragEndRef.current = onDragEnd;
|
|
969
|
-
|
|
986
|
+
React25__namespace.useEffect(() => {
|
|
970
987
|
setMounted(true);
|
|
971
988
|
return () => setMounted(false);
|
|
972
989
|
}, []);
|
|
973
|
-
|
|
990
|
+
React25__namespace.useEffect(() => {
|
|
974
991
|
if (children && !elementRef.current) {
|
|
975
992
|
elementRef.current = document.createElement("div");
|
|
976
993
|
}
|
|
977
994
|
}, [children]);
|
|
978
|
-
|
|
995
|
+
React25__namespace.useEffect(() => {
|
|
979
996
|
if (!map || !loaded || !mounted) return;
|
|
980
997
|
if (markerRef.current) return;
|
|
981
998
|
const markerOptions = {
|
|
@@ -1059,17 +1076,17 @@ var Marker = React6__namespace.forwardRef(
|
|
|
1059
1076
|
}
|
|
1060
1077
|
};
|
|
1061
1078
|
}, [map, loaded, mounted]);
|
|
1062
|
-
|
|
1079
|
+
React25__namespace.useEffect(() => {
|
|
1063
1080
|
if (markerRef.current) {
|
|
1064
1081
|
markerRef.current.setLngLat(coordinates);
|
|
1065
1082
|
}
|
|
1066
1083
|
}, [coordinates]);
|
|
1067
|
-
|
|
1084
|
+
React25__namespace.useEffect(() => {
|
|
1068
1085
|
if (markerRef.current) {
|
|
1069
1086
|
markerRef.current.setDraggable(draggable);
|
|
1070
1087
|
}
|
|
1071
1088
|
}, [draggable]);
|
|
1072
|
-
|
|
1089
|
+
React25__namespace.useEffect(() => {
|
|
1073
1090
|
if (markerRef.current && rotation !== void 0) {
|
|
1074
1091
|
markerRef.current.setRotation(rotation);
|
|
1075
1092
|
}
|
|
@@ -1115,7 +1132,7 @@ function panToFitPopup(map, popup, padding) {
|
|
|
1115
1132
|
});
|
|
1116
1133
|
}
|
|
1117
1134
|
}
|
|
1118
|
-
var Popup =
|
|
1135
|
+
var Popup = React25__namespace.forwardRef(
|
|
1119
1136
|
({
|
|
1120
1137
|
coordinates,
|
|
1121
1138
|
closeButton = true,
|
|
@@ -1133,25 +1150,25 @@ var Popup = React6__namespace.forwardRef(
|
|
|
1133
1150
|
children
|
|
1134
1151
|
}, ref) => {
|
|
1135
1152
|
const { map, loaded } = useMap();
|
|
1136
|
-
const popupRef =
|
|
1137
|
-
const onOpenRef =
|
|
1153
|
+
const popupRef = React25__namespace.useRef(null);
|
|
1154
|
+
const onOpenRef = React25__namespace.useRef(onOpen);
|
|
1138
1155
|
onOpenRef.current = onOpen;
|
|
1139
|
-
const onCloseRef =
|
|
1156
|
+
const onCloseRef = React25__namespace.useRef(onClose);
|
|
1140
1157
|
onCloseRef.current = onClose;
|
|
1141
|
-
const coordinatesRef =
|
|
1158
|
+
const coordinatesRef = React25__namespace.useRef(coordinates);
|
|
1142
1159
|
coordinatesRef.current = coordinates;
|
|
1143
|
-
const containerRef =
|
|
1160
|
+
const containerRef = React25__namespace.useRef(null);
|
|
1144
1161
|
if (!containerRef.current && typeof document !== "undefined") {
|
|
1145
1162
|
containerRef.current = document.createElement("div");
|
|
1146
1163
|
containerRef.current.className = "maplibregl-popup-content-wrapper";
|
|
1147
1164
|
}
|
|
1148
|
-
const [contentReady, setContentReady] =
|
|
1149
|
-
const contentCallbackRef =
|
|
1165
|
+
const [contentReady, setContentReady] = React25__namespace.useState(false);
|
|
1166
|
+
const contentCallbackRef = React25__namespace.useCallback((node) => {
|
|
1150
1167
|
if (node && containerRef.current) {
|
|
1151
1168
|
setContentReady(true);
|
|
1152
1169
|
}
|
|
1153
1170
|
}, []);
|
|
1154
|
-
|
|
1171
|
+
React25__namespace.useEffect(() => {
|
|
1155
1172
|
if (!map || !loaded || !containerRef.current) return;
|
|
1156
1173
|
const popup = new maplibregl__default.default.Popup({
|
|
1157
1174
|
closeButton,
|
|
@@ -1191,7 +1208,7 @@ var Popup = React6__namespace.forwardRef(
|
|
|
1191
1208
|
maxWidth,
|
|
1192
1209
|
focusAfterOpen
|
|
1193
1210
|
]);
|
|
1194
|
-
|
|
1211
|
+
React25__namespace.useEffect(() => {
|
|
1195
1212
|
if (!popupRef.current || !ref) return;
|
|
1196
1213
|
if (typeof ref === "function") {
|
|
1197
1214
|
ref(popupRef.current);
|
|
@@ -1199,12 +1216,12 @@ var Popup = React6__namespace.forwardRef(
|
|
|
1199
1216
|
ref.current = popupRef.current;
|
|
1200
1217
|
}
|
|
1201
1218
|
}, [ref]);
|
|
1202
|
-
|
|
1219
|
+
React25__namespace.useEffect(() => {
|
|
1203
1220
|
if (popupRef.current) {
|
|
1204
1221
|
popupRef.current.setLngLat(coordinates);
|
|
1205
1222
|
}
|
|
1206
1223
|
}, [coordinates]);
|
|
1207
|
-
|
|
1224
|
+
React25__namespace.useEffect(() => {
|
|
1208
1225
|
if (!map || !popupRef.current || !contentReady) return;
|
|
1209
1226
|
let rafHandle;
|
|
1210
1227
|
if (open) {
|
|
@@ -1233,7 +1250,7 @@ var Popup = React6__namespace.forwardRef(
|
|
|
1233
1250
|
}
|
|
1234
1251
|
);
|
|
1235
1252
|
Popup.displayName = "Popup";
|
|
1236
|
-
var PopupCard =
|
|
1253
|
+
var PopupCard = React25__namespace.forwardRef(
|
|
1237
1254
|
({ className, children, ...props }, ref) => {
|
|
1238
1255
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("bg-popover text-popover-foreground", className), ...props, children });
|
|
1239
1256
|
}
|
|
@@ -1253,7 +1270,7 @@ var badgeVariants = classVarianceAuthority.cva("text-xs px-1.5 py-0.5 rounded fo
|
|
|
1253
1270
|
badgeVariant: "secondary"
|
|
1254
1271
|
}
|
|
1255
1272
|
});
|
|
1256
|
-
var PopupHeader =
|
|
1273
|
+
var PopupHeader = React25__namespace.forwardRef(
|
|
1257
1274
|
({ className, title, badge, badgeVariant, ...props }, ref) => {
|
|
1258
1275
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1259
1276
|
"div",
|
|
@@ -1273,13 +1290,13 @@ var PopupHeader = React6__namespace.forwardRef(
|
|
|
1273
1290
|
}
|
|
1274
1291
|
);
|
|
1275
1292
|
PopupHeader.displayName = "PopupHeader";
|
|
1276
|
-
var PopupContent =
|
|
1293
|
+
var PopupContent = React25__namespace.forwardRef(
|
|
1277
1294
|
({ className, children, ...props }, ref) => {
|
|
1278
1295
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("px-4 py-3 text-sm", className), ...props, children });
|
|
1279
1296
|
}
|
|
1280
1297
|
);
|
|
1281
1298
|
PopupContent.displayName = "PopupContent";
|
|
1282
|
-
var PopupFooter =
|
|
1299
|
+
var PopupFooter = React25__namespace.forwardRef(
|
|
1283
1300
|
({ className, children, ...props }, ref) => {
|
|
1284
1301
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1285
1302
|
"div",
|
|
@@ -1314,14 +1331,14 @@ function useLayer({
|
|
|
1314
1331
|
hoverThrottleMs = 0
|
|
1315
1332
|
}) {
|
|
1316
1333
|
const { map, loaded, styleVersion } = useMap();
|
|
1317
|
-
const [layerAdded, setLayerAdded] =
|
|
1318
|
-
const hoveredFeatureId =
|
|
1319
|
-
const lastHoverCallTime =
|
|
1320
|
-
const lastMousePosition =
|
|
1321
|
-
|
|
1334
|
+
const [layerAdded, setLayerAdded] = React25__namespace.useState(false);
|
|
1335
|
+
const hoveredFeatureId = React25__namespace.useRef(null);
|
|
1336
|
+
const lastHoverCallTime = React25__namespace.useRef(0);
|
|
1337
|
+
const lastMousePosition = React25__namespace.useRef(null);
|
|
1338
|
+
React25__namespace.useEffect(() => {
|
|
1322
1339
|
hoveredFeatureId.current = null;
|
|
1323
1340
|
}, [styleVersion]);
|
|
1324
|
-
|
|
1341
|
+
React25__namespace.useEffect(() => {
|
|
1325
1342
|
if (!map || !loaded) return;
|
|
1326
1343
|
if (!map.getSource(source)) {
|
|
1327
1344
|
let timeoutId = null;
|
|
@@ -1392,24 +1409,24 @@ function useLayer({
|
|
|
1392
1409
|
}
|
|
1393
1410
|
};
|
|
1394
1411
|
}, [map, loaded, id, source, sourceLayer, type, beforeId, styleVersion]);
|
|
1395
|
-
|
|
1412
|
+
React25__namespace.useEffect(() => {
|
|
1396
1413
|
if (!map || !layerAdded) return;
|
|
1397
1414
|
if (!map.getLayer(id)) return;
|
|
1398
1415
|
map.setLayoutProperty(id, "visibility", visible ? "visible" : "none");
|
|
1399
1416
|
}, [map, id, visible, layerAdded]);
|
|
1400
|
-
|
|
1417
|
+
React25__namespace.useEffect(() => {
|
|
1401
1418
|
if (!map || !layerAdded) return;
|
|
1402
1419
|
if (!map.getLayer(id)) return;
|
|
1403
1420
|
Object.entries(paint).forEach(([key, value]) => {
|
|
1404
1421
|
map.setPaintProperty(id, key, value);
|
|
1405
1422
|
});
|
|
1406
1423
|
}, [map, id, paint, layerAdded]);
|
|
1407
|
-
|
|
1424
|
+
React25__namespace.useEffect(() => {
|
|
1408
1425
|
if (!map || !layerAdded || !filter) return;
|
|
1409
1426
|
if (!map.getLayer(id)) return;
|
|
1410
1427
|
map.setFilter(id, filter);
|
|
1411
1428
|
}, [map, id, filter, layerAdded]);
|
|
1412
|
-
|
|
1429
|
+
React25__namespace.useEffect(() => {
|
|
1413
1430
|
if (!map || !layerAdded) return;
|
|
1414
1431
|
const createFeatureParams = (e) => {
|
|
1415
1432
|
const feature = e.features?.[0];
|
|
@@ -1545,7 +1562,7 @@ var FillLayer = ({
|
|
|
1545
1562
|
fillTranslate,
|
|
1546
1563
|
fillAntialias
|
|
1547
1564
|
}) => {
|
|
1548
|
-
const paint =
|
|
1565
|
+
const paint = React25__namespace.useMemo(() => {
|
|
1549
1566
|
const p = {};
|
|
1550
1567
|
if (fillColor !== void 0) p["fill-color"] = fillColor;
|
|
1551
1568
|
if (fillOpacity !== void 0) p["fill-opacity"] = fillOpacity;
|
|
@@ -1566,7 +1583,7 @@ var FillLayer = ({
|
|
|
1566
1583
|
fillAntialias,
|
|
1567
1584
|
opacity
|
|
1568
1585
|
]);
|
|
1569
|
-
const layout =
|
|
1586
|
+
const layout = React25__namespace.useMemo(() => ({}), []);
|
|
1570
1587
|
useLayer({
|
|
1571
1588
|
id,
|
|
1572
1589
|
source,
|
|
@@ -1610,7 +1627,7 @@ var LineLayer = ({
|
|
|
1610
1627
|
lineOffset,
|
|
1611
1628
|
lineGradient
|
|
1612
1629
|
}) => {
|
|
1613
|
-
const paint =
|
|
1630
|
+
const paint = React25__namespace.useMemo(() => {
|
|
1614
1631
|
const p = {};
|
|
1615
1632
|
if (lineColor !== void 0) p["line-color"] = lineColor;
|
|
1616
1633
|
if (lineWidth !== void 0) p["line-width"] = lineWidth;
|
|
@@ -1635,7 +1652,7 @@ var LineLayer = ({
|
|
|
1635
1652
|
lineGradient,
|
|
1636
1653
|
opacity
|
|
1637
1654
|
]);
|
|
1638
|
-
const layout =
|
|
1655
|
+
const layout = React25__namespace.useMemo(() => {
|
|
1639
1656
|
const l = {};
|
|
1640
1657
|
if (lineCap !== void 0) l["line-cap"] = lineCap;
|
|
1641
1658
|
if (lineJoin !== void 0) l["line-join"] = lineJoin;
|
|
@@ -1684,7 +1701,7 @@ var CircleLayer = ({
|
|
|
1684
1701
|
circlePitchScale,
|
|
1685
1702
|
circleTranslate
|
|
1686
1703
|
}) => {
|
|
1687
|
-
const paint =
|
|
1704
|
+
const paint = React25__namespace.useMemo(() => {
|
|
1688
1705
|
const p = {};
|
|
1689
1706
|
if (circleRadius !== void 0) p["circle-radius"] = circleRadius;
|
|
1690
1707
|
if (circleColor !== void 0) p["circle-color"] = circleColor;
|
|
@@ -1713,7 +1730,7 @@ var CircleLayer = ({
|
|
|
1713
1730
|
circleTranslate,
|
|
1714
1731
|
opacity
|
|
1715
1732
|
]);
|
|
1716
|
-
const layout =
|
|
1733
|
+
const layout = React25__namespace.useMemo(() => ({}), []);
|
|
1717
1734
|
useLayer({
|
|
1718
1735
|
id,
|
|
1719
1736
|
source,
|
|
@@ -1773,7 +1790,7 @@ var SymbolLayer = ({
|
|
|
1773
1790
|
symbolSpacing,
|
|
1774
1791
|
symbolSortKey
|
|
1775
1792
|
}) => {
|
|
1776
|
-
const paint =
|
|
1793
|
+
const paint = React25__namespace.useMemo(() => {
|
|
1777
1794
|
const p = {};
|
|
1778
1795
|
if (iconOpacity !== void 0) p["icon-opacity"] = iconOpacity;
|
|
1779
1796
|
if (iconColor !== void 0) p["icon-color"] = iconColor;
|
|
@@ -1794,7 +1811,7 @@ var SymbolLayer = ({
|
|
|
1794
1811
|
textHaloColor,
|
|
1795
1812
|
textHaloWidth
|
|
1796
1813
|
]);
|
|
1797
|
-
const layout =
|
|
1814
|
+
const layout = React25__namespace.useMemo(() => {
|
|
1798
1815
|
const l = {};
|
|
1799
1816
|
if (iconImage !== void 0) l["icon-image"] = iconImage;
|
|
1800
1817
|
if (iconSize !== void 0) l["icon-size"] = iconSize;
|
|
@@ -1875,7 +1892,7 @@ var FillExtrusionLayer = ({
|
|
|
1875
1892
|
fillExtrusionTranslate,
|
|
1876
1893
|
fillExtrusionVerticalGradient
|
|
1877
1894
|
}) => {
|
|
1878
|
-
const paint =
|
|
1895
|
+
const paint = React25__namespace.useMemo(() => {
|
|
1879
1896
|
const p = {};
|
|
1880
1897
|
if (fillExtrusionHeight !== void 0) p["fill-extrusion-height"] = fillExtrusionHeight;
|
|
1881
1898
|
if (fillExtrusionBase !== void 0) p["fill-extrusion-base"] = fillExtrusionBase;
|
|
@@ -1901,7 +1918,7 @@ var FillExtrusionLayer = ({
|
|
|
1901
1918
|
fillExtrusionVerticalGradient,
|
|
1902
1919
|
opacity
|
|
1903
1920
|
]);
|
|
1904
|
-
const layout =
|
|
1921
|
+
const layout = React25__namespace.useMemo(() => ({}), []);
|
|
1905
1922
|
useLayer({
|
|
1906
1923
|
id,
|
|
1907
1924
|
source,
|
|
@@ -1940,7 +1957,7 @@ var HeatmapLayer = ({
|
|
|
1940
1957
|
heatmapRadius,
|
|
1941
1958
|
heatmapOpacity
|
|
1942
1959
|
}) => {
|
|
1943
|
-
const paint =
|
|
1960
|
+
const paint = React25__namespace.useMemo(() => {
|
|
1944
1961
|
const p = {};
|
|
1945
1962
|
if (heatmapIntensity !== void 0) p["heatmap-intensity"] = heatmapIntensity;
|
|
1946
1963
|
if (heatmapWeight !== void 0) p["heatmap-weight"] = heatmapWeight;
|
|
@@ -1952,7 +1969,7 @@ var HeatmapLayer = ({
|
|
|
1952
1969
|
}
|
|
1953
1970
|
return p;
|
|
1954
1971
|
}, [heatmapIntensity, heatmapWeight, heatmapColor, heatmapRadius, heatmapOpacity, opacity]);
|
|
1955
|
-
const layout =
|
|
1972
|
+
const layout = React25__namespace.useMemo(() => ({}), []);
|
|
1956
1973
|
useLayer({
|
|
1957
1974
|
id,
|
|
1958
1975
|
source,
|
|
@@ -1987,11 +2004,11 @@ var Legend = ({
|
|
|
1987
2004
|
onItemClick
|
|
1988
2005
|
}) => {
|
|
1989
2006
|
const { controlOffsets, registerControl, unregisterControl } = useMap();
|
|
1990
|
-
const [isCollapsed, setIsCollapsed] =
|
|
1991
|
-
const [customControlOffset, setCustomControlOffset] =
|
|
1992
|
-
const legendRef =
|
|
1993
|
-
const legendIdRef =
|
|
1994
|
-
|
|
2007
|
+
const [isCollapsed, setIsCollapsed] = React25__namespace.useState(initialCollapsed);
|
|
2008
|
+
const [customControlOffset, setCustomControlOffset] = React25__namespace.useState(0);
|
|
2009
|
+
const legendRef = React25__namespace.useRef(null);
|
|
2010
|
+
const legendIdRef = React25__namespace.useRef(`legend-${++legendIdCounter}`);
|
|
2011
|
+
React25__namespace.useEffect(() => {
|
|
1995
2012
|
if (!legendRef.current || !registerControl) return;
|
|
1996
2013
|
const updatePosition = () => {
|
|
1997
2014
|
if (!legendRef.current) return;
|
|
@@ -2007,7 +2024,7 @@ var Legend = ({
|
|
|
2007
2024
|
unregisterControl?.(legendIdRef.current, position);
|
|
2008
2025
|
};
|
|
2009
2026
|
}, [position, registerControl, unregisterControl]);
|
|
2010
|
-
const verticalOffsetStyle =
|
|
2027
|
+
const verticalOffsetStyle = React25__namespace.useMemo(() => {
|
|
2011
2028
|
return mapsCore.computeVerticalOffsetStyle(position, customControlOffset);
|
|
2012
2029
|
}, [customControlOffset, position]);
|
|
2013
2030
|
const handleItemClick = (item, index) => {
|
|
@@ -2020,13 +2037,13 @@ var Legend = ({
|
|
|
2020
2037
|
setIsCollapsed(!isCollapsed);
|
|
2021
2038
|
}
|
|
2022
2039
|
};
|
|
2023
|
-
const gradientStyle =
|
|
2040
|
+
const gradientStyle = React25__namespace.useMemo(() => {
|
|
2024
2041
|
if (type !== "gradient" || gradient.length === 0) return "";
|
|
2025
2042
|
const stops = gradient.map((stop) => `${stop.color} ${stop.position * 100}%`).join(", ");
|
|
2026
2043
|
return `linear-gradient(to right, ${stops})`;
|
|
2027
2044
|
}, [type, gradient]);
|
|
2028
2045
|
const hasControlsAtPosition = (controlOffsets?.[position] ?? 0) > 0;
|
|
2029
|
-
const computedPositionClasses =
|
|
2046
|
+
const computedPositionClasses = React25__namespace.useMemo(() => {
|
|
2030
2047
|
return mapsCore.computePositionClasses(position, hasControlsAtPosition);
|
|
2031
2048
|
}, [position, hasControlsAtPosition]);
|
|
2032
2049
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -2125,15 +2142,15 @@ var LegendGroup = ({
|
|
|
2125
2142
|
class: className
|
|
2126
2143
|
}) => {
|
|
2127
2144
|
const { controlOffsets, registerControl, unregisterControl } = useMap();
|
|
2128
|
-
const containerRef =
|
|
2129
|
-
const groupIdRef =
|
|
2130
|
-
const [customControlOffset, setCustomControlOffset] =
|
|
2145
|
+
const containerRef = React25__namespace.useRef(null);
|
|
2146
|
+
const groupIdRef = React25__namespace.useRef(`legend-group-${++legendGroupIdCounter}`);
|
|
2147
|
+
const [customControlOffset, setCustomControlOffset] = React25__namespace.useState(0);
|
|
2131
2148
|
const getInitialExpanded = () => {
|
|
2132
2149
|
if (controlledExpanded !== void 0) return controlledExpanded;
|
|
2133
2150
|
if (defaultExpanded) return defaultExpanded;
|
|
2134
2151
|
return legends[0]?.id || null;
|
|
2135
2152
|
};
|
|
2136
|
-
const [internalExpanded, setInternalExpanded] =
|
|
2153
|
+
const [internalExpanded, setInternalExpanded] = React25__namespace.useState(getInitialExpanded);
|
|
2137
2154
|
const expandedId = controlledExpanded !== void 0 ? controlledExpanded : internalExpanded;
|
|
2138
2155
|
const handleToggle = (id) => {
|
|
2139
2156
|
const newExpanded = expandedId === id ? allowCollapseAll ? null : id : id;
|
|
@@ -2142,7 +2159,7 @@ var LegendGroup = ({
|
|
|
2142
2159
|
}
|
|
2143
2160
|
onExpandedChange?.(newExpanded);
|
|
2144
2161
|
};
|
|
2145
|
-
|
|
2162
|
+
React25__namespace.useEffect(() => {
|
|
2146
2163
|
if (!containerRef.current || !registerControl) return;
|
|
2147
2164
|
const timeoutId = setTimeout(() => {
|
|
2148
2165
|
if (containerRef.current) {
|
|
@@ -2156,11 +2173,11 @@ var LegendGroup = ({
|
|
|
2156
2173
|
unregisterControl?.(groupIdRef.current, position);
|
|
2157
2174
|
};
|
|
2158
2175
|
}, [position, expandedId, registerControl, unregisterControl]);
|
|
2159
|
-
const verticalOffsetStyle =
|
|
2176
|
+
const verticalOffsetStyle = React25__namespace.useMemo(() => {
|
|
2160
2177
|
return mapsCore.computeVerticalOffsetStyle(position, customControlOffset);
|
|
2161
2178
|
}, [customControlOffset, position]);
|
|
2162
2179
|
const hasControlsAtPosition = (controlOffsets?.[position] ?? 0) > 0;
|
|
2163
|
-
const computedPositionClasses =
|
|
2180
|
+
const computedPositionClasses = React25__namespace.useMemo(() => {
|
|
2164
2181
|
return mapsCore.computePositionClasses(position, hasControlsAtPosition);
|
|
2165
2182
|
}, [position, hasControlsAtPosition]);
|
|
2166
2183
|
const getGradientStyle = (legend) => {
|
|
@@ -2291,13 +2308,13 @@ var CoordinateDisplay = ({
|
|
|
2291
2308
|
class: className
|
|
2292
2309
|
}) => {
|
|
2293
2310
|
const { map, loaded, controlOffsets, registerControl, unregisterControl } = useMap();
|
|
2294
|
-
const [cursorLngLat, setCursorLngLat] =
|
|
2295
|
-
const [currentZoom, setCurrentZoom] =
|
|
2296
|
-
const [currentBearing, setCurrentBearing] =
|
|
2297
|
-
const [customControlOffset, setCustomControlOffset] =
|
|
2298
|
-
const controlRef =
|
|
2299
|
-
const controlIdRef =
|
|
2300
|
-
|
|
2311
|
+
const [cursorLngLat, setCursorLngLat] = React25__namespace.useState(null);
|
|
2312
|
+
const [currentZoom, setCurrentZoom] = React25__namespace.useState(0);
|
|
2313
|
+
const [currentBearing, setCurrentBearing] = React25__namespace.useState(0);
|
|
2314
|
+
const [customControlOffset, setCustomControlOffset] = React25__namespace.useState(0);
|
|
2315
|
+
const controlRef = React25__namespace.useRef(null);
|
|
2316
|
+
const controlIdRef = React25__namespace.useRef(`coord-display-${++coordDisplayIdCounter}`);
|
|
2317
|
+
React25__namespace.useEffect(() => {
|
|
2301
2318
|
if (!controlRef.current || !registerControl) return;
|
|
2302
2319
|
const updatePosition = () => {
|
|
2303
2320
|
if (!controlRef.current) return;
|
|
@@ -2313,10 +2330,10 @@ var CoordinateDisplay = ({
|
|
|
2313
2330
|
unregisterControl?.(controlIdRef.current, position);
|
|
2314
2331
|
};
|
|
2315
2332
|
}, [position, registerControl, unregisterControl]);
|
|
2316
|
-
const verticalOffsetStyle =
|
|
2333
|
+
const verticalOffsetStyle = React25__namespace.useMemo(() => {
|
|
2317
2334
|
return mapsCore.computeVerticalOffsetStyle(position, customControlOffset);
|
|
2318
2335
|
}, [customControlOffset, position]);
|
|
2319
|
-
const formatCoord =
|
|
2336
|
+
const formatCoord = React25__namespace.useCallback(
|
|
2320
2337
|
(lngLat) => {
|
|
2321
2338
|
return mapsCore.formatCoordinates(lngLat, precision, format);
|
|
2322
2339
|
},
|
|
@@ -2330,10 +2347,10 @@ var CoordinateDisplay = ({
|
|
|
2330
2347
|
return `${normalized.toFixed(0)}\xB0`;
|
|
2331
2348
|
};
|
|
2332
2349
|
const hasControlsAtPosition = (controlOffsets?.[position] ?? 0) > 0;
|
|
2333
|
-
const computedPositionClasses =
|
|
2350
|
+
const computedPositionClasses = React25__namespace.useMemo(() => {
|
|
2334
2351
|
return mapsCore.computePositionClasses(position, hasControlsAtPosition);
|
|
2335
2352
|
}, [position, hasControlsAtPosition]);
|
|
2336
|
-
|
|
2353
|
+
React25__namespace.useEffect(() => {
|
|
2337
2354
|
if (!map || !loaded) return;
|
|
2338
2355
|
setCurrentZoom(map.getZoom());
|
|
2339
2356
|
setCurrentBearing(map.getBearing());
|
|
@@ -2400,16 +2417,16 @@ var BasemapSwitcher = ({
|
|
|
2400
2417
|
class: className
|
|
2401
2418
|
}) => {
|
|
2402
2419
|
const { controlOffsets, registerControl, unregisterControl, setMapStyle } = useMap();
|
|
2403
|
-
const [isOpen, setIsOpen] =
|
|
2404
|
-
const [internalActiveId, setInternalActiveId] =
|
|
2420
|
+
const [isOpen, setIsOpen] = React25__namespace.useState(false);
|
|
2421
|
+
const [internalActiveId, setInternalActiveId] = React25__namespace.useState(
|
|
2405
2422
|
defaultBasemapId
|
|
2406
2423
|
);
|
|
2407
|
-
const [customControlOffset, setCustomControlOffset] =
|
|
2408
|
-
const containerRef =
|
|
2409
|
-
const panelRef =
|
|
2410
|
-
const switcherIdRef =
|
|
2424
|
+
const [customControlOffset, setCustomControlOffset] = React25__namespace.useState(0);
|
|
2425
|
+
const containerRef = React25__namespace.useRef(null);
|
|
2426
|
+
const panelRef = React25__namespace.useRef(null);
|
|
2427
|
+
const switcherIdRef = React25__namespace.useRef(`basemap-switcher-${++switcherIdCounter}`);
|
|
2411
2428
|
const sourceBasemaps = basemaps ?? mapsCore.FREE_BASEMAPS;
|
|
2412
|
-
const availableBasemaps =
|
|
2429
|
+
const availableBasemaps = React25__namespace.useMemo(() => {
|
|
2413
2430
|
const available = mapsCore.getAvailableBasemaps(sourceBasemaps, apiKeys);
|
|
2414
2431
|
if (extraBasemaps?.length) {
|
|
2415
2432
|
return [...available, ...mapsCore.getAvailableBasemaps(extraBasemaps, apiKeys)];
|
|
@@ -2417,7 +2434,7 @@ var BasemapSwitcher = ({
|
|
|
2417
2434
|
return available;
|
|
2418
2435
|
}, [sourceBasemaps, extraBasemaps, apiKeys]);
|
|
2419
2436
|
const currentActiveId = activeBasemapId ?? internalActiveId ?? availableBasemaps[0]?.id;
|
|
2420
|
-
|
|
2437
|
+
React25__namespace.useEffect(() => {
|
|
2421
2438
|
if (!containerRef.current || !registerControl) return;
|
|
2422
2439
|
const updatePosition = () => {
|
|
2423
2440
|
if (!containerRef.current) return;
|
|
@@ -2433,7 +2450,7 @@ var BasemapSwitcher = ({
|
|
|
2433
2450
|
unregisterControl?.(switcherIdRef.current, position);
|
|
2434
2451
|
};
|
|
2435
2452
|
}, [position, registerControl, unregisterControl]);
|
|
2436
|
-
|
|
2453
|
+
React25__namespace.useEffect(() => {
|
|
2437
2454
|
if (!isOpen) return;
|
|
2438
2455
|
const handleMouseDown = (e) => {
|
|
2439
2456
|
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
@@ -2443,7 +2460,7 @@ var BasemapSwitcher = ({
|
|
|
2443
2460
|
document.addEventListener("mousedown", handleMouseDown);
|
|
2444
2461
|
return () => document.removeEventListener("mousedown", handleMouseDown);
|
|
2445
2462
|
}, [isOpen]);
|
|
2446
|
-
|
|
2463
|
+
React25__namespace.useEffect(() => {
|
|
2447
2464
|
if (!isOpen) return;
|
|
2448
2465
|
const handleKeyDown = (e) => {
|
|
2449
2466
|
if (e.key === "Escape") {
|
|
@@ -2463,11 +2480,11 @@ var BasemapSwitcher = ({
|
|
|
2463
2480
|
onBasemapChange?.(basemap);
|
|
2464
2481
|
setIsOpen(false);
|
|
2465
2482
|
};
|
|
2466
|
-
const verticalOffsetStyle =
|
|
2483
|
+
const verticalOffsetStyle = React25__namespace.useMemo(() => {
|
|
2467
2484
|
return mapsCore.computeVerticalOffsetStyle(position, customControlOffset);
|
|
2468
2485
|
}, [customControlOffset, position]);
|
|
2469
2486
|
const hasControlsAtPosition = (controlOffsets?.[position] ?? 0) > 0;
|
|
2470
|
-
const computedPositionClasses =
|
|
2487
|
+
const computedPositionClasses = React25__namespace.useMemo(() => {
|
|
2471
2488
|
return mapsCore.computePositionClasses(position, hasControlsAtPosition);
|
|
2472
2489
|
}, [position, hasControlsAtPosition]);
|
|
2473
2490
|
const isTop = position.startsWith("top");
|
|
@@ -2580,6 +2597,572 @@ var BasemapSwitcher = ({
|
|
|
2580
2597
|
);
|
|
2581
2598
|
};
|
|
2582
2599
|
BasemapSwitcher.displayName = "BasemapSwitcher";
|
|
2600
|
+
var managerIdCounter = 0;
|
|
2601
|
+
var LayerManager = ({
|
|
2602
|
+
layers,
|
|
2603
|
+
apiKeys,
|
|
2604
|
+
initialActiveLayers,
|
|
2605
|
+
position = "top-right",
|
|
2606
|
+
showSearch = false,
|
|
2607
|
+
showCategories = false,
|
|
2608
|
+
allowReorder = false,
|
|
2609
|
+
showOpacity = false,
|
|
2610
|
+
collapsible = true,
|
|
2611
|
+
onLayerChange,
|
|
2612
|
+
class: className
|
|
2613
|
+
}) => {
|
|
2614
|
+
const { controlOffsets, registerControl, unregisterControl } = useMap();
|
|
2615
|
+
const { isDark } = useMapTheme();
|
|
2616
|
+
const [isOpen, setIsOpen] = React25__namespace.useState(false);
|
|
2617
|
+
const [layerStates, setLayerStates] = React25__namespace.useState(
|
|
2618
|
+
() => mapsCore.createInitialLayerStates(layers, initialActiveLayers)
|
|
2619
|
+
);
|
|
2620
|
+
const [searchQuery, setSearchQuery] = React25__namespace.useState("");
|
|
2621
|
+
const [activeCategory, setActiveCategory] = React25__namespace.useState("all");
|
|
2622
|
+
const [customControlOffset, setCustomControlOffset] = React25__namespace.useState(0);
|
|
2623
|
+
const [expandedOpacity, setExpandedOpacity] = React25__namespace.useState(null);
|
|
2624
|
+
const [draggedId, setDraggedId] = React25__namespace.useState(null);
|
|
2625
|
+
const [dragOver, setDragOver] = React25__namespace.useState(null);
|
|
2626
|
+
const containerRef = React25__namespace.useRef(null);
|
|
2627
|
+
const managerIdRef = React25__namespace.useRef(`layer-manager-${++managerIdCounter}`);
|
|
2628
|
+
const lastLayerIdsRef = React25__namespace.useRef(new Set(layers.map((l) => l.id)));
|
|
2629
|
+
React25__namespace.useEffect(() => {
|
|
2630
|
+
const currentLayerIds = new Set(layers.map((l) => l.id));
|
|
2631
|
+
const hasNewLayers = layers.some((l) => !lastLayerIdsRef.current.has(l.id));
|
|
2632
|
+
const hasRemovedLayers = Array.from(lastLayerIdsRef.current).some(
|
|
2633
|
+
(id) => !currentLayerIds.has(id)
|
|
2634
|
+
);
|
|
2635
|
+
if (hasNewLayers || hasRemovedLayers) {
|
|
2636
|
+
setLayerStates((prev) => {
|
|
2637
|
+
const newStates = new Map(prev);
|
|
2638
|
+
for (const layer of layers) {
|
|
2639
|
+
if (!newStates.has(layer.id)) {
|
|
2640
|
+
newStates.set(layer.id, {
|
|
2641
|
+
id: layer.id,
|
|
2642
|
+
visible: initialActiveLayers?.includes(layer.id) ?? false,
|
|
2643
|
+
opacity: 1,
|
|
2644
|
+
loading: false,
|
|
2645
|
+
error: null,
|
|
2646
|
+
order: newStates.size
|
|
2647
|
+
});
|
|
2648
|
+
}
|
|
2649
|
+
}
|
|
2650
|
+
for (const id of lastLayerIdsRef.current) {
|
|
2651
|
+
if (!currentLayerIds.has(id)) {
|
|
2652
|
+
newStates.delete(id);
|
|
2653
|
+
}
|
|
2654
|
+
}
|
|
2655
|
+
return newStates;
|
|
2656
|
+
});
|
|
2657
|
+
lastLayerIdsRef.current = currentLayerIds;
|
|
2658
|
+
}
|
|
2659
|
+
}, [layers, initialActiveLayers]);
|
|
2660
|
+
const categories = React25__namespace.useMemo(() => mapsCore.getLayerCategories(layers), [layers]);
|
|
2661
|
+
const filteredLayers = React25__namespace.useMemo(() => {
|
|
2662
|
+
let result = layers;
|
|
2663
|
+
if (searchQuery) {
|
|
2664
|
+
result = mapsCore.searchLayers(result, searchQuery);
|
|
2665
|
+
}
|
|
2666
|
+
if (activeCategory !== "all") {
|
|
2667
|
+
result = result.filter((l) => l.category === activeCategory);
|
|
2668
|
+
}
|
|
2669
|
+
return [...result].sort((a, b) => {
|
|
2670
|
+
const orderA = layerStates.get(a.id)?.order ?? 0;
|
|
2671
|
+
const orderB = layerStates.get(b.id)?.order ?? 0;
|
|
2672
|
+
return orderA - orderB;
|
|
2673
|
+
});
|
|
2674
|
+
}, [layers, searchQuery, activeCategory, layerStates]);
|
|
2675
|
+
const layerGroups = React25__namespace.useMemo(
|
|
2676
|
+
() => showCategories ? mapsCore.groupLayersByCategory(filteredLayers) : null,
|
|
2677
|
+
[filteredLayers, showCategories]
|
|
2678
|
+
);
|
|
2679
|
+
React25__namespace.useEffect(() => {
|
|
2680
|
+
if (!containerRef.current || !registerControl) return;
|
|
2681
|
+
const updatePosition = () => {
|
|
2682
|
+
if (!containerRef.current) return;
|
|
2683
|
+
const height = containerRef.current.offsetHeight;
|
|
2684
|
+
const offset = registerControl(managerIdRef.current, position, height);
|
|
2685
|
+
setCustomControlOffset(offset);
|
|
2686
|
+
};
|
|
2687
|
+
updatePosition();
|
|
2688
|
+
const observer = new ResizeObserver(updatePosition);
|
|
2689
|
+
observer.observe(containerRef.current);
|
|
2690
|
+
return () => {
|
|
2691
|
+
observer.disconnect();
|
|
2692
|
+
unregisterControl?.(managerIdRef.current, position);
|
|
2693
|
+
};
|
|
2694
|
+
}, [position, registerControl, unregisterControl]);
|
|
2695
|
+
React25__namespace.useEffect(() => {
|
|
2696
|
+
if (!isOpen) return;
|
|
2697
|
+
const handleMouseDown = (e) => {
|
|
2698
|
+
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
2699
|
+
setIsOpen(false);
|
|
2700
|
+
}
|
|
2701
|
+
};
|
|
2702
|
+
document.addEventListener("mousedown", handleMouseDown);
|
|
2703
|
+
return () => document.removeEventListener("mousedown", handleMouseDown);
|
|
2704
|
+
}, [isOpen]);
|
|
2705
|
+
React25__namespace.useEffect(() => {
|
|
2706
|
+
if (!isOpen) return;
|
|
2707
|
+
const handleKeyDown = (e) => {
|
|
2708
|
+
if (e.key === "Escape") {
|
|
2709
|
+
setIsOpen(false);
|
|
2710
|
+
}
|
|
2711
|
+
};
|
|
2712
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
2713
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
2714
|
+
}, [isOpen]);
|
|
2715
|
+
const handleToggleLayer = React25__namespace.useCallback(
|
|
2716
|
+
(layerId) => {
|
|
2717
|
+
setLayerStates((prev) => {
|
|
2718
|
+
const newStates = mapsCore.toggleLayerVisibility(prev, layerId);
|
|
2719
|
+
const state = newStates.get(layerId);
|
|
2720
|
+
if (state && onLayerChange) {
|
|
2721
|
+
onLayerChange(layerId, state);
|
|
2722
|
+
}
|
|
2723
|
+
return newStates;
|
|
2724
|
+
});
|
|
2725
|
+
},
|
|
2726
|
+
[onLayerChange]
|
|
2727
|
+
);
|
|
2728
|
+
const handleOpacityChange = React25__namespace.useCallback(
|
|
2729
|
+
(layerId, opacity) => {
|
|
2730
|
+
setLayerStates((prev) => {
|
|
2731
|
+
const newStates = mapsCore.setLayerOpacity(prev, layerId, opacity);
|
|
2732
|
+
const state = newStates.get(layerId);
|
|
2733
|
+
if (state && onLayerChange) {
|
|
2734
|
+
onLayerChange(layerId, state);
|
|
2735
|
+
}
|
|
2736
|
+
return newStates;
|
|
2737
|
+
});
|
|
2738
|
+
},
|
|
2739
|
+
[onLayerChange]
|
|
2740
|
+
);
|
|
2741
|
+
const handleDragStart = React25__namespace.useCallback((e, layerId) => {
|
|
2742
|
+
setDraggedId(layerId);
|
|
2743
|
+
e.dataTransfer.effectAllowed = "move";
|
|
2744
|
+
e.dataTransfer.setData("text/plain", layerId);
|
|
2745
|
+
}, []);
|
|
2746
|
+
const handleDragOver = React25__namespace.useCallback(
|
|
2747
|
+
(e, layerId) => {
|
|
2748
|
+
e.preventDefault();
|
|
2749
|
+
e.dataTransfer.dropEffect = "move";
|
|
2750
|
+
if (layerId !== draggedId) {
|
|
2751
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
2752
|
+
const relativeY = (e.clientY - rect.top) / rect.height;
|
|
2753
|
+
let position2;
|
|
2754
|
+
if (relativeY < 0.3) {
|
|
2755
|
+
position2 = "above";
|
|
2756
|
+
} else if (relativeY > 0.7) {
|
|
2757
|
+
position2 = "below";
|
|
2758
|
+
} else {
|
|
2759
|
+
position2 = dragOver?.id === layerId ? dragOver.position : "below";
|
|
2760
|
+
}
|
|
2761
|
+
setDragOver({ id: layerId, position: position2 });
|
|
2762
|
+
}
|
|
2763
|
+
},
|
|
2764
|
+
[draggedId, dragOver]
|
|
2765
|
+
);
|
|
2766
|
+
const handleDragLeave = React25__namespace.useCallback(() => {
|
|
2767
|
+
setDragOver(null);
|
|
2768
|
+
}, []);
|
|
2769
|
+
const handleDragEnd = React25__namespace.useCallback(() => {
|
|
2770
|
+
setDraggedId(null);
|
|
2771
|
+
setDragOver(null);
|
|
2772
|
+
}, []);
|
|
2773
|
+
const handleDrop = React25__namespace.useCallback(
|
|
2774
|
+
(e, targetLayerId) => {
|
|
2775
|
+
e.preventDefault();
|
|
2776
|
+
const sourceLayerId = e.dataTransfer.getData("text/plain");
|
|
2777
|
+
if (sourceLayerId && sourceLayerId !== targetLayerId) {
|
|
2778
|
+
const sortedStates = mapsCore.getLayerStatesArray(layerStates);
|
|
2779
|
+
const sourceIndex = sortedStates.findIndex((s) => s.id === sourceLayerId);
|
|
2780
|
+
let targetIndex = sortedStates.findIndex((s) => s.id === targetLayerId);
|
|
2781
|
+
if (targetIndex !== -1) {
|
|
2782
|
+
if (dragOver?.position === "below") {
|
|
2783
|
+
targetIndex += 1;
|
|
2784
|
+
}
|
|
2785
|
+
if (sourceIndex < targetIndex) {
|
|
2786
|
+
targetIndex -= 1;
|
|
2787
|
+
}
|
|
2788
|
+
setLayerStates((prev) => {
|
|
2789
|
+
const newStates = mapsCore.reorderLayers(prev, sourceLayerId, targetIndex);
|
|
2790
|
+
const state = newStates.get(sourceLayerId);
|
|
2791
|
+
if (state && onLayerChange) {
|
|
2792
|
+
onLayerChange(sourceLayerId, state);
|
|
2793
|
+
}
|
|
2794
|
+
return newStates;
|
|
2795
|
+
});
|
|
2796
|
+
}
|
|
2797
|
+
}
|
|
2798
|
+
setDraggedId(null);
|
|
2799
|
+
setDragOver(null);
|
|
2800
|
+
},
|
|
2801
|
+
[layerStates, onLayerChange, dragOver]
|
|
2802
|
+
);
|
|
2803
|
+
const verticalOffsetStyle = React25__namespace.useMemo(() => {
|
|
2804
|
+
return mapsCore.computeVerticalOffsetStyle(position, customControlOffset);
|
|
2805
|
+
}, [customControlOffset, position]);
|
|
2806
|
+
const hasControlsAtPosition = (controlOffsets?.[position] ?? 0) > 0;
|
|
2807
|
+
const computedPositionClasses = React25__namespace.useMemo(() => {
|
|
2808
|
+
return mapsCore.computePositionClasses(position, hasControlsAtPosition);
|
|
2809
|
+
}, [position, hasControlsAtPosition]);
|
|
2810
|
+
const isTop = position.startsWith("top");
|
|
2811
|
+
const renderLayer = (layer, state) => {
|
|
2812
|
+
if (!state.visible) return null;
|
|
2813
|
+
const theme = isDark ? "dark" : "light";
|
|
2814
|
+
const paint = mapsCore.getLayerStyleForTheme(layer, theme);
|
|
2815
|
+
const sourceUrl = mapsCore.resolveLayerSourceUrl(layer, apiKeys);
|
|
2816
|
+
const sourceId = `lm-source-${layer.id}`;
|
|
2817
|
+
const sourceData = layer.source.type === "geojson-inline" ? layer.source.data : layer.source.type === "geojson-url" && sourceUrl ? sourceUrl : void 0;
|
|
2818
|
+
if (!sourceData && layer.source.type !== "vector-tiles") {
|
|
2819
|
+
return null;
|
|
2820
|
+
}
|
|
2821
|
+
const layerProps = {
|
|
2822
|
+
id: `lm-layer-${layer.id}`,
|
|
2823
|
+
source: sourceId,
|
|
2824
|
+
sourceLayer: layer.source.sourceLayer,
|
|
2825
|
+
visible: state.visible,
|
|
2826
|
+
opacity: state.opacity,
|
|
2827
|
+
minZoom: layer.style.minZoom,
|
|
2828
|
+
maxZoom: layer.style.maxZoom
|
|
2829
|
+
};
|
|
2830
|
+
let layerComponent = null;
|
|
2831
|
+
const baseOpacity = {
|
|
2832
|
+
fill: paint["fill-opacity"] ?? 1,
|
|
2833
|
+
line: paint["line-opacity"] ?? 1,
|
|
2834
|
+
circle: paint["circle-opacity"] ?? 1,
|
|
2835
|
+
icon: paint["icon-opacity"] ?? 1
|
|
2836
|
+
};
|
|
2837
|
+
switch (layer.style.renderType) {
|
|
2838
|
+
case "fill":
|
|
2839
|
+
layerComponent = /* @__PURE__ */ jsxRuntime.jsx(
|
|
2840
|
+
FillLayer,
|
|
2841
|
+
{
|
|
2842
|
+
...layerProps,
|
|
2843
|
+
fillColor: paint["fill-color"],
|
|
2844
|
+
fillOpacity: baseOpacity.fill * state.opacity,
|
|
2845
|
+
fillOutlineColor: paint["fill-outline-color"]
|
|
2846
|
+
}
|
|
2847
|
+
);
|
|
2848
|
+
break;
|
|
2849
|
+
case "line":
|
|
2850
|
+
layerComponent = /* @__PURE__ */ jsxRuntime.jsx(
|
|
2851
|
+
LineLayer,
|
|
2852
|
+
{
|
|
2853
|
+
...layerProps,
|
|
2854
|
+
lineColor: paint["line-color"],
|
|
2855
|
+
lineWidth: paint["line-width"],
|
|
2856
|
+
lineOpacity: baseOpacity.line * state.opacity,
|
|
2857
|
+
lineDasharray: paint["line-dasharray"]
|
|
2858
|
+
}
|
|
2859
|
+
);
|
|
2860
|
+
break;
|
|
2861
|
+
case "circle":
|
|
2862
|
+
layerComponent = /* @__PURE__ */ jsxRuntime.jsx(
|
|
2863
|
+
CircleLayer,
|
|
2864
|
+
{
|
|
2865
|
+
...layerProps,
|
|
2866
|
+
circleColor: paint["circle-color"],
|
|
2867
|
+
circleRadius: paint["circle-radius"],
|
|
2868
|
+
circleOpacity: baseOpacity.circle * state.opacity,
|
|
2869
|
+
circleStrokeWidth: paint["circle-stroke-width"],
|
|
2870
|
+
circleStrokeColor: paint["circle-stroke-color"]
|
|
2871
|
+
}
|
|
2872
|
+
);
|
|
2873
|
+
break;
|
|
2874
|
+
case "symbol":
|
|
2875
|
+
layerComponent = /* @__PURE__ */ jsxRuntime.jsx(
|
|
2876
|
+
SymbolLayer,
|
|
2877
|
+
{
|
|
2878
|
+
...layerProps,
|
|
2879
|
+
iconImage: paint["icon-image"],
|
|
2880
|
+
iconSize: paint["icon-size"],
|
|
2881
|
+
iconOpacity: baseOpacity.icon * state.opacity,
|
|
2882
|
+
textField: paint["text-field"],
|
|
2883
|
+
textSize: paint["text-size"],
|
|
2884
|
+
textColor: paint["text-color"]
|
|
2885
|
+
}
|
|
2886
|
+
);
|
|
2887
|
+
break;
|
|
2888
|
+
}
|
|
2889
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2890
|
+
Source,
|
|
2891
|
+
{
|
|
2892
|
+
id: sourceId,
|
|
2893
|
+
type: layer.source.type === "vector-tiles" ? "vector" : "geojson",
|
|
2894
|
+
data: layer.source.type !== "vector-tiles" ? sourceData : void 0,
|
|
2895
|
+
url: layer.source.type === "vector-tiles" ? sourceUrl ?? void 0 : void 0,
|
|
2896
|
+
tiles: layer.source.type === "vector-tiles" ? [sourceUrl ?? ""] : void 0,
|
|
2897
|
+
attribution: layer.source.attribution,
|
|
2898
|
+
children: layerComponent
|
|
2899
|
+
},
|
|
2900
|
+
layer.id
|
|
2901
|
+
);
|
|
2902
|
+
};
|
|
2903
|
+
const renderLayerItem = (layer) => {
|
|
2904
|
+
const state = layerStates.get(layer.id);
|
|
2905
|
+
if (!state) return null;
|
|
2906
|
+
const isDragging = draggedId === layer.id;
|
|
2907
|
+
const isDragOver = dragOver?.id === layer.id;
|
|
2908
|
+
const dragOverPosition = isDragOver ? dragOver.position : void 0;
|
|
2909
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2910
|
+
"div",
|
|
2911
|
+
{
|
|
2912
|
+
className: "classic-layer-item",
|
|
2913
|
+
draggable: allowReorder,
|
|
2914
|
+
onDragStart: allowReorder ? (e) => handleDragStart(e, layer.id) : void 0,
|
|
2915
|
+
onDragOver: allowReorder ? (e) => handleDragOver(e, layer.id) : void 0,
|
|
2916
|
+
onDragLeave: allowReorder ? handleDragLeave : void 0,
|
|
2917
|
+
onDragEnd: allowReorder ? handleDragEnd : void 0,
|
|
2918
|
+
onDrop: allowReorder ? (e) => handleDrop(e, layer.id) : void 0,
|
|
2919
|
+
"data-dragging": isDragging || void 0,
|
|
2920
|
+
"data-drag-over": dragOverPosition,
|
|
2921
|
+
children: [
|
|
2922
|
+
allowReorder && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "classic-layer-drag-handle text-muted-foreground", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2923
|
+
"svg",
|
|
2924
|
+
{
|
|
2925
|
+
width: "12",
|
|
2926
|
+
height: "12",
|
|
2927
|
+
viewBox: "0 0 24 24",
|
|
2928
|
+
fill: "none",
|
|
2929
|
+
stroke: "currentColor",
|
|
2930
|
+
strokeWidth: "2",
|
|
2931
|
+
children: [
|
|
2932
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "9", cy: "6", r: "1", fill: "currentColor" }),
|
|
2933
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "15", cy: "6", r: "1", fill: "currentColor" }),
|
|
2934
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "9", cy: "12", r: "1", fill: "currentColor" }),
|
|
2935
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "15", cy: "12", r: "1", fill: "currentColor" }),
|
|
2936
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "9", cy: "18", r: "1", fill: "currentColor" }),
|
|
2937
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "15", cy: "18", r: "1", fill: "currentColor" })
|
|
2938
|
+
]
|
|
2939
|
+
}
|
|
2940
|
+
) }),
|
|
2941
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2942
|
+
themeReact.Switch,
|
|
2943
|
+
{
|
|
2944
|
+
size: "sm",
|
|
2945
|
+
checked: state.visible,
|
|
2946
|
+
onCheckedChange: () => handleToggleLayer(layer.id),
|
|
2947
|
+
"aria-label": `Toggle ${layer.name}`
|
|
2948
|
+
}
|
|
2949
|
+
),
|
|
2950
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
2951
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
2952
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-foreground truncate", children: layer.name }),
|
|
2953
|
+
state.loading && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2954
|
+
"svg",
|
|
2955
|
+
{
|
|
2956
|
+
className: "classic-layer-loading w-3 h-3 text-muted-foreground",
|
|
2957
|
+
viewBox: "0 0 24 24",
|
|
2958
|
+
fill: "none",
|
|
2959
|
+
stroke: "currentColor",
|
|
2960
|
+
strokeWidth: "2",
|
|
2961
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 2v4m0 12v4M4.93 4.93l2.83 2.83m8.48 8.48l2.83 2.83M2 12h4m12 0h4M4.93 19.07l2.83-2.83m8.48-8.48l2.83-2.83" })
|
|
2962
|
+
}
|
|
2963
|
+
)
|
|
2964
|
+
] }),
|
|
2965
|
+
state.error && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "classic-layer-error", children: state.error })
|
|
2966
|
+
] }),
|
|
2967
|
+
showOpacity && state.visible && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2968
|
+
"button",
|
|
2969
|
+
{
|
|
2970
|
+
type: "button",
|
|
2971
|
+
className: "text-muted-foreground hover:text-foreground p-1",
|
|
2972
|
+
onClick: () => setExpandedOpacity(expandedOpacity === layer.id ? null : layer.id),
|
|
2973
|
+
"aria-label": "Adjust opacity",
|
|
2974
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2975
|
+
"svg",
|
|
2976
|
+
{
|
|
2977
|
+
width: "14",
|
|
2978
|
+
height: "14",
|
|
2979
|
+
viewBox: "0 0 24 24",
|
|
2980
|
+
fill: "none",
|
|
2981
|
+
stroke: "currentColor",
|
|
2982
|
+
strokeWidth: "2",
|
|
2983
|
+
children: [
|
|
2984
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
2985
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 2a10 10 0 0 1 0 20", fill: "currentColor", opacity: "0.3" })
|
|
2986
|
+
]
|
|
2987
|
+
}
|
|
2988
|
+
)
|
|
2989
|
+
}
|
|
2990
|
+
)
|
|
2991
|
+
]
|
|
2992
|
+
},
|
|
2993
|
+
layer.id
|
|
2994
|
+
);
|
|
2995
|
+
};
|
|
2996
|
+
const renderOpacitySlider = (layerId) => {
|
|
2997
|
+
if (expandedOpacity !== layerId) return null;
|
|
2998
|
+
const state = layerStates.get(layerId);
|
|
2999
|
+
if (!state) return null;
|
|
3000
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 pb-2", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
3001
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground w-12", children: "Opacity" }),
|
|
3002
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3003
|
+
"input",
|
|
3004
|
+
{
|
|
3005
|
+
type: "range",
|
|
3006
|
+
min: "0",
|
|
3007
|
+
max: "100",
|
|
3008
|
+
value: state.opacity * 100,
|
|
3009
|
+
onChange: (e) => handleOpacityChange(layerId, Number(e.target.value) / 100),
|
|
3010
|
+
className: "classic-layer-opacity-slider flex-1"
|
|
3011
|
+
}
|
|
3012
|
+
),
|
|
3013
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-muted-foreground w-8 text-right", children: [
|
|
3014
|
+
Math.round(state.opacity * 100),
|
|
3015
|
+
"%"
|
|
3016
|
+
] })
|
|
3017
|
+
] }) });
|
|
3018
|
+
};
|
|
3019
|
+
const visibleLayerStates = mapsCore.getLayerStatesArray(layerStates).filter((s) => s.visible);
|
|
3020
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3021
|
+
visibleLayerStates.map((state) => {
|
|
3022
|
+
const layer = layers.find((l) => l.id === state.id);
|
|
3023
|
+
return layer ? renderLayer(layer, state) : null;
|
|
3024
|
+
}),
|
|
3025
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3026
|
+
"div",
|
|
3027
|
+
{
|
|
3028
|
+
ref: containerRef,
|
|
3029
|
+
className: cn("absolute z-10", computedPositionClasses, className),
|
|
3030
|
+
style: verticalOffsetStyle,
|
|
3031
|
+
children: [
|
|
3032
|
+
isOpen && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3033
|
+
"div",
|
|
3034
|
+
{
|
|
3035
|
+
className: cn(
|
|
3036
|
+
"absolute classic-layer-panel-enter",
|
|
3037
|
+
"bg-card rounded-lg shadow-lg border border-black dark:border-gray-400",
|
|
3038
|
+
"w-64",
|
|
3039
|
+
isTop ? "top-full mt-1" : "bottom-full mb-1",
|
|
3040
|
+
position.includes("right") ? "right-0" : "left-0"
|
|
3041
|
+
),
|
|
3042
|
+
children: [
|
|
3043
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between p-3 border-b border-border", children: [
|
|
3044
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium text-foreground", children: "Layers" }),
|
|
3045
|
+
collapsible && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3046
|
+
"button",
|
|
3047
|
+
{
|
|
3048
|
+
type: "button",
|
|
3049
|
+
className: "text-muted-foreground hover:text-foreground",
|
|
3050
|
+
onClick: () => setIsOpen(false),
|
|
3051
|
+
"aria-label": "Close layer manager",
|
|
3052
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3053
|
+
"svg",
|
|
3054
|
+
{
|
|
3055
|
+
width: "16",
|
|
3056
|
+
height: "16",
|
|
3057
|
+
viewBox: "0 0 24 24",
|
|
3058
|
+
fill: "none",
|
|
3059
|
+
stroke: "currentColor",
|
|
3060
|
+
strokeWidth: "2",
|
|
3061
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
3062
|
+
}
|
|
3063
|
+
)
|
|
3064
|
+
}
|
|
3065
|
+
)
|
|
3066
|
+
] }),
|
|
3067
|
+
showSearch && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-2 border-b border-border", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3068
|
+
"input",
|
|
3069
|
+
{
|
|
3070
|
+
type: "text",
|
|
3071
|
+
placeholder: "Search layers...",
|
|
3072
|
+
value: searchQuery,
|
|
3073
|
+
onChange: (e) => setSearchQuery(e.target.value),
|
|
3074
|
+
className: "classic-layer-search"
|
|
3075
|
+
}
|
|
3076
|
+
) }),
|
|
3077
|
+
showCategories && categories.length > 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-2 border-b border-border", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "classic-layer-tabs", children: [
|
|
3078
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3079
|
+
"button",
|
|
3080
|
+
{
|
|
3081
|
+
type: "button",
|
|
3082
|
+
className: "classic-layer-tab",
|
|
3083
|
+
"data-active": activeCategory === "all",
|
|
3084
|
+
onClick: () => setActiveCategory("all"),
|
|
3085
|
+
children: "All"
|
|
3086
|
+
}
|
|
3087
|
+
),
|
|
3088
|
+
categories.map((cat) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3089
|
+
"button",
|
|
3090
|
+
{
|
|
3091
|
+
type: "button",
|
|
3092
|
+
className: "classic-layer-tab",
|
|
3093
|
+
"data-active": activeCategory === cat,
|
|
3094
|
+
onClick: () => setActiveCategory(cat),
|
|
3095
|
+
children: mapsCore.CATEGORY_META[cat].label
|
|
3096
|
+
},
|
|
3097
|
+
cat
|
|
3098
|
+
))
|
|
3099
|
+
] }) }),
|
|
3100
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "max-h-64 overflow-y-auto", children: [
|
|
3101
|
+
showCategories && layerGroups && activeCategory === "all" ? (
|
|
3102
|
+
// Grouped by category
|
|
3103
|
+
categories.map((cat) => {
|
|
3104
|
+
const catLayers = layerGroups[cat];
|
|
3105
|
+
if (catLayers.length === 0) return null;
|
|
3106
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
3107
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-2 text-xs font-medium text-muted-foreground uppercase tracking-wider", children: mapsCore.CATEGORY_META[cat].label }),
|
|
3108
|
+
catLayers.map((layer) => /* @__PURE__ */ jsxRuntime.jsxs(React25__namespace.Fragment, { children: [
|
|
3109
|
+
renderLayerItem(layer),
|
|
3110
|
+
renderOpacitySlider(layer.id)
|
|
3111
|
+
] }, layer.id))
|
|
3112
|
+
] }, cat);
|
|
3113
|
+
})
|
|
3114
|
+
) : (
|
|
3115
|
+
// Flat list
|
|
3116
|
+
filteredLayers.map((layer) => /* @__PURE__ */ jsxRuntime.jsxs(React25__namespace.Fragment, { children: [
|
|
3117
|
+
renderLayerItem(layer),
|
|
3118
|
+
renderOpacitySlider(layer.id)
|
|
3119
|
+
] }, layer.id))
|
|
3120
|
+
),
|
|
3121
|
+
filteredLayers.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 text-center text-sm text-muted-foreground", children: "No layers found" })
|
|
3122
|
+
] })
|
|
3123
|
+
]
|
|
3124
|
+
}
|
|
3125
|
+
),
|
|
3126
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3127
|
+
"button",
|
|
3128
|
+
{
|
|
3129
|
+
type: "button",
|
|
3130
|
+
className: cn(
|
|
3131
|
+
"w-[40px] h-[40px] flex items-center justify-center",
|
|
3132
|
+
"bg-card rounded shadow-lg border border-black dark:border-gray-400",
|
|
3133
|
+
"hover:bg-muted transition-colors cursor-pointer",
|
|
3134
|
+
"text-foreground"
|
|
3135
|
+
),
|
|
3136
|
+
onClick: () => setIsOpen(!isOpen),
|
|
3137
|
+
"aria-label": "Toggle layer manager",
|
|
3138
|
+
"aria-expanded": isOpen,
|
|
3139
|
+
"aria-haspopup": "true",
|
|
3140
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3141
|
+
"svg",
|
|
3142
|
+
{
|
|
3143
|
+
width: "20",
|
|
3144
|
+
height: "20",
|
|
3145
|
+
viewBox: "0 0 24 24",
|
|
3146
|
+
fill: "none",
|
|
3147
|
+
stroke: "currentColor",
|
|
3148
|
+
strokeWidth: "2",
|
|
3149
|
+
strokeLinecap: "round",
|
|
3150
|
+
strokeLinejoin: "round",
|
|
3151
|
+
children: [
|
|
3152
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12.89 1.45l8 4A2 2 0 0 1 22 7.24v9.53a2 2 0 0 1-1.11 1.79l-8 4a2 2 0 0 1-1.78 0l-8-4a2 2 0 0 1-1.11-1.8V7.24a2 2 0 0 1 1.11-1.79l8-4a2 2 0 0 1 1.78 0z" }),
|
|
3153
|
+
/* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "2.32 6.16 12 11 21.68 6.16" }),
|
|
3154
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "22.76", x2: "12", y2: "11" })
|
|
3155
|
+
]
|
|
3156
|
+
}
|
|
3157
|
+
)
|
|
3158
|
+
}
|
|
3159
|
+
)
|
|
3160
|
+
]
|
|
3161
|
+
}
|
|
3162
|
+
)
|
|
3163
|
+
] });
|
|
3164
|
+
};
|
|
3165
|
+
LayerManager.displayName = "LayerManager";
|
|
2583
3166
|
var DeckOverlay = ({
|
|
2584
3167
|
layers = [],
|
|
2585
3168
|
onHover,
|
|
@@ -2590,9 +3173,9 @@ var DeckOverlay = ({
|
|
|
2590
3173
|
deckProps = {}
|
|
2591
3174
|
}) => {
|
|
2592
3175
|
const { map, loaded } = useMap();
|
|
2593
|
-
const overlayRef =
|
|
2594
|
-
const MapboxOverlayRef =
|
|
2595
|
-
|
|
3176
|
+
const overlayRef = React25__namespace.useRef(null);
|
|
3177
|
+
const MapboxOverlayRef = React25__namespace.useRef(null);
|
|
3178
|
+
React25__namespace.useEffect(() => {
|
|
2596
3179
|
if (!map || !loaded) return;
|
|
2597
3180
|
let cancelled = false;
|
|
2598
3181
|
const initOverlay = async () => {
|
|
@@ -2632,12 +3215,12 @@ var DeckOverlay = ({
|
|
|
2632
3215
|
}
|
|
2633
3216
|
};
|
|
2634
3217
|
}, [map, loaded, interleaved]);
|
|
2635
|
-
|
|
3218
|
+
React25__namespace.useEffect(() => {
|
|
2636
3219
|
if (overlayRef.current && "setProps" in overlayRef.current) {
|
|
2637
3220
|
overlayRef.current.setProps({ layers });
|
|
2638
3221
|
}
|
|
2639
3222
|
}, [layers]);
|
|
2640
|
-
|
|
3223
|
+
React25__namespace.useEffect(() => {
|
|
2641
3224
|
if (overlayRef.current && "setProps" in overlayRef.current) {
|
|
2642
3225
|
overlayRef.current.setProps({
|
|
2643
3226
|
onHover,
|
|
@@ -2645,7 +3228,7 @@ var DeckOverlay = ({
|
|
|
2645
3228
|
});
|
|
2646
3229
|
}
|
|
2647
3230
|
}, [onHover, onClick]);
|
|
2648
|
-
|
|
3231
|
+
React25__namespace.useEffect(() => {
|
|
2649
3232
|
if (overlayRef.current && effects && "setProps" in overlayRef.current) {
|
|
2650
3233
|
overlayRef.current.setProps({ effects });
|
|
2651
3234
|
}
|
|
@@ -2654,10 +3237,30 @@ var DeckOverlay = ({
|
|
|
2654
3237
|
};
|
|
2655
3238
|
DeckOverlay.displayName = "DeckOverlay";
|
|
2656
3239
|
|
|
3240
|
+
Object.defineProperty(exports, "BIKE_LANES", {
|
|
3241
|
+
enumerable: true,
|
|
3242
|
+
get: function () { return mapsCore.BIKE_LANES; }
|
|
3243
|
+
});
|
|
2657
3244
|
Object.defineProperty(exports, "BUILTIN_BASEMAPS", {
|
|
2658
3245
|
enumerable: true,
|
|
2659
3246
|
get: function () { return mapsCore.BUILTIN_BASEMAPS; }
|
|
2660
3247
|
});
|
|
3248
|
+
Object.defineProperty(exports, "BUILTIN_OVERLAY_LAYERS", {
|
|
3249
|
+
enumerable: true,
|
|
3250
|
+
get: function () { return mapsCore.BUILTIN_OVERLAY_LAYERS; }
|
|
3251
|
+
});
|
|
3252
|
+
Object.defineProperty(exports, "CATEGORY_META", {
|
|
3253
|
+
enumerable: true,
|
|
3254
|
+
get: function () { return mapsCore.CATEGORY_META; }
|
|
3255
|
+
});
|
|
3256
|
+
Object.defineProperty(exports, "CITY_LIMITS", {
|
|
3257
|
+
enumerable: true,
|
|
3258
|
+
get: function () { return mapsCore.CITY_LIMITS; }
|
|
3259
|
+
});
|
|
3260
|
+
Object.defineProperty(exports, "FLOOD_ZONES", {
|
|
3261
|
+
enumerable: true,
|
|
3262
|
+
get: function () { return mapsCore.FLOOD_ZONES; }
|
|
3263
|
+
});
|
|
2661
3264
|
Object.defineProperty(exports, "FREE_BASEMAPS", {
|
|
2662
3265
|
enumerable: true,
|
|
2663
3266
|
get: function () { return mapsCore.FREE_BASEMAPS; }
|
|
@@ -2666,6 +3269,18 @@ Object.defineProperty(exports, "OSM_STANDARD", {
|
|
|
2666
3269
|
enumerable: true,
|
|
2667
3270
|
get: function () { return mapsCore.OSM_STANDARD; }
|
|
2668
3271
|
});
|
|
3272
|
+
Object.defineProperty(exports, "PARKS", {
|
|
3273
|
+
enumerable: true,
|
|
3274
|
+
get: function () { return mapsCore.PARKS; }
|
|
3275
|
+
});
|
|
3276
|
+
Object.defineProperty(exports, "SCHOOL_DISTRICTS", {
|
|
3277
|
+
enumerable: true,
|
|
3278
|
+
get: function () { return mapsCore.SCHOOL_DISTRICTS; }
|
|
3279
|
+
});
|
|
3280
|
+
Object.defineProperty(exports, "SPORTS_FACILITIES", {
|
|
3281
|
+
enumerable: true,
|
|
3282
|
+
get: function () { return mapsCore.SPORTS_FACILITIES; }
|
|
3283
|
+
});
|
|
2669
3284
|
Object.defineProperty(exports, "THEME_DARK", {
|
|
2670
3285
|
enumerable: true,
|
|
2671
3286
|
get: function () { return mapsCore.THEME_DARK; }
|
|
@@ -2674,6 +3289,22 @@ Object.defineProperty(exports, "THEME_LIGHT", {
|
|
|
2674
3289
|
enumerable: true,
|
|
2675
3290
|
get: function () { return mapsCore.THEME_LIGHT; }
|
|
2676
3291
|
});
|
|
3292
|
+
Object.defineProperty(exports, "TRAILS", {
|
|
3293
|
+
enumerable: true,
|
|
3294
|
+
get: function () { return mapsCore.TRAILS; }
|
|
3295
|
+
});
|
|
3296
|
+
Object.defineProperty(exports, "TRANSIT_ROUTES", {
|
|
3297
|
+
enumerable: true,
|
|
3298
|
+
get: function () { return mapsCore.TRANSIT_ROUTES; }
|
|
3299
|
+
});
|
|
3300
|
+
Object.defineProperty(exports, "WATERSHEDS", {
|
|
3301
|
+
enumerable: true,
|
|
3302
|
+
get: function () { return mapsCore.WATERSHEDS; }
|
|
3303
|
+
});
|
|
3304
|
+
Object.defineProperty(exports, "ZONING_DISTRICTS", {
|
|
3305
|
+
enumerable: true,
|
|
3306
|
+
get: function () { return mapsCore.ZONING_DISTRICTS; }
|
|
3307
|
+
});
|
|
2677
3308
|
Object.defineProperty(exports, "calculateBounds", {
|
|
2678
3309
|
enumerable: true,
|
|
2679
3310
|
get: function () { return mapsCore.calculateBounds; }
|
|
@@ -2694,6 +3325,10 @@ Object.defineProperty(exports, "createHoverExpression", {
|
|
|
2694
3325
|
enumerable: true,
|
|
2695
3326
|
get: function () { return mapsCore.createHoverExpression; }
|
|
2696
3327
|
});
|
|
3328
|
+
Object.defineProperty(exports, "createInitialLayerStates", {
|
|
3329
|
+
enumerable: true,
|
|
3330
|
+
get: function () { return mapsCore.createInitialLayerStates; }
|
|
3331
|
+
});
|
|
2697
3332
|
Object.defineProperty(exports, "createSelectionExpression", {
|
|
2698
3333
|
enumerable: true,
|
|
2699
3334
|
get: function () { return mapsCore.createSelectionExpression; }
|
|
@@ -2762,10 +3397,26 @@ Object.defineProperty(exports, "getHighlightStyle", {
|
|
|
2762
3397
|
enumerable: true,
|
|
2763
3398
|
get: function () { return mapsCore.getHighlightStyle; }
|
|
2764
3399
|
});
|
|
3400
|
+
Object.defineProperty(exports, "getLayerCategories", {
|
|
3401
|
+
enumerable: true,
|
|
3402
|
+
get: function () { return mapsCore.getLayerCategories; }
|
|
3403
|
+
});
|
|
3404
|
+
Object.defineProperty(exports, "getLayerStyleForTheme", {
|
|
3405
|
+
enumerable: true,
|
|
3406
|
+
get: function () { return mapsCore.getLayerStyleForTheme; }
|
|
3407
|
+
});
|
|
3408
|
+
Object.defineProperty(exports, "getLayersByCategory", {
|
|
3409
|
+
enumerable: true,
|
|
3410
|
+
get: function () { return mapsCore.getLayersByCategory; }
|
|
3411
|
+
});
|
|
2765
3412
|
Object.defineProperty(exports, "getSelectionStyle", {
|
|
2766
3413
|
enumerable: true,
|
|
2767
3414
|
get: function () { return mapsCore.getSelectionStyle; }
|
|
2768
3415
|
});
|
|
3416
|
+
Object.defineProperty(exports, "groupLayersByCategory", {
|
|
3417
|
+
enumerable: true,
|
|
3418
|
+
get: function () { return mapsCore.groupLayersByCategory; }
|
|
3419
|
+
});
|
|
2769
3420
|
Object.defineProperty(exports, "isClusterFeature", {
|
|
2770
3421
|
enumerable: true,
|
|
2771
3422
|
get: function () { return mapsCore.isClusterFeature; }
|
|
@@ -2790,6 +3441,22 @@ Object.defineProperty(exports, "resolveBasemapStyle", {
|
|
|
2790
3441
|
enumerable: true,
|
|
2791
3442
|
get: function () { return mapsCore.resolveBasemapStyle; }
|
|
2792
3443
|
});
|
|
3444
|
+
Object.defineProperty(exports, "resolveLayerSourceUrl", {
|
|
3445
|
+
enumerable: true,
|
|
3446
|
+
get: function () { return mapsCore.resolveLayerSourceUrl; }
|
|
3447
|
+
});
|
|
3448
|
+
Object.defineProperty(exports, "searchLayers", {
|
|
3449
|
+
enumerable: true,
|
|
3450
|
+
get: function () { return mapsCore.searchLayers; }
|
|
3451
|
+
});
|
|
3452
|
+
Object.defineProperty(exports, "setLayerOpacity", {
|
|
3453
|
+
enumerable: true,
|
|
3454
|
+
get: function () { return mapsCore.setLayerOpacity; }
|
|
3455
|
+
});
|
|
3456
|
+
Object.defineProperty(exports, "toggleLayerVisibility", {
|
|
3457
|
+
enumerable: true,
|
|
3458
|
+
get: function () { return mapsCore.toggleLayerVisibility; }
|
|
3459
|
+
});
|
|
2793
3460
|
Object.defineProperty(exports, "validateGeoJSON", {
|
|
2794
3461
|
enumerable: true,
|
|
2795
3462
|
get: function () { return mapsCore.validateGeoJSON; }
|
|
@@ -2801,10 +3468,11 @@ exports.DeckOverlay = DeckOverlay;
|
|
|
2801
3468
|
exports.FillExtrusionLayer = FillExtrusionLayer;
|
|
2802
3469
|
exports.FillLayer = FillLayer;
|
|
2803
3470
|
exports.HeatmapLayer = HeatmapLayer;
|
|
3471
|
+
exports.LayerManager = LayerManager;
|
|
2804
3472
|
exports.Legend = Legend;
|
|
2805
3473
|
exports.LegendGroup = LegendGroup;
|
|
2806
3474
|
exports.LineLayer = LineLayer;
|
|
2807
|
-
exports.Map =
|
|
3475
|
+
exports.Map = Map2;
|
|
2808
3476
|
exports.MapContainer = MapContainer;
|
|
2809
3477
|
exports.MapContext = MapContext;
|
|
2810
3478
|
exports.MapEmpty = MapEmpty;
|