@classic-homes/maps-react 0.6.1 → 0.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -1
- package/dist/index.cjs +123 -57
- package/dist/index.css +170 -156
- package/dist/index.d.cts +8 -3
- package/dist/index.d.ts +8 -3
- package/dist/index.js +115 -47
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -12,6 +12,25 @@ The ESM build imports the MapLibre and component styles itself. The CommonJS
|
|
|
12
12
|
build does not (Node cannot `require()` CSS); import them once from
|
|
13
13
|
`@classic-homes/maps-react/styles.css` when you load the package that way.
|
|
14
14
|
|
|
15
|
+
### MapLibre 6: set the worker URL
|
|
16
|
+
|
|
17
|
+
MapLibre 6 loads its tile worker from a separate file, which it cannot find on
|
|
18
|
+
its own under a bundler. Set the URL once at app startup, before the first map
|
|
19
|
+
renders; without it every map fails with "Worker failed to load".
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { setWorkerUrl } from 'maplibre-gl';
|
|
23
|
+
import workerUrl from 'maplibre-gl/dist/maplibre-gl-worker.mjs?worker&url'; // Vite
|
|
24
|
+
|
|
25
|
+
setWorkerUrl(workerUrl);
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
With webpack: `setWorkerUrl(new URL('maplibre-gl/dist/maplibre-gl-worker.mjs', import.meta.url).toString())`.
|
|
29
|
+
MapLibre 5 bundles its worker and needs none of this.
|
|
30
|
+
|
|
31
|
+
MapLibre 6 is ESM-only, with no `require` entry, so CommonJS consumers stay
|
|
32
|
+
on MapLibre 5.
|
|
33
|
+
|
|
15
34
|
## Features
|
|
16
35
|
|
|
17
36
|
- **Declarative Components**: React-friendly API for MapLibre GL
|
|
@@ -440,7 +459,7 @@ import type {
|
|
|
440
459
|
|
|
441
460
|
- `react` >= 18.0.0
|
|
442
461
|
- `react-dom` >= 18.0.0
|
|
443
|
-
- `maplibre-gl`
|
|
462
|
+
- `maplibre-gl` ^5.0.0 || ^6.11.0
|
|
444
463
|
|
|
445
464
|
## License
|
|
446
465
|
|
package/dist/index.cjs
CHANGED
|
@@ -11,8 +11,6 @@ var utils = require('@classic-homes/maps-core/utils');
|
|
|
11
11
|
var classVarianceAuthority = require('class-variance-authority');
|
|
12
12
|
var themeReact = require('@classic-homes/theme-react');
|
|
13
13
|
|
|
14
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
-
|
|
16
14
|
function _interopNamespace(e) {
|
|
17
15
|
if (e && e.__esModule) return e;
|
|
18
16
|
var n = Object.create(null);
|
|
@@ -32,7 +30,7 @@ function _interopNamespace(e) {
|
|
|
32
30
|
}
|
|
33
31
|
|
|
34
32
|
var React6__namespace = /*#__PURE__*/_interopNamespace(React6);
|
|
35
|
-
var
|
|
33
|
+
var maplibregl__namespace = /*#__PURE__*/_interopNamespace(maplibregl);
|
|
36
34
|
var ReactDOM__namespace = /*#__PURE__*/_interopNamespace(ReactDOM);
|
|
37
35
|
|
|
38
36
|
// src/components/base/MapContainer.tsx
|
|
@@ -101,7 +99,7 @@ var MapError = React6__namespace.forwardRef(
|
|
|
101
99
|
{
|
|
102
100
|
ref,
|
|
103
101
|
className: cn(
|
|
104
|
-
"flex flex-col items-center justify-center rounded-lg border border-destructive
|
|
102
|
+
"flex flex-col items-center justify-center rounded-lg border border-destructive bg-background",
|
|
105
103
|
className
|
|
106
104
|
),
|
|
107
105
|
style: { height: heightStyle },
|
|
@@ -139,7 +137,7 @@ var MapError = React6__namespace.forwardRef(
|
|
|
139
137
|
"button",
|
|
140
138
|
{
|
|
141
139
|
onClick: onRetry,
|
|
142
|
-
className: "mt-2 rounded-md border border-input bg-background px-4 py-2 text-sm font-medium shadow-sm hover:bg-
|
|
140
|
+
className: "mt-2 rounded-md border border-input bg-background px-4 py-2 text-sm font-medium shadow-sm hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
143
141
|
children: "Retry"
|
|
144
142
|
}
|
|
145
143
|
)
|
|
@@ -157,7 +155,7 @@ var MapEmpty = React6__namespace.forwardRef(
|
|
|
157
155
|
{
|
|
158
156
|
ref,
|
|
159
157
|
className: cn(
|
|
160
|
-
"flex flex-col items-center justify-center rounded-lg border border-border bg-muted
|
|
158
|
+
"flex flex-col items-center justify-center rounded-lg border border-border bg-muted",
|
|
161
159
|
className
|
|
162
160
|
),
|
|
163
161
|
style: { height: heightStyle },
|
|
@@ -314,7 +312,7 @@ function getStyleKey(style) {
|
|
|
314
312
|
if (!style) return "";
|
|
315
313
|
return typeof style === "string" ? style : JSON.stringify(style);
|
|
316
314
|
}
|
|
317
|
-
var
|
|
315
|
+
var Map3 = React6__namespace.forwardRef(
|
|
318
316
|
({
|
|
319
317
|
// Base props
|
|
320
318
|
title,
|
|
@@ -444,7 +442,8 @@ var Map2 = React6__namespace.forwardRef(
|
|
|
444
442
|
React6__namespace.useEffect(() => {
|
|
445
443
|
if (!containerRef.current || mapRef.current) return;
|
|
446
444
|
try {
|
|
447
|
-
|
|
445
|
+
mapsCore.warnIfWorkerUrlMissing(maplibregl__namespace);
|
|
446
|
+
const map = new maplibregl__namespace.Map({
|
|
448
447
|
container: containerRef.current,
|
|
449
448
|
style: mapStyle,
|
|
450
449
|
center,
|
|
@@ -476,7 +475,7 @@ var Map2 = React6__namespace.forwardRef(
|
|
|
476
475
|
mapRef.current = map;
|
|
477
476
|
if (navigationControl) {
|
|
478
477
|
map.addControl(
|
|
479
|
-
new
|
|
478
|
+
new maplibregl__namespace.NavigationControl({
|
|
480
479
|
showCompass: true,
|
|
481
480
|
showZoom: true,
|
|
482
481
|
visualizePitch: true
|
|
@@ -496,7 +495,7 @@ var Map2 = React6__namespace.forwardRef(
|
|
|
496
495
|
});
|
|
497
496
|
}
|
|
498
497
|
if (scaleControl) {
|
|
499
|
-
map.addControl(new
|
|
498
|
+
map.addControl(new maplibregl__namespace.ScaleControl({ unit: "metric" }), scaleControlPosition);
|
|
500
499
|
positioningCoordinator.register({
|
|
501
500
|
id: "maplibre-scale-control",
|
|
502
501
|
type: "scale",
|
|
@@ -510,7 +509,7 @@ var Map2 = React6__namespace.forwardRef(
|
|
|
510
509
|
});
|
|
511
510
|
}
|
|
512
511
|
if (fullscreenControl) {
|
|
513
|
-
map.addControl(new
|
|
512
|
+
map.addControl(new maplibregl__namespace.FullscreenControl(), fullscreenControlPosition);
|
|
514
513
|
positioningCoordinator.register({
|
|
515
514
|
id: "maplibre-fullscreen-control",
|
|
516
515
|
type: "custom",
|
|
@@ -525,7 +524,7 @@ var Map2 = React6__namespace.forwardRef(
|
|
|
525
524
|
}
|
|
526
525
|
if (geolocateControl) {
|
|
527
526
|
map.addControl(
|
|
528
|
-
new
|
|
527
|
+
new maplibregl__namespace.GeolocateControl({
|
|
529
528
|
positionOptions: { enableHighAccuracy: true },
|
|
530
529
|
trackUserLocation: true
|
|
531
530
|
}),
|
|
@@ -753,7 +752,7 @@ var Map2 = React6__namespace.forwardRef(
|
|
|
753
752
|
);
|
|
754
753
|
}
|
|
755
754
|
);
|
|
756
|
-
|
|
755
|
+
Map3.displayName = "Map";
|
|
757
756
|
function createSourceRegistry() {
|
|
758
757
|
const versions = /* @__PURE__ */ new Map();
|
|
759
758
|
const stacking = /* @__PURE__ */ new Map();
|
|
@@ -1071,11 +1070,12 @@ var Source = ({
|
|
|
1071
1070
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
1072
1071
|
};
|
|
1073
1072
|
Source.displayName = "Source";
|
|
1074
|
-
var
|
|
1073
|
+
var Marker2 = React6__namespace.forwardRef(
|
|
1075
1074
|
({
|
|
1076
1075
|
id,
|
|
1077
1076
|
coordinates,
|
|
1078
|
-
|
|
1077
|
+
// Heritage Teal, as in Svelte (MapLibre's own default is a light blue)
|
|
1078
|
+
color = mapsCore.markerColor,
|
|
1079
1079
|
anchor = "bottom",
|
|
1080
1080
|
offset,
|
|
1081
1081
|
rotation,
|
|
@@ -1128,7 +1128,7 @@ var Marker = React6__namespace.forwardRef(
|
|
|
1128
1128
|
if (children && elementRef.current) {
|
|
1129
1129
|
markerOptions.element = elementRef.current;
|
|
1130
1130
|
}
|
|
1131
|
-
const marker = new
|
|
1131
|
+
const marker = new maplibregl__namespace.Marker(markerOptions).setLngLat(coordinates).addTo(map);
|
|
1132
1132
|
const el = marker.getElement();
|
|
1133
1133
|
mapsCore.applyMarkerProtection(el);
|
|
1134
1134
|
if (children && elementRef.current) {
|
|
@@ -1283,7 +1283,7 @@ var Marker = React6__namespace.forwardRef(
|
|
|
1283
1283
|
return null;
|
|
1284
1284
|
}
|
|
1285
1285
|
);
|
|
1286
|
-
|
|
1286
|
+
Marker2.displayName = "Marker";
|
|
1287
1287
|
function useStructuralValue(next) {
|
|
1288
1288
|
const ref = React6__namespace.useRef(next);
|
|
1289
1289
|
if (ref.current !== next && JSON.stringify(ref.current) !== JSON.stringify(next)) {
|
|
@@ -1291,7 +1291,7 @@ function useStructuralValue(next) {
|
|
|
1291
1291
|
}
|
|
1292
1292
|
return ref.current;
|
|
1293
1293
|
}
|
|
1294
|
-
var
|
|
1294
|
+
var Popup2 = React6__namespace.forwardRef(
|
|
1295
1295
|
({
|
|
1296
1296
|
coordinates: coordinatesProp,
|
|
1297
1297
|
closeButton = true,
|
|
@@ -1333,7 +1333,7 @@ var Popup = React6__namespace.forwardRef(
|
|
|
1333
1333
|
}, []);
|
|
1334
1334
|
React6__namespace.useEffect(() => {
|
|
1335
1335
|
if (!map || !loaded || !containerRef.current) return;
|
|
1336
|
-
const popup = new
|
|
1336
|
+
const popup = new maplibregl__namespace.Popup({
|
|
1337
1337
|
closeButton,
|
|
1338
1338
|
closeOnClick,
|
|
1339
1339
|
closeOnMove,
|
|
@@ -1414,7 +1414,7 @@ var Popup = React6__namespace.forwardRef(
|
|
|
1414
1414
|
);
|
|
1415
1415
|
}
|
|
1416
1416
|
);
|
|
1417
|
-
|
|
1417
|
+
Popup2.displayName = "Popup";
|
|
1418
1418
|
var PopupCard = React6__namespace.forwardRef(
|
|
1419
1419
|
({ className, children, ...props }, ref) => {
|
|
1420
1420
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("bg-popover text-popover-foreground", className), ...props, children });
|
|
@@ -1442,7 +1442,7 @@ var PopupHeader = React6__namespace.forwardRef(
|
|
|
1442
1442
|
{
|
|
1443
1443
|
ref,
|
|
1444
1444
|
className: cn(
|
|
1445
|
-
"flex items-start justify-between gap-2 border-b border-
|
|
1445
|
+
"flex items-start justify-between gap-2 border-b border-border bg-muted px-4 py-3 pr-12",
|
|
1446
1446
|
className
|
|
1447
1447
|
),
|
|
1448
1448
|
...props,
|
|
@@ -1468,7 +1468,7 @@ var PopupFooter = React6__namespace.forwardRef(
|
|
|
1468
1468
|
{
|
|
1469
1469
|
ref,
|
|
1470
1470
|
className: cn(
|
|
1471
|
-
"flex justify-end gap-2 border-t border-
|
|
1471
|
+
"flex justify-end gap-2 border-t border-border bg-muted px-4 py-3",
|
|
1472
1472
|
className
|
|
1473
1473
|
),
|
|
1474
1474
|
...props,
|
|
@@ -2397,7 +2397,7 @@ var Legend = ({
|
|
|
2397
2397
|
{
|
|
2398
2398
|
ref: legendRef,
|
|
2399
2399
|
className: cn(
|
|
2400
|
-
"absolute bg-card rounded-lg shadow-lg border border-
|
|
2400
|
+
"absolute bg-card rounded-lg shadow-lg border border-border",
|
|
2401
2401
|
"text-sm min-w-[140px]",
|
|
2402
2402
|
!visible && "invisible",
|
|
2403
2403
|
className
|
|
@@ -2447,8 +2447,7 @@ var Legend = ({
|
|
|
2447
2447
|
className: cn(
|
|
2448
2448
|
"flex items-center gap-2 w-full text-left rounded px-1 -mx-1",
|
|
2449
2449
|
onItemClick && "hover:bg-muted cursor-pointer",
|
|
2450
|
-
!onItemClick && "cursor-default"
|
|
2451
|
-
item.active === false && "opacity-50"
|
|
2450
|
+
!onItemClick && "cursor-default"
|
|
2452
2451
|
),
|
|
2453
2452
|
onClick: () => handleItemClick(item, index),
|
|
2454
2453
|
disabled: !onItemClick,
|
|
@@ -2456,11 +2455,21 @@ var Legend = ({
|
|
|
2456
2455
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2457
2456
|
"span",
|
|
2458
2457
|
{
|
|
2459
|
-
className: "w-4 h-4 rounded flex-shrink-0",
|
|
2460
|
-
style: {
|
|
2458
|
+
className: "w-4 h-4 rounded flex-shrink-0 border border-foreground",
|
|
2459
|
+
style: {
|
|
2460
|
+
backgroundColor: item.active === false ? "transparent" : item.color
|
|
2461
|
+
}
|
|
2462
|
+
}
|
|
2463
|
+
),
|
|
2464
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2465
|
+
"span",
|
|
2466
|
+
{
|
|
2467
|
+
className: cn(
|
|
2468
|
+
item.active === false ? "text-muted-foreground line-through" : "text-foreground"
|
|
2469
|
+
),
|
|
2470
|
+
children: item.label
|
|
2461
2471
|
}
|
|
2462
2472
|
),
|
|
2463
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground", children: item.label }),
|
|
2464
2473
|
item.value !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground text-xs", children: item.value })
|
|
2465
2474
|
]
|
|
2466
2475
|
}
|
|
@@ -2526,7 +2535,7 @@ var LegendGroup = ({
|
|
|
2526
2535
|
{
|
|
2527
2536
|
ref: containerRef,
|
|
2528
2537
|
className: cn(
|
|
2529
|
-
"absolute bg-card rounded-lg shadow-lg border border-
|
|
2538
|
+
"absolute bg-card rounded-lg shadow-lg border border-border",
|
|
2530
2539
|
"text-sm min-w-[160px] max-w-[280px]",
|
|
2531
2540
|
!visible && "invisible",
|
|
2532
2541
|
className
|
|
@@ -2591,8 +2600,7 @@ var LegendGroup = ({
|
|
|
2591
2600
|
className: cn(
|
|
2592
2601
|
"flex items-center gap-2 w-full text-left rounded px-1 -mx-1",
|
|
2593
2602
|
legend.onItemClick && "hover:bg-muted cursor-pointer",
|
|
2594
|
-
!legend.onItemClick && "cursor-default"
|
|
2595
|
-
item.active === false && "opacity-50"
|
|
2603
|
+
!legend.onItemClick && "cursor-default"
|
|
2596
2604
|
),
|
|
2597
2605
|
onClick: () => handleItemClick(legend, item, index),
|
|
2598
2606
|
disabled: !legend.onItemClick,
|
|
@@ -2600,11 +2608,22 @@ var LegendGroup = ({
|
|
|
2600
2608
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2601
2609
|
"span",
|
|
2602
2610
|
{
|
|
2603
|
-
className: "w-4 h-4 rounded flex-shrink-0",
|
|
2604
|
-
style: {
|
|
2611
|
+
className: "w-4 h-4 rounded flex-shrink-0 border border-foreground",
|
|
2612
|
+
style: {
|
|
2613
|
+
backgroundColor: item.active === false ? "transparent" : item.color
|
|
2614
|
+
}
|
|
2615
|
+
}
|
|
2616
|
+
),
|
|
2617
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2618
|
+
"span",
|
|
2619
|
+
{
|
|
2620
|
+
className: cn(
|
|
2621
|
+
"truncate flex-1",
|
|
2622
|
+
item.active === false ? "text-muted-foreground line-through" : "text-foreground"
|
|
2623
|
+
),
|
|
2624
|
+
children: item.label
|
|
2605
2625
|
}
|
|
2606
2626
|
),
|
|
2607
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground truncate flex-1", children: item.label }),
|
|
2608
2627
|
item.value !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground text-xs", children: item.value })
|
|
2609
2628
|
]
|
|
2610
2629
|
}
|
|
@@ -2716,14 +2735,14 @@ var CoordinateDisplay = ({
|
|
|
2716
2735
|
className: cn(
|
|
2717
2736
|
"absolute bg-card rounded px-2 py-1",
|
|
2718
2737
|
"text-xs font-mono text-muted-foreground",
|
|
2719
|
-
"border border-
|
|
2738
|
+
"border border-border shadow-sm",
|
|
2720
2739
|
"flex items-center gap-3",
|
|
2721
2740
|
!visible && "invisible",
|
|
2722
2741
|
className
|
|
2723
2742
|
),
|
|
2724
2743
|
style: adjustedStyle,
|
|
2725
2744
|
children: [
|
|
2726
|
-
cursorLngLat ? /* @__PURE__ */ jsxRuntime.jsx("span", { title: "Cursor coordinates", children: formatCoord(cursorLngLat) }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground
|
|
2745
|
+
cursorLngLat ? /* @__PURE__ */ jsxRuntime.jsx("span", { title: "Cursor coordinates", children: formatCoord(cursorLngLat) }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Move cursor over map" }),
|
|
2727
2746
|
showZoom && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2728
2747
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-border", children: "|" }),
|
|
2729
2748
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { title: "Zoom level", children: [
|
|
@@ -2857,7 +2876,7 @@ var BasemapSwitcher = ({
|
|
|
2857
2876
|
ref: panelRef,
|
|
2858
2877
|
className: cn(
|
|
2859
2878
|
"absolute classic-basemap-panel-enter",
|
|
2860
|
-
"bg-card rounded-lg shadow-lg border border-
|
|
2879
|
+
"bg-card rounded-lg shadow-lg border border-border",
|
|
2861
2880
|
"p-2",
|
|
2862
2881
|
isTop ? "top-full mt-1" : "bottom-full mb-1",
|
|
2863
2882
|
position.includes("right") ? "right-0" : "left-0"
|
|
@@ -2890,8 +2909,9 @@ var BasemapSwitcher = ({
|
|
|
2890
2909
|
tabIndex: index === tabStopIndex ? 0 : -1,
|
|
2891
2910
|
className: cn(
|
|
2892
2911
|
"flex flex-col items-center gap-1 p-1 rounded cursor-pointer",
|
|
2893
|
-
|
|
2894
|
-
|
|
2912
|
+
// Selected: Linen, a check and a bold label. The ring is the focus
|
|
2913
|
+
// indicator only, so arrowing onto an option never looks selected
|
|
2914
|
+
isActive ? "bg-accent" : "hover:bg-muted"
|
|
2895
2915
|
),
|
|
2896
2916
|
onFocus: () => setTabStopIndex(index),
|
|
2897
2917
|
onClick: () => handleSelect(basemap),
|
|
@@ -2910,7 +2930,34 @@ var BasemapSwitcher = ({
|
|
|
2910
2930
|
}
|
|
2911
2931
|
}
|
|
2912
2932
|
),
|
|
2913
|
-
/* @__PURE__ */ jsxRuntime.
|
|
2933
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2934
|
+
"span",
|
|
2935
|
+
{
|
|
2936
|
+
className: cn(
|
|
2937
|
+
"text-[10px] text-foreground truncate w-full text-center leading-tight",
|
|
2938
|
+
isActive && "font-semibold"
|
|
2939
|
+
),
|
|
2940
|
+
children: [
|
|
2941
|
+
isActive && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2942
|
+
"svg",
|
|
2943
|
+
{
|
|
2944
|
+
"aria-hidden": "true",
|
|
2945
|
+
width: "10",
|
|
2946
|
+
height: "10",
|
|
2947
|
+
viewBox: "0 0 24 24",
|
|
2948
|
+
fill: "none",
|
|
2949
|
+
stroke: "currentColor",
|
|
2950
|
+
strokeWidth: "3",
|
|
2951
|
+
strokeLinecap: "round",
|
|
2952
|
+
strokeLinejoin: "round",
|
|
2953
|
+
style: { display: "inline", verticalAlign: "-1px", marginRight: 2 },
|
|
2954
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M20 6 9 17l-5-5" })
|
|
2955
|
+
}
|
|
2956
|
+
),
|
|
2957
|
+
basemap.label ?? basemap.name
|
|
2958
|
+
]
|
|
2959
|
+
}
|
|
2960
|
+
)
|
|
2914
2961
|
]
|
|
2915
2962
|
},
|
|
2916
2963
|
basemap.id
|
|
@@ -2927,7 +2974,7 @@ var BasemapSwitcher = ({
|
|
|
2927
2974
|
type: "button",
|
|
2928
2975
|
className: cn(
|
|
2929
2976
|
"w-[40px] h-[40px] flex items-center justify-center",
|
|
2930
|
-
"bg-card rounded shadow-lg border border-
|
|
2977
|
+
"bg-card rounded shadow-lg border border-border",
|
|
2931
2978
|
"hover:bg-muted cursor-pointer",
|
|
2932
2979
|
"text-foreground"
|
|
2933
2980
|
),
|
|
@@ -3192,17 +3239,32 @@ var LayerManager = ({
|
|
|
3192
3239
|
icon: paint["icon-opacity"] ?? 1
|
|
3193
3240
|
};
|
|
3194
3241
|
switch (layer.style.renderType) {
|
|
3195
|
-
case "fill":
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3242
|
+
case "fill": {
|
|
3243
|
+
const outline = mapsCore.getOutlineStyleForTheme(layer, theme);
|
|
3244
|
+
layerComponent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3245
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3246
|
+
FillLayer,
|
|
3247
|
+
{
|
|
3248
|
+
...layerProps,
|
|
3249
|
+
fillColor: paint["fill-color"],
|
|
3250
|
+
fillOpacity: baseOpacity.fill * state.opacity,
|
|
3251
|
+
fillOutlineColor: paint["fill-outline-color"]
|
|
3252
|
+
}
|
|
3253
|
+
),
|
|
3254
|
+
outline && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3255
|
+
LineLayer,
|
|
3256
|
+
{
|
|
3257
|
+
...layerProps,
|
|
3258
|
+
id: `${layerProps.id}${mapsCore.OUTLINE_LAYER_SUFFIX}`,
|
|
3259
|
+
lineColor: outline["line-color"],
|
|
3260
|
+
lineWidth: outline["line-width"],
|
|
3261
|
+
lineOpacity: (outline["line-opacity"] ?? 1) * state.opacity,
|
|
3262
|
+
lineDasharray: outline["line-dasharray"]
|
|
3263
|
+
}
|
|
3264
|
+
)
|
|
3265
|
+
] });
|
|
3205
3266
|
break;
|
|
3267
|
+
}
|
|
3206
3268
|
case "line":
|
|
3207
3269
|
layerComponent = /* @__PURE__ */ jsxRuntime.jsx(
|
|
3208
3270
|
LineLayer,
|
|
@@ -3399,7 +3461,7 @@ var LayerManager = ({
|
|
|
3399
3461
|
{
|
|
3400
3462
|
className: cn(
|
|
3401
3463
|
"absolute classic-layer-panel-enter",
|
|
3402
|
-
"bg-card rounded-lg shadow-lg border border-
|
|
3464
|
+
"bg-card rounded-lg shadow-lg border border-border",
|
|
3403
3465
|
"w-64",
|
|
3404
3466
|
isTop ? "top-full mt-1" : "bottom-full mb-1",
|
|
3405
3467
|
position.includes("right") ? "right-0" : "left-0"
|
|
@@ -3446,6 +3508,7 @@ var LayerManager = ({
|
|
|
3446
3508
|
type: "button",
|
|
3447
3509
|
className: "classic-layer-tab",
|
|
3448
3510
|
"data-active": activeCategory === "all",
|
|
3511
|
+
"aria-pressed": activeCategory === "all",
|
|
3449
3512
|
onClick: () => setActiveCategory("all"),
|
|
3450
3513
|
children: "All"
|
|
3451
3514
|
}
|
|
@@ -3456,6 +3519,7 @@ var LayerManager = ({
|
|
|
3456
3519
|
type: "button",
|
|
3457
3520
|
className: "classic-layer-tab",
|
|
3458
3521
|
"data-active": activeCategory === cat,
|
|
3522
|
+
"aria-pressed": activeCategory === cat,
|
|
3459
3523
|
onClick: () => setActiveCategory(cat),
|
|
3460
3524
|
children: mapsCore.CATEGORY_META[cat].label
|
|
3461
3525
|
},
|
|
@@ -3494,7 +3558,7 @@ var LayerManager = ({
|
|
|
3494
3558
|
type: "button",
|
|
3495
3559
|
className: cn(
|
|
3496
3560
|
"w-[40px] h-[40px] flex items-center justify-center",
|
|
3497
|
-
"bg-card rounded shadow-lg border border-
|
|
3561
|
+
"bg-card rounded shadow-lg border border-border",
|
|
3498
3562
|
"hover:bg-muted cursor-pointer",
|
|
3499
3563
|
"text-foreground"
|
|
3500
3564
|
),
|
|
@@ -3588,7 +3652,9 @@ var DeckOverlay = ({
|
|
|
3588
3652
|
const MapboxOverlay = deckMapbox.MapboxOverlay;
|
|
3589
3653
|
MapboxOverlayRef.current = MapboxOverlay;
|
|
3590
3654
|
const overlay = new MapboxOverlay({
|
|
3591
|
-
|
|
3655
|
+
// deck.gl reads map.transform, which MapLibre 6 no longer has: every
|
|
3656
|
+
// interleaved frame would throw, so fall back to overlaid rendering
|
|
3657
|
+
interleaved: mapsCore.resolveDeckInterleaved(map, interleaved),
|
|
3592
3658
|
layers: layersRef.current,
|
|
3593
3659
|
onHover,
|
|
3594
3660
|
onClick,
|
|
@@ -3905,14 +3971,14 @@ exports.LayerManager = LayerManager;
|
|
|
3905
3971
|
exports.Legend = Legend;
|
|
3906
3972
|
exports.LegendGroup = LegendGroup;
|
|
3907
3973
|
exports.LineLayer = LineLayer;
|
|
3908
|
-
exports.Map =
|
|
3974
|
+
exports.Map = Map3;
|
|
3909
3975
|
exports.MapContainer = MapContainer;
|
|
3910
3976
|
exports.MapContext = MapContext;
|
|
3911
3977
|
exports.MapEmpty = MapEmpty;
|
|
3912
3978
|
exports.MapError = MapError;
|
|
3913
3979
|
exports.MapSkeleton = MapSkeleton;
|
|
3914
|
-
exports.Marker =
|
|
3915
|
-
exports.Popup =
|
|
3980
|
+
exports.Marker = Marker2;
|
|
3981
|
+
exports.Popup = Popup2;
|
|
3916
3982
|
exports.PopupCard = PopupCard;
|
|
3917
3983
|
exports.PopupContent = PopupContent;
|
|
3918
3984
|
exports.PopupFooter = PopupFooter;
|