@classic-homes/maps-core 0.5.3 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-ASIFMIU7.js → chunk-4YUKENCX.js} +50 -1
- package/dist/index.cjs +52 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/route/index.cjs +7 -2
- package/dist/route/index.js +8 -3
- package/dist/types/index.d.cts +15 -3
- package/dist/types/index.d.ts +15 -3
- package/dist/utils/index.cjs +52 -0
- package/dist/utils/index.d.cts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/{marker-Dd8fHiBI.d.cts → worker-BvmbGSPq.d.cts} +40 -1
- package/dist/{marker-CGdmHmft.d.ts → worker-Cmyx33j4.d.ts} +40 -1
- package/package.json +3 -3
- package/src/styles/layer-manager.css +1 -5
- package/src/styles/popup.css +1 -3
|
@@ -420,6 +420,26 @@ function generateMoveAnnouncement(center, zoom, action) {
|
|
|
420
420
|
return `Map moved to ${Math.abs(lat).toFixed(2)} ${latDir}, ${Math.abs(lng).toFixed(2)} ${lngDir} at zoom ${zoom.toFixed(1)}`;
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
|
+
function getGridNavigationIndex(key, index, count, columns) {
|
|
424
|
+
if (count <= 0) return null;
|
|
425
|
+
const cols = Math.max(1, Math.floor(columns));
|
|
426
|
+
switch (key) {
|
|
427
|
+
case "ArrowRight":
|
|
428
|
+
return (index + 1) % count;
|
|
429
|
+
case "ArrowLeft":
|
|
430
|
+
return (index - 1 + count) % count;
|
|
431
|
+
case "ArrowDown":
|
|
432
|
+
return index + cols < count ? index + cols : index;
|
|
433
|
+
case "ArrowUp":
|
|
434
|
+
return index - cols >= 0 ? index - cols : index;
|
|
435
|
+
case "Home":
|
|
436
|
+
return 0;
|
|
437
|
+
case "End":
|
|
438
|
+
return count - 1;
|
|
439
|
+
default:
|
|
440
|
+
return null;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
423
443
|
|
|
424
444
|
// src/utils/styles.ts
|
|
425
445
|
function createFillStyle(options) {
|
|
@@ -2830,4 +2850,33 @@ function panToFitPopup(map, popup, padding) {
|
|
|
2830
2850
|
}
|
|
2831
2851
|
}
|
|
2832
2852
|
|
|
2833
|
-
|
|
2853
|
+
// src/utils/worker.ts
|
|
2854
|
+
var SETUP_HINT = ` import { setWorkerUrl } from 'maplibre-gl';
|
|
2855
|
+
import workerUrl from 'maplibre-gl/dist/maplibre-gl-worker.mjs?worker&url'; // Vite
|
|
2856
|
+
setWorkerUrl(workerUrl);
|
|
2857
|
+
|
|
2858
|
+
Webpack: setWorkerUrl(new URL("maplibre-gl/dist/maplibre-gl-worker.mjs", import.meta.url).toString()). See https://maplibre.org/maplibre-gl-js/docs/guides/v5-to-v6-migration-guide/`;
|
|
2859
|
+
var warnedMissingUrl = false;
|
|
2860
|
+
function resetWorkerUrlWarning() {
|
|
2861
|
+
warnedMissingUrl = false;
|
|
2862
|
+
}
|
|
2863
|
+
function warnIfWorkerUrlMissing(maplibregl, log = console.warn) {
|
|
2864
|
+
if (warnedMissingUrl) return false;
|
|
2865
|
+
try {
|
|
2866
|
+
if (typeof maplibregl?.getVersion !== "function" || typeof maplibregl.getWorkerUrl !== "function") {
|
|
2867
|
+
return false;
|
|
2868
|
+
}
|
|
2869
|
+
const major = Number.parseInt(maplibregl.getVersion(), 10);
|
|
2870
|
+
if (!Number.isFinite(major) || major < 6) return false;
|
|
2871
|
+
if (maplibregl.getWorkerUrl()) return false;
|
|
2872
|
+
warnedMissingUrl = true;
|
|
2873
|
+
log(
|
|
2874
|
+
"[maps] MapLibre " + major + ' has no worker URL set. Under a bundler it cannot find its worker on its own, so the map fails with "Worker failed to load". Call setWorkerUrl() once at app startup:\n\n' + SETUP_HINT
|
|
2875
|
+
);
|
|
2876
|
+
return true;
|
|
2877
|
+
} catch {
|
|
2878
|
+
return false;
|
|
2879
|
+
}
|
|
2880
|
+
}
|
|
2881
|
+
|
|
2882
|
+
export { DEFAULT_SIMPLIFICATION_THRESHOLDS, KEYBOARD_CONTROLS, MARKER_PROTECTION_CLASS, applyMarkerChildProtection, applyMarkerProtection, boundsToPolygon, buildRTreeIndex, buildSpatialIndex, calculateBounds, calculateCentroid, calculateZoomThresholds, clampLatitude, combineBounds, countFeaturesByType, createCategoricalColorExpression, createCircleStyle, createClusterCirclePaint, createClusterStyles, createClusterTextLayout, createContinuousColorExpression, createDynamicLODManager, createExtrusionHeightExpression, createExtrusionStyle, createFillStyle, createGeoJSONFingerprint, createHeatmapStyle, createHoverExpression, createIdleViewportManager, createInteractiveExpression, createInteractiveStatusColorExpression, createLineStyle, createLotFillStyle, createLotOutlineStyle, createPredictiveViewportManager, createRTreeViewportManager, createSelectionExpression, createStatusColorExpression, createViewportManager, createViewportQuery, createZoomExpression, decimalToDMS, deepEqual, ensureValidCoordinates, expandCluster, expandClusterToBounds, extendBounds, filterByGeometryType, filterEqual, fingerprintEqual, formatArea, formatBearing, formatBounds, formatCoordinates, formatDistance, formatFeatureProperties, formatLabel, formatPitch, formatPropertyValue, formatScale, formatZoom, generateBoundingPolygon, generateConvexHull, generateFeatureCollectionDescription, generateFeatureTable, generateKeyboardControlsDescription, generateLODData, generateLODDataWithSimplification, generateMapDescription, generateMarkerList, generateMarkersDescription, generateMoveAnnouncement, geoJSONEqual, getChangedPaintProps, getClusterBounds, getClusterChildren, getClusterExpansionZoom, getClusterLeaves, getGridNavigationIndex, getHighlightStyle, getSelectionStyle, getSimplificationToleranceForZoom, getSimplifiedFeaturesForZoom, groupFeaturesByProperty, isClusterFeature, isValidBounds, isValidLatitude, isValidLongitude, loadGeoJSON, normalizeLongitude, normalizePadding, paintPropsEqual, panToFitPopup, prefersReducedMotion, queryByBounds, queryByBoundsWithStats, queryRTreeByBounds, queryRTreeByBoundsWithStats, removeMarkerProtection, resetWorkerUrlWarning, serializeFilter, simplifyFeature, simplifyFeatureCollection, simplifyFeatureCollectionWithStats, simplifyPolygon, validateBoundsArray, validateCoordinates, validateGeoJSON, warnIfWorkerUrlMissing, zoomToScale };
|
package/dist/index.cjs
CHANGED
|
@@ -958,6 +958,26 @@ function generateMoveAnnouncement(center, zoom, action) {
|
|
|
958
958
|
return `Map moved to ${Math.abs(lat).toFixed(2)} ${latDir}, ${Math.abs(lng).toFixed(2)} ${lngDir} at zoom ${zoom.toFixed(1)}`;
|
|
959
959
|
}
|
|
960
960
|
}
|
|
961
|
+
function getGridNavigationIndex(key, index, count, columns) {
|
|
962
|
+
if (count <= 0) return null;
|
|
963
|
+
const cols = Math.max(1, Math.floor(columns));
|
|
964
|
+
switch (key) {
|
|
965
|
+
case "ArrowRight":
|
|
966
|
+
return (index + 1) % count;
|
|
967
|
+
case "ArrowLeft":
|
|
968
|
+
return (index - 1 + count) % count;
|
|
969
|
+
case "ArrowDown":
|
|
970
|
+
return index + cols < count ? index + cols : index;
|
|
971
|
+
case "ArrowUp":
|
|
972
|
+
return index - cols >= 0 ? index - cols : index;
|
|
973
|
+
case "Home":
|
|
974
|
+
return 0;
|
|
975
|
+
case "End":
|
|
976
|
+
return count - 1;
|
|
977
|
+
default:
|
|
978
|
+
return null;
|
|
979
|
+
}
|
|
980
|
+
}
|
|
961
981
|
|
|
962
982
|
// src/utils/styles.ts
|
|
963
983
|
function createFillStyle(options) {
|
|
@@ -3332,6 +3352,35 @@ function applyMarkerChildProtection(element) {
|
|
|
3332
3352
|
style.setProperty("animation", "none", "important");
|
|
3333
3353
|
}
|
|
3334
3354
|
|
|
3355
|
+
// src/utils/worker.ts
|
|
3356
|
+
var SETUP_HINT = ` import { setWorkerUrl } from 'maplibre-gl';
|
|
3357
|
+
import workerUrl from 'maplibre-gl/dist/maplibre-gl-worker.mjs?worker&url'; // Vite
|
|
3358
|
+
setWorkerUrl(workerUrl);
|
|
3359
|
+
|
|
3360
|
+
Webpack: setWorkerUrl(new URL("maplibre-gl/dist/maplibre-gl-worker.mjs", import.meta.url).toString()). See https://maplibre.org/maplibre-gl-js/docs/guides/v5-to-v6-migration-guide/`;
|
|
3361
|
+
var warnedMissingUrl = false;
|
|
3362
|
+
function resetWorkerUrlWarning() {
|
|
3363
|
+
warnedMissingUrl = false;
|
|
3364
|
+
}
|
|
3365
|
+
function warnIfWorkerUrlMissing(maplibregl, log = console.warn) {
|
|
3366
|
+
if (warnedMissingUrl) return false;
|
|
3367
|
+
try {
|
|
3368
|
+
if (typeof maplibregl?.getVersion !== "function" || typeof maplibregl.getWorkerUrl !== "function") {
|
|
3369
|
+
return false;
|
|
3370
|
+
}
|
|
3371
|
+
const major = Number.parseInt(maplibregl.getVersion(), 10);
|
|
3372
|
+
if (!Number.isFinite(major) || major < 6) return false;
|
|
3373
|
+
if (maplibregl.getWorkerUrl()) return false;
|
|
3374
|
+
warnedMissingUrl = true;
|
|
3375
|
+
log(
|
|
3376
|
+
"[maps] MapLibre " + major + ' has no worker URL set. Under a bundler it cannot find its worker on its own, so the map fails with "Worker failed to load". Call setWorkerUrl() once at app startup:\n\n' + SETUP_HINT
|
|
3377
|
+
);
|
|
3378
|
+
return true;
|
|
3379
|
+
} catch {
|
|
3380
|
+
return false;
|
|
3381
|
+
}
|
|
3382
|
+
}
|
|
3383
|
+
|
|
3335
3384
|
// src/basemaps/registry.ts
|
|
3336
3385
|
var DEFAULT_BASEMAP = {
|
|
3337
3386
|
id: "default",
|
|
@@ -4687,6 +4736,7 @@ exports.getClusterChildren = getClusterChildren;
|
|
|
4687
4736
|
exports.getClusterExpansionZoom = getClusterExpansionZoom;
|
|
4688
4737
|
exports.getClusterLeaves = getClusterLeaves;
|
|
4689
4738
|
exports.getContrastTextColor = getContrastTextColor;
|
|
4739
|
+
exports.getGridNavigationIndex = getGridNavigationIndex;
|
|
4690
4740
|
exports.getHighlightStyle = getHighlightStyle;
|
|
4691
4741
|
exports.getLayerCategories = getLayerCategories;
|
|
4692
4742
|
exports.getLayerStatesArray = getLayerStatesArray;
|
|
@@ -4726,6 +4776,7 @@ exports.queryRTreeByBounds = queryRTreeByBounds;
|
|
|
4726
4776
|
exports.queryRTreeByBoundsWithStats = queryRTreeByBoundsWithStats;
|
|
4727
4777
|
exports.removeMarkerProtection = removeMarkerProtection;
|
|
4728
4778
|
exports.reorderLayers = reorderLayers;
|
|
4779
|
+
exports.resetWorkerUrlWarning = resetWorkerUrlWarning;
|
|
4729
4780
|
exports.resolveBasemapStyle = resolveBasemapStyle;
|
|
4730
4781
|
exports.resolveBasemapThumbnail = resolveBasemapThumbnail;
|
|
4731
4782
|
exports.resolveLayerSourceUrl = resolveLayerSourceUrl;
|
|
@@ -4745,4 +4796,5 @@ exports.updateLayerState = updateLayerState;
|
|
|
4745
4796
|
exports.validateBoundsArray = validateBoundsArray;
|
|
4746
4797
|
exports.validateCoordinates = validateCoordinates;
|
|
4747
4798
|
exports.validateGeoJSON = validateGeoJSON;
|
|
4799
|
+
exports.warnIfWorkerUrlMissing = warnIfWorkerUrlMissing;
|
|
4748
4800
|
exports.zoomToScale = zoomToScale;
|
package/dist/index.d.cts
CHANGED
|
@@ -3,8 +3,8 @@ export { MapStyleSpec, darkBasicStyle, generateBasicStyle, generateVectorStyle,
|
|
|
3
3
|
import { G as GeoJSONFeatureCollection } from './data-DCyEqgN0.cjs';
|
|
4
4
|
export { B as BoundsArray, C as ClusterConfig, E as ExtrusionData, a as GeoJSONFeature, b as GeoJSONGeometry, c as GeoJSONLineString, d as GeoJSONMultiLineString, e as GeoJSONMultiPoint, f as GeoJSONMultiPolygon, g as GeoJSONPoint, h as GeoJSONPolygon, H as HeatmapPoint, L as LngLat, M as MapBounds, i as MapSourceData, j as MapViewport, k as MarkerData } from './data-DCyEqgN0.cjs';
|
|
5
5
|
import { BasemapDefinition, BasemapApiKeys, MapStyleSpec } from './types/index.cjs';
|
|
6
|
-
export { BaseControlProps, BaseLayerProps, BaseMapEventParams, BaseMapProps, BasemapCategory, BasemapProvider, BasemapSwitcherProps, CircleLayerProps, ControlPosition, CoordinateDisplayProps, FeatureClickEventParams, FeatureHoverEventParams, FillExtrusionLayerProps, FillLayerProps, GeolocateControlProps, GradientStop, HeatmapLayerProps, LegendConfig, LegendGroupProps, LegendItem, LegendProps, LineLayerProps, MapClickEventParams, MapErrorEventParams, MapHoverEventParams, MapLayerSpecBase, MapLoadEventParams, MapMoveEventParams, MapProps, MapSourceSpec, MarkerClickEventParams, MarkerDragEventParams, MarkerProps, NavigationControlProps, PopupEventParams, PopupProps, RasterLayerProps, ScaleControlProps, SourceProps, SymbolLayerProps } from './types/index.cjs';
|
|
7
|
-
export { C as ClusterCircleStyleOptions, a as ClusterExpandOptions, b as ClusterExpansionResult, c as ClusterFeatureProperties, d as ClusterLayerStyles, h as ClusterTextStyleOptions, j as ColorExpression, k as CoordinateValidationResult, D as DEFAULT_SIMPLIFICATION_THRESHOLDS, l as DynamicLODOptions, m as DynamicLODState, E as ExtrusionHeightOptions, F as FeatureGroup, n as FilterExpression, o as FilterOperator, p as FilterValue, G as GenerateLODOptions, q as GeoJSONFingerprint, r as GroupFeaturesOptions, K as KEYBOARD_CONTROLS, L as LODData, s as LODDataWithSimplification, t as LoadGeoJSONOptions, u as LoadGeoJSONResult, v as LotFillStyleOptions, w as LotOutlineStyleOptions, M as MARKER_PROTECTION_CLASS, N as NumberExpression, P as PaintProps,
|
|
6
|
+
export { BaseControlProps, BaseLayerProps, BaseMapEventParams, BaseMapProps, BasemapCategory, BasemapProvider, BasemapSwitcherProps, CircleLayerProps, ControlPosition, CoordinateDisplayProps, FeatureClickEventParams, FeatureHoverEventParams, FillExtrusionLayerProps, FillLayerProps, GeolocateControlProps, GradientStop, HeatmapLayerProps, LegendConfig, LegendGroupProps, LegendItem, LegendProps, LineLayerProps, MapClickEventParams, MapErrorEventParams, MapErrorLike, MapHoverEventParams, MapLayerSpecBase, MapLoadEventParams, MapMoveEventParams, MapProps, MapSourceSpec, MarkerClickEventParams, MarkerDragEventParams, MarkerProps, NavigationControlProps, PopupEventParams, PopupProps, RasterLayerProps, ScaleControlProps, SourceProps, SymbolLayerProps } from './types/index.cjs';
|
|
7
|
+
export { C as ClusterCircleStyleOptions, a as ClusterExpandOptions, b as ClusterExpansionResult, c as ClusterFeatureProperties, d as ClusterLayerStyles, h as ClusterTextStyleOptions, j as ColorExpression, k as CoordinateValidationResult, D as DEFAULT_SIMPLIFICATION_THRESHOLDS, l as DynamicLODOptions, m as DynamicLODState, E as ExtrusionHeightOptions, F as FeatureGroup, n as FilterExpression, o as FilterOperator, p as FilterValue, G as GenerateLODOptions, q as GeoJSONFingerprint, r as GroupFeaturesOptions, K as KEYBOARD_CONTROLS, L as LODData, s as LODDataWithSimplification, t as LoadGeoJSONOptions, u as LoadGeoJSONResult, v as LotFillStyleOptions, w as LotOutlineStyleOptions, M as MARKER_PROTECTION_CLASS, N as NumberExpression, P as PaintProps, y as PaintPropsDiff, S as SimplificationStats, z as SimplificationThreshold, U as UnclusteredPointStyleOptions, V as ValidationResult, A as applyMarkerChildProtection, B as applyMarkerProtection, H as boundsToPolygon, I as calculateBounds, J as calculateCentroid, O as calculateZoomThresholds, Q as clampLatitude, R as combineBounds, T as countFeaturesByType, W as createCategoricalColorExpression, X as createCircleStyle, Y as createClusterCirclePaint, Z as createClusterStyles, _ as createClusterTextLayout, $ as createContinuousColorExpression, a0 as createDynamicLODManager, a1 as createExtrusionHeightExpression, a2 as createExtrusionStyle, a3 as createFillStyle, a4 as createGeoJSONFingerprint, a5 as createHeatmapStyle, a6 as createHoverExpression, a7 as createInteractiveExpression, a8 as createInteractiveStatusColorExpression, a9 as createLineStyle, aa as createLotFillStyle, ab as createLotOutlineStyle, ac as createSelectionExpression, ad as createStatusColorExpression, ae as createZoomExpression, af as decimalToDMS, ag as deepEqual, ah as ensureValidCoordinates, ai as expandCluster, aj as expandClusterToBounds, ak as extendBounds, al as filterByGeometryType, am as filterEqual, an as fingerprintEqual, ao as formatArea, ap as formatBearing, aq as formatBounds, ar as formatCoordinates, as as formatDistance, at as formatFeatureProperties, au as formatLabel, av as formatPitch, aw as formatPropertyValue, ax as formatScale, ay as formatZoom, az as generateBoundingPolygon, aA as generateConvexHull, aB as generateFeatureCollectionDescription, aC as generateFeatureTable, aD as generateKeyboardControlsDescription, aE as generateLODData, aF as generateLODDataWithSimplification, aG as generateMapDescription, aH as generateMarkerList, aI as generateMarkersDescription, aJ as generateMoveAnnouncement, aK as geoJSONEqual, aL as getChangedPaintProps, aM as getClusterBounds, aN as getClusterChildren, aO as getClusterExpansionZoom, aP as getClusterLeaves, aQ as getGridNavigationIndex, aR as getHighlightStyle, aS as getSelectionStyle, aT as getSimplificationToleranceForZoom, aU as getSimplifiedFeaturesForZoom, aV as groupFeaturesByProperty, aW as isClusterFeature, aX as isValidBounds, aY as isValidLatitude, aZ as isValidLongitude, a_ as loadGeoJSON, a$ as normalizeLongitude, b0 as paintPropsEqual, b1 as removeMarkerProtection, b2 as resetWorkerUrlWarning, b3 as serializeFilter, b4 as simplifyFeature, b5 as simplifyFeatureCollection, b6 as simplifyFeatureCollectionWithStats, b7 as simplifyPolygon, b8 as validateBoundsArray, b9 as validateCoordinates, ba as validateGeoJSON, bb as warnIfWorkerUrlMissing, bc as zoomToScale } from './worker-BvmbGSPq.cjs';
|
|
8
8
|
export { B as BuildRTreeIndexOptions, a as BuildSpatialIndexOptions, I as IdleViewportManagerOptions, b as IdleViewportResult, P as PanVelocity, c as PredictiveViewportResult, Q as QuerySpatialIndexOptions, d as QueryStats, R as RTreeIndex, e as RTreeItem, f as RTreeQueryStats, S as SpatialIndex, V as ViewportManagedDataOptions, g as ViewportManagedResult, h as buildRTreeIndex, i as buildSpatialIndex, j as createIdleViewportManager, k as createPredictiveViewportManager, l as createRTreeViewportManager, m as createViewportManager, n as createViewportQuery, q as queryByBounds, o as queryByBoundsWithStats, p as queryRTreeByBounds, r as queryRTreeByBoundsWithStats } from './spatial-pNn2rgAH.cjs';
|
|
9
9
|
import 'rbush';
|
|
10
10
|
|
package/dist/index.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ export { MapStyleSpec, darkBasicStyle, generateBasicStyle, generateVectorStyle,
|
|
|
3
3
|
import { G as GeoJSONFeatureCollection } from './data-DCyEqgN0.js';
|
|
4
4
|
export { B as BoundsArray, C as ClusterConfig, E as ExtrusionData, a as GeoJSONFeature, b as GeoJSONGeometry, c as GeoJSONLineString, d as GeoJSONMultiLineString, e as GeoJSONMultiPoint, f as GeoJSONMultiPolygon, g as GeoJSONPoint, h as GeoJSONPolygon, H as HeatmapPoint, L as LngLat, M as MapBounds, i as MapSourceData, j as MapViewport, k as MarkerData } from './data-DCyEqgN0.js';
|
|
5
5
|
import { BasemapDefinition, BasemapApiKeys, MapStyleSpec } from './types/index.js';
|
|
6
|
-
export { BaseControlProps, BaseLayerProps, BaseMapEventParams, BaseMapProps, BasemapCategory, BasemapProvider, BasemapSwitcherProps, CircleLayerProps, ControlPosition, CoordinateDisplayProps, FeatureClickEventParams, FeatureHoverEventParams, FillExtrusionLayerProps, FillLayerProps, GeolocateControlProps, GradientStop, HeatmapLayerProps, LegendConfig, LegendGroupProps, LegendItem, LegendProps, LineLayerProps, MapClickEventParams, MapErrorEventParams, MapHoverEventParams, MapLayerSpecBase, MapLoadEventParams, MapMoveEventParams, MapProps, MapSourceSpec, MarkerClickEventParams, MarkerDragEventParams, MarkerProps, NavigationControlProps, PopupEventParams, PopupProps, RasterLayerProps, ScaleControlProps, SourceProps, SymbolLayerProps } from './types/index.js';
|
|
7
|
-
export { C as ClusterCircleStyleOptions, a as ClusterExpandOptions, b as ClusterExpansionResult, c as ClusterFeatureProperties, d as ClusterLayerStyles, h as ClusterTextStyleOptions, j as ColorExpression, k as CoordinateValidationResult, D as DEFAULT_SIMPLIFICATION_THRESHOLDS, l as DynamicLODOptions, m as DynamicLODState, E as ExtrusionHeightOptions, F as FeatureGroup, n as FilterExpression, o as FilterOperator, p as FilterValue, G as GenerateLODOptions, q as GeoJSONFingerprint, r as GroupFeaturesOptions, K as KEYBOARD_CONTROLS, L as LODData, s as LODDataWithSimplification, t as LoadGeoJSONOptions, u as LoadGeoJSONResult, v as LotFillStyleOptions, w as LotOutlineStyleOptions, M as MARKER_PROTECTION_CLASS, N as NumberExpression, P as PaintProps,
|
|
6
|
+
export { BaseControlProps, BaseLayerProps, BaseMapEventParams, BaseMapProps, BasemapCategory, BasemapProvider, BasemapSwitcherProps, CircleLayerProps, ControlPosition, CoordinateDisplayProps, FeatureClickEventParams, FeatureHoverEventParams, FillExtrusionLayerProps, FillLayerProps, GeolocateControlProps, GradientStop, HeatmapLayerProps, LegendConfig, LegendGroupProps, LegendItem, LegendProps, LineLayerProps, MapClickEventParams, MapErrorEventParams, MapErrorLike, MapHoverEventParams, MapLayerSpecBase, MapLoadEventParams, MapMoveEventParams, MapProps, MapSourceSpec, MarkerClickEventParams, MarkerDragEventParams, MarkerProps, NavigationControlProps, PopupEventParams, PopupProps, RasterLayerProps, ScaleControlProps, SourceProps, SymbolLayerProps } from './types/index.js';
|
|
7
|
+
export { C as ClusterCircleStyleOptions, a as ClusterExpandOptions, b as ClusterExpansionResult, c as ClusterFeatureProperties, d as ClusterLayerStyles, h as ClusterTextStyleOptions, j as ColorExpression, k as CoordinateValidationResult, D as DEFAULT_SIMPLIFICATION_THRESHOLDS, l as DynamicLODOptions, m as DynamicLODState, E as ExtrusionHeightOptions, F as FeatureGroup, n as FilterExpression, o as FilterOperator, p as FilterValue, G as GenerateLODOptions, q as GeoJSONFingerprint, r as GroupFeaturesOptions, K as KEYBOARD_CONTROLS, L as LODData, s as LODDataWithSimplification, t as LoadGeoJSONOptions, u as LoadGeoJSONResult, v as LotFillStyleOptions, w as LotOutlineStyleOptions, M as MARKER_PROTECTION_CLASS, N as NumberExpression, P as PaintProps, y as PaintPropsDiff, S as SimplificationStats, z as SimplificationThreshold, U as UnclusteredPointStyleOptions, V as ValidationResult, A as applyMarkerChildProtection, B as applyMarkerProtection, H as boundsToPolygon, I as calculateBounds, J as calculateCentroid, O as calculateZoomThresholds, Q as clampLatitude, R as combineBounds, T as countFeaturesByType, W as createCategoricalColorExpression, X as createCircleStyle, Y as createClusterCirclePaint, Z as createClusterStyles, _ as createClusterTextLayout, $ as createContinuousColorExpression, a0 as createDynamicLODManager, a1 as createExtrusionHeightExpression, a2 as createExtrusionStyle, a3 as createFillStyle, a4 as createGeoJSONFingerprint, a5 as createHeatmapStyle, a6 as createHoverExpression, a7 as createInteractiveExpression, a8 as createInteractiveStatusColorExpression, a9 as createLineStyle, aa as createLotFillStyle, ab as createLotOutlineStyle, ac as createSelectionExpression, ad as createStatusColorExpression, ae as createZoomExpression, af as decimalToDMS, ag as deepEqual, ah as ensureValidCoordinates, ai as expandCluster, aj as expandClusterToBounds, ak as extendBounds, al as filterByGeometryType, am as filterEqual, an as fingerprintEqual, ao as formatArea, ap as formatBearing, aq as formatBounds, ar as formatCoordinates, as as formatDistance, at as formatFeatureProperties, au as formatLabel, av as formatPitch, aw as formatPropertyValue, ax as formatScale, ay as formatZoom, az as generateBoundingPolygon, aA as generateConvexHull, aB as generateFeatureCollectionDescription, aC as generateFeatureTable, aD as generateKeyboardControlsDescription, aE as generateLODData, aF as generateLODDataWithSimplification, aG as generateMapDescription, aH as generateMarkerList, aI as generateMarkersDescription, aJ as generateMoveAnnouncement, aK as geoJSONEqual, aL as getChangedPaintProps, aM as getClusterBounds, aN as getClusterChildren, aO as getClusterExpansionZoom, aP as getClusterLeaves, aQ as getGridNavigationIndex, aR as getHighlightStyle, aS as getSelectionStyle, aT as getSimplificationToleranceForZoom, aU as getSimplifiedFeaturesForZoom, aV as groupFeaturesByProperty, aW as isClusterFeature, aX as isValidBounds, aY as isValidLatitude, aZ as isValidLongitude, a_ as loadGeoJSON, a$ as normalizeLongitude, b0 as paintPropsEqual, b1 as removeMarkerProtection, b2 as resetWorkerUrlWarning, b3 as serializeFilter, b4 as simplifyFeature, b5 as simplifyFeatureCollection, b6 as simplifyFeatureCollectionWithStats, b7 as simplifyPolygon, b8 as validateBoundsArray, b9 as validateCoordinates, ba as validateGeoJSON, bb as warnIfWorkerUrlMissing, bc as zoomToScale } from './worker-Cmyx33j4.js';
|
|
8
8
|
export { B as BuildRTreeIndexOptions, a as BuildSpatialIndexOptions, I as IdleViewportManagerOptions, b as IdleViewportResult, P as PanVelocity, c as PredictiveViewportResult, Q as QuerySpatialIndexOptions, d as QueryStats, R as RTreeIndex, e as RTreeItem, f as RTreeQueryStats, S as SpatialIndex, V as ViewportManagedDataOptions, g as ViewportManagedResult, h as buildRTreeIndex, i as buildSpatialIndex, j as createIdleViewportManager, k as createPredictiveViewportManager, l as createRTreeViewportManager, m as createViewportManager, n as createViewportQuery, q as queryByBounds, o as queryByBoundsWithStats, p as queryRTreeByBounds, r as queryRTreeByBoundsWithStats } from './spatial-Df48Jj9D.js';
|
|
9
9
|
import 'rbush';
|
|
10
10
|
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { lightBasicStyle, darkBasicStyle } from './chunk-6WMCIBJJ.js';
|
|
2
2
|
export { darkBasicStyle, generateBasicStyle, generateVectorStyle, getBasicStyle, lightBasicStyle } from './chunk-6WMCIBJJ.js';
|
|
3
|
-
import { createCategoricalColorExpression } from './chunk-
|
|
4
|
-
export { DEFAULT_SIMPLIFICATION_THRESHOLDS, KEYBOARD_CONTROLS, MARKER_PROTECTION_CLASS, applyMarkerChildProtection, applyMarkerProtection, boundsToPolygon, buildRTreeIndex, buildSpatialIndex, calculateBounds, calculateCentroid, calculateZoomThresholds, clampLatitude, combineBounds, countFeaturesByType, createCategoricalColorExpression, createCircleStyle, createClusterCirclePaint, createClusterStyles, createClusterTextLayout, createContinuousColorExpression, createDynamicLODManager, createExtrusionHeightExpression, createExtrusionStyle, createFillStyle, createGeoJSONFingerprint, createHeatmapStyle, createHoverExpression, createIdleViewportManager, createInteractiveExpression, createInteractiveStatusColorExpression, createLineStyle, createLotFillStyle, createLotOutlineStyle, createPredictiveViewportManager, createRTreeViewportManager, createSelectionExpression, createStatusColorExpression, createViewportManager, createViewportQuery, createZoomExpression, decimalToDMS, deepEqual, ensureValidCoordinates, expandCluster, expandClusterToBounds, extendBounds, filterByGeometryType, filterEqual, fingerprintEqual, formatArea, formatBearing, formatBounds, formatCoordinates, formatDistance, formatFeatureProperties, formatLabel, formatPitch, formatPropertyValue, formatScale, formatZoom, generateBoundingPolygon, generateConvexHull, generateFeatureCollectionDescription, generateFeatureTable, generateKeyboardControlsDescription, generateLODData, generateLODDataWithSimplification, generateMapDescription, generateMarkerList, generateMarkersDescription, generateMoveAnnouncement, geoJSONEqual, getChangedPaintProps, getClusterBounds, getClusterChildren, getClusterExpansionZoom, getClusterLeaves, getHighlightStyle, getSelectionStyle, getSimplificationToleranceForZoom, getSimplifiedFeaturesForZoom, groupFeaturesByProperty, isClusterFeature, isValidBounds, isValidLatitude, isValidLongitude, loadGeoJSON, normalizeLongitude, paintPropsEqual, queryByBounds, queryByBoundsWithStats, queryRTreeByBounds, queryRTreeByBoundsWithStats, removeMarkerProtection, serializeFilter, simplifyFeature, simplifyFeatureCollection, simplifyFeatureCollectionWithStats, simplifyPolygon, validateBoundsArray, validateCoordinates, validateGeoJSON, zoomToScale } from './chunk-
|
|
3
|
+
import { createCategoricalColorExpression } from './chunk-4YUKENCX.js';
|
|
4
|
+
export { DEFAULT_SIMPLIFICATION_THRESHOLDS, KEYBOARD_CONTROLS, MARKER_PROTECTION_CLASS, applyMarkerChildProtection, applyMarkerProtection, boundsToPolygon, buildRTreeIndex, buildSpatialIndex, calculateBounds, calculateCentroid, calculateZoomThresholds, clampLatitude, combineBounds, countFeaturesByType, createCategoricalColorExpression, createCircleStyle, createClusterCirclePaint, createClusterStyles, createClusterTextLayout, createContinuousColorExpression, createDynamicLODManager, createExtrusionHeightExpression, createExtrusionStyle, createFillStyle, createGeoJSONFingerprint, createHeatmapStyle, createHoverExpression, createIdleViewportManager, createInteractiveExpression, createInteractiveStatusColorExpression, createLineStyle, createLotFillStyle, createLotOutlineStyle, createPredictiveViewportManager, createRTreeViewportManager, createSelectionExpression, createStatusColorExpression, createViewportManager, createViewportQuery, createZoomExpression, decimalToDMS, deepEqual, ensureValidCoordinates, expandCluster, expandClusterToBounds, extendBounds, filterByGeometryType, filterEqual, fingerprintEqual, formatArea, formatBearing, formatBounds, formatCoordinates, formatDistance, formatFeatureProperties, formatLabel, formatPitch, formatPropertyValue, formatScale, formatZoom, generateBoundingPolygon, generateConvexHull, generateFeatureCollectionDescription, generateFeatureTable, generateKeyboardControlsDescription, generateLODData, generateLODDataWithSimplification, generateMapDescription, generateMarkerList, generateMarkersDescription, generateMoveAnnouncement, geoJSONEqual, getChangedPaintProps, getClusterBounds, getClusterChildren, getClusterExpansionZoom, getClusterLeaves, getGridNavigationIndex, getHighlightStyle, getSelectionStyle, getSimplificationToleranceForZoom, getSimplifiedFeaturesForZoom, groupFeaturesByProperty, isClusterFeature, isValidBounds, isValidLatitude, isValidLongitude, loadGeoJSON, normalizeLongitude, paintPropsEqual, queryByBounds, queryByBoundsWithStats, queryRTreeByBounds, queryRTreeByBoundsWithStats, removeMarkerProtection, resetWorkerUrlWarning, serializeFilter, simplifyFeature, simplifyFeatureCollection, simplifyFeatureCollectionWithStats, simplifyPolygon, validateBoundsArray, validateCoordinates, validateGeoJSON, warnIfWorkerUrlMissing, zoomToScale } from './chunk-4YUKENCX.js';
|
|
5
5
|
export { THEME_DARK, THEME_LIGHT, darkTheme, generateDarkColors, generateDarkDataColors, generateDarkTheme, generateLightColors, generateLightDataColors, generateLightTheme, getTheme, getTypography, lightTheme } from './chunk-ZGUACUEF.js';
|
|
6
6
|
import { getContrastTextColor as getContrastTextColor$1 } from '@classic-homes/theme-tokens/contrast';
|
|
7
7
|
import { colors } from '@classic-homes/theme-tokens';
|
package/dist/route/index.cjs
CHANGED
|
@@ -153,10 +153,15 @@ var GOOGLE_MAX_LEG_STOPS = GOOGLE_MAX_WAYPOINTS + 1;
|
|
|
153
153
|
var GOOGLE_DIR_BASE = "https://www.google.com/maps/dir/?api=1";
|
|
154
154
|
var GOOGLE_SEARCH_BASE = "https://www.google.com/maps/search/?api=1";
|
|
155
155
|
var APPLE_BASE = "https://maps.apple.com/";
|
|
156
|
+
var COORD_DECIMALS = 7;
|
|
157
|
+
function formatCoord(value) {
|
|
158
|
+
const fixed = value.toFixed(COORD_DECIMALS).replace(/\.?0+$/, "");
|
|
159
|
+
return fixed === "-0" ? "0" : fixed;
|
|
160
|
+
}
|
|
156
161
|
function encodeTarget(target) {
|
|
157
162
|
const coords = target.coords;
|
|
158
|
-
if (
|
|
159
|
-
return `${coords.lat},${coords.lng}`;
|
|
163
|
+
if (isValidLatLng(coords)) {
|
|
164
|
+
return `${formatCoord(coords.lat)},${formatCoord(coords.lng)}`;
|
|
160
165
|
}
|
|
161
166
|
if (target.address && target.address.trim()) {
|
|
162
167
|
return encodeURIComponent(target.address.trim());
|
package/dist/route/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isFiniteNumber } from '../chunk-OPYY37LA.js';
|
|
1
|
+
import { isFiniteNumber, isValidLatLng } from '../chunk-OPYY37LA.js';
|
|
2
2
|
export { fromLngLat, isFiniteNumber, isValidLatLng, toLngLat } from '../chunk-OPYY37LA.js';
|
|
3
3
|
|
|
4
4
|
// src/route/geo.ts
|
|
@@ -138,10 +138,15 @@ var GOOGLE_MAX_LEG_STOPS = GOOGLE_MAX_WAYPOINTS + 1;
|
|
|
138
138
|
var GOOGLE_DIR_BASE = "https://www.google.com/maps/dir/?api=1";
|
|
139
139
|
var GOOGLE_SEARCH_BASE = "https://www.google.com/maps/search/?api=1";
|
|
140
140
|
var APPLE_BASE = "https://maps.apple.com/";
|
|
141
|
+
var COORD_DECIMALS = 7;
|
|
142
|
+
function formatCoord(value) {
|
|
143
|
+
const fixed = value.toFixed(COORD_DECIMALS).replace(/\.?0+$/, "");
|
|
144
|
+
return fixed === "-0" ? "0" : fixed;
|
|
145
|
+
}
|
|
141
146
|
function encodeTarget(target) {
|
|
142
147
|
const coords = target.coords;
|
|
143
|
-
if (
|
|
144
|
-
return `${coords.lat},${coords.lng}`;
|
|
148
|
+
if (isValidLatLng(coords)) {
|
|
149
|
+
return `${formatCoord(coords.lat)},${formatCoord(coords.lng)}`;
|
|
145
150
|
}
|
|
146
151
|
if (target.address && target.address.trim()) {
|
|
147
152
|
return encodeURIComponent(target.address.trim());
|
package/dist/types/index.d.cts
CHANGED
|
@@ -134,6 +134,18 @@ interface PopupEventParams {
|
|
|
134
134
|
/** Popup coordinates [lng, lat] */
|
|
135
135
|
lngLat: LngLat;
|
|
136
136
|
}
|
|
137
|
+
/**
|
|
138
|
+
* The shape MapLibre guarantees on an error event.
|
|
139
|
+
*
|
|
140
|
+
* Not `Error`: MapLibre 6 narrowed `ErrorEvent.error` to `{ message: string }`,
|
|
141
|
+
* so a real `Error` satisfies this but the reverse does not hold. Read
|
|
142
|
+
* `message`; treat `name` and `stack` as best-effort.
|
|
143
|
+
*/
|
|
144
|
+
interface MapErrorLike {
|
|
145
|
+
message: string;
|
|
146
|
+
name?: string;
|
|
147
|
+
stack?: string;
|
|
148
|
+
}
|
|
137
149
|
/**
|
|
138
150
|
* Error event parameters
|
|
139
151
|
*/
|
|
@@ -143,8 +155,8 @@ interface MapErrorEventParams {
|
|
|
143
155
|
message: string;
|
|
144
156
|
/** Error source (e.g., 'tile', 'source', 'layer') */
|
|
145
157
|
source?: string;
|
|
146
|
-
/** Original error object */
|
|
147
|
-
error?:
|
|
158
|
+
/** Original error object, as MapLibre reported it */
|
|
159
|
+
error?: MapErrorLike;
|
|
148
160
|
/**
|
|
149
161
|
* True when the error replaced the map with the error panel (it happened
|
|
150
162
|
* before the map first loaded). False for failures after load — a missing
|
|
@@ -884,4 +896,4 @@ interface BasemapSwitcherProps extends BaseControlProps {
|
|
|
884
896
|
class?: string;
|
|
885
897
|
}
|
|
886
898
|
|
|
887
|
-
export { type BaseControlProps, type BaseLayerProps, type BaseMapEventParams, type BaseMapProps, type BasemapApiKeys, type BasemapCategory, type BasemapDefinition, type BasemapProvider, type BasemapSwitcherProps, BoundsArray, type CircleLayerProps, ClusterConfig, type ControlPosition, type CoordinateDisplayProps, type FeatureClickEventParams, type FeatureHoverEventParams, type FillExtrusionLayerProps, type FillLayerProps, GeoJSONFeature, GeoJSONFeatureCollection, type GeolocateControlProps, type GradientStop, type HeatmapLayerProps, type LegendConfig, type LegendGroupProps, type LegendItem, type LegendProps, type LineLayerProps, LngLat, MapBounds, type MapClickEventParams, type MapErrorEventParams, type MapHoverEventParams, type MapLayerSpecBase, type MapLoadEventParams, type MapMoveEventParams, type MapProps, MapSourceData, type MapSourceSpec, type MapStyleSpec, type MarkerClickEventParams, type MarkerDragEventParams, type MarkerProps, type NavigationControlProps, type PopupEventParams, type PopupProps, type RasterLayerProps, type ScaleControlProps, type SourceProps, type SymbolLayerProps };
|
|
899
|
+
export { type BaseControlProps, type BaseLayerProps, type BaseMapEventParams, type BaseMapProps, type BasemapApiKeys, type BasemapCategory, type BasemapDefinition, type BasemapProvider, type BasemapSwitcherProps, BoundsArray, type CircleLayerProps, ClusterConfig, type ControlPosition, type CoordinateDisplayProps, type FeatureClickEventParams, type FeatureHoverEventParams, type FillExtrusionLayerProps, type FillLayerProps, GeoJSONFeature, GeoJSONFeatureCollection, type GeolocateControlProps, type GradientStop, type HeatmapLayerProps, type LegendConfig, type LegendGroupProps, type LegendItem, type LegendProps, type LineLayerProps, LngLat, MapBounds, type MapClickEventParams, type MapErrorEventParams, type MapErrorLike, type MapHoverEventParams, type MapLayerSpecBase, type MapLoadEventParams, type MapMoveEventParams, type MapProps, MapSourceData, type MapSourceSpec, type MapStyleSpec, type MarkerClickEventParams, type MarkerDragEventParams, type MarkerProps, type NavigationControlProps, type PopupEventParams, type PopupProps, type RasterLayerProps, type ScaleControlProps, type SourceProps, type SymbolLayerProps };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -134,6 +134,18 @@ interface PopupEventParams {
|
|
|
134
134
|
/** Popup coordinates [lng, lat] */
|
|
135
135
|
lngLat: LngLat;
|
|
136
136
|
}
|
|
137
|
+
/**
|
|
138
|
+
* The shape MapLibre guarantees on an error event.
|
|
139
|
+
*
|
|
140
|
+
* Not `Error`: MapLibre 6 narrowed `ErrorEvent.error` to `{ message: string }`,
|
|
141
|
+
* so a real `Error` satisfies this but the reverse does not hold. Read
|
|
142
|
+
* `message`; treat `name` and `stack` as best-effort.
|
|
143
|
+
*/
|
|
144
|
+
interface MapErrorLike {
|
|
145
|
+
message: string;
|
|
146
|
+
name?: string;
|
|
147
|
+
stack?: string;
|
|
148
|
+
}
|
|
137
149
|
/**
|
|
138
150
|
* Error event parameters
|
|
139
151
|
*/
|
|
@@ -143,8 +155,8 @@ interface MapErrorEventParams {
|
|
|
143
155
|
message: string;
|
|
144
156
|
/** Error source (e.g., 'tile', 'source', 'layer') */
|
|
145
157
|
source?: string;
|
|
146
|
-
/** Original error object */
|
|
147
|
-
error?:
|
|
158
|
+
/** Original error object, as MapLibre reported it */
|
|
159
|
+
error?: MapErrorLike;
|
|
148
160
|
/**
|
|
149
161
|
* True when the error replaced the map with the error panel (it happened
|
|
150
162
|
* before the map first loaded). False for failures after load — a missing
|
|
@@ -884,4 +896,4 @@ interface BasemapSwitcherProps extends BaseControlProps {
|
|
|
884
896
|
class?: string;
|
|
885
897
|
}
|
|
886
898
|
|
|
887
|
-
export { type BaseControlProps, type BaseLayerProps, type BaseMapEventParams, type BaseMapProps, type BasemapApiKeys, type BasemapCategory, type BasemapDefinition, type BasemapProvider, type BasemapSwitcherProps, BoundsArray, type CircleLayerProps, ClusterConfig, type ControlPosition, type CoordinateDisplayProps, type FeatureClickEventParams, type FeatureHoverEventParams, type FillExtrusionLayerProps, type FillLayerProps, GeoJSONFeature, GeoJSONFeatureCollection, type GeolocateControlProps, type GradientStop, type HeatmapLayerProps, type LegendConfig, type LegendGroupProps, type LegendItem, type LegendProps, type LineLayerProps, LngLat, MapBounds, type MapClickEventParams, type MapErrorEventParams, type MapHoverEventParams, type MapLayerSpecBase, type MapLoadEventParams, type MapMoveEventParams, type MapProps, MapSourceData, type MapSourceSpec, type MapStyleSpec, type MarkerClickEventParams, type MarkerDragEventParams, type MarkerProps, type NavigationControlProps, type PopupEventParams, type PopupProps, type RasterLayerProps, type ScaleControlProps, type SourceProps, type SymbolLayerProps };
|
|
899
|
+
export { type BaseControlProps, type BaseLayerProps, type BaseMapEventParams, type BaseMapProps, type BasemapApiKeys, type BasemapCategory, type BasemapDefinition, type BasemapProvider, type BasemapSwitcherProps, BoundsArray, type CircleLayerProps, ClusterConfig, type ControlPosition, type CoordinateDisplayProps, type FeatureClickEventParams, type FeatureHoverEventParams, type FillExtrusionLayerProps, type FillLayerProps, GeoJSONFeature, GeoJSONFeatureCollection, type GeolocateControlProps, type GradientStop, type HeatmapLayerProps, type LegendConfig, type LegendGroupProps, type LegendItem, type LegendProps, type LineLayerProps, LngLat, MapBounds, type MapClickEventParams, type MapErrorEventParams, type MapErrorLike, type MapHoverEventParams, type MapLayerSpecBase, type MapLoadEventParams, type MapMoveEventParams, type MapProps, MapSourceData, type MapSourceSpec, type MapStyleSpec, type MarkerClickEventParams, type MarkerDragEventParams, type MarkerProps, type NavigationControlProps, type PopupEventParams, type PopupProps, type RasterLayerProps, type ScaleControlProps, type SourceProps, type SymbolLayerProps };
|
package/dist/utils/index.cjs
CHANGED
|
@@ -426,6 +426,26 @@ function generateMoveAnnouncement(center, zoom, action) {
|
|
|
426
426
|
return `Map moved to ${Math.abs(lat).toFixed(2)} ${latDir}, ${Math.abs(lng).toFixed(2)} ${lngDir} at zoom ${zoom.toFixed(1)}`;
|
|
427
427
|
}
|
|
428
428
|
}
|
|
429
|
+
function getGridNavigationIndex(key, index, count, columns) {
|
|
430
|
+
if (count <= 0) return null;
|
|
431
|
+
const cols = Math.max(1, Math.floor(columns));
|
|
432
|
+
switch (key) {
|
|
433
|
+
case "ArrowRight":
|
|
434
|
+
return (index + 1) % count;
|
|
435
|
+
case "ArrowLeft":
|
|
436
|
+
return (index - 1 + count) % count;
|
|
437
|
+
case "ArrowDown":
|
|
438
|
+
return index + cols < count ? index + cols : index;
|
|
439
|
+
case "ArrowUp":
|
|
440
|
+
return index - cols >= 0 ? index - cols : index;
|
|
441
|
+
case "Home":
|
|
442
|
+
return 0;
|
|
443
|
+
case "End":
|
|
444
|
+
return count - 1;
|
|
445
|
+
default:
|
|
446
|
+
return null;
|
|
447
|
+
}
|
|
448
|
+
}
|
|
429
449
|
var THEME_LIGHT = "classic-light";
|
|
430
450
|
var THEME_DARK = "classic-dark";
|
|
431
451
|
function generateLightColors() {
|
|
@@ -2981,6 +3001,35 @@ function panToFitPopup(map, popup, padding) {
|
|
|
2981
3001
|
}
|
|
2982
3002
|
}
|
|
2983
3003
|
|
|
3004
|
+
// src/utils/worker.ts
|
|
3005
|
+
var SETUP_HINT = ` import { setWorkerUrl } from 'maplibre-gl';
|
|
3006
|
+
import workerUrl from 'maplibre-gl/dist/maplibre-gl-worker.mjs?worker&url'; // Vite
|
|
3007
|
+
setWorkerUrl(workerUrl);
|
|
3008
|
+
|
|
3009
|
+
Webpack: setWorkerUrl(new URL("maplibre-gl/dist/maplibre-gl-worker.mjs", import.meta.url).toString()). See https://maplibre.org/maplibre-gl-js/docs/guides/v5-to-v6-migration-guide/`;
|
|
3010
|
+
var warnedMissingUrl = false;
|
|
3011
|
+
function resetWorkerUrlWarning() {
|
|
3012
|
+
warnedMissingUrl = false;
|
|
3013
|
+
}
|
|
3014
|
+
function warnIfWorkerUrlMissing(maplibregl, log = console.warn) {
|
|
3015
|
+
if (warnedMissingUrl) return false;
|
|
3016
|
+
try {
|
|
3017
|
+
if (typeof maplibregl?.getVersion !== "function" || typeof maplibregl.getWorkerUrl !== "function") {
|
|
3018
|
+
return false;
|
|
3019
|
+
}
|
|
3020
|
+
const major = Number.parseInt(maplibregl.getVersion(), 10);
|
|
3021
|
+
if (!Number.isFinite(major) || major < 6) return false;
|
|
3022
|
+
if (maplibregl.getWorkerUrl()) return false;
|
|
3023
|
+
warnedMissingUrl = true;
|
|
3024
|
+
log(
|
|
3025
|
+
"[maps] MapLibre " + major + ' has no worker URL set. Under a bundler it cannot find its worker on its own, so the map fails with "Worker failed to load". Call setWorkerUrl() once at app startup:\n\n' + SETUP_HINT
|
|
3026
|
+
);
|
|
3027
|
+
return true;
|
|
3028
|
+
} catch {
|
|
3029
|
+
return false;
|
|
3030
|
+
}
|
|
3031
|
+
}
|
|
3032
|
+
|
|
2984
3033
|
exports.DEFAULT_SIMPLIFICATION_THRESHOLDS = DEFAULT_SIMPLIFICATION_THRESHOLDS;
|
|
2985
3034
|
exports.KEYBOARD_CONTROLS = KEYBOARD_CONTROLS;
|
|
2986
3035
|
exports.MARKER_PROTECTION_CLASS = MARKER_PROTECTION_CLASS;
|
|
@@ -3058,6 +3107,7 @@ exports.getClusterBounds = getClusterBounds;
|
|
|
3058
3107
|
exports.getClusterChildren = getClusterChildren;
|
|
3059
3108
|
exports.getClusterExpansionZoom = getClusterExpansionZoom;
|
|
3060
3109
|
exports.getClusterLeaves = getClusterLeaves;
|
|
3110
|
+
exports.getGridNavigationIndex = getGridNavigationIndex;
|
|
3061
3111
|
exports.getHighlightStyle = getHighlightStyle;
|
|
3062
3112
|
exports.getSelectionStyle = getSelectionStyle;
|
|
3063
3113
|
exports.getSimplificationToleranceForZoom = getSimplificationToleranceForZoom;
|
|
@@ -3078,6 +3128,7 @@ exports.queryByBoundsWithStats = queryByBoundsWithStats;
|
|
|
3078
3128
|
exports.queryRTreeByBounds = queryRTreeByBounds;
|
|
3079
3129
|
exports.queryRTreeByBoundsWithStats = queryRTreeByBoundsWithStats;
|
|
3080
3130
|
exports.removeMarkerProtection = removeMarkerProtection;
|
|
3131
|
+
exports.resetWorkerUrlWarning = resetWorkerUrlWarning;
|
|
3081
3132
|
exports.serializeFilter = serializeFilter;
|
|
3082
3133
|
exports.simplifyFeature = simplifyFeature;
|
|
3083
3134
|
exports.simplifyFeatureCollection = simplifyFeatureCollection;
|
|
@@ -3086,4 +3137,5 @@ exports.simplifyPolygon = simplifyPolygon;
|
|
|
3086
3137
|
exports.validateBoundsArray = validateBoundsArray;
|
|
3087
3138
|
exports.validateCoordinates = validateCoordinates;
|
|
3088
3139
|
exports.validateGeoJSON = validateGeoJSON;
|
|
3140
|
+
exports.warnIfWorkerUrlMissing = warnIfWorkerUrlMissing;
|
|
3089
3141
|
exports.zoomToScale = zoomToScale;
|
package/dist/utils/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { C as ClusterCircleStyleOptions, a as ClusterExpandOptions, b as ClusterExpansionResult, c as ClusterFeatureProperties, d as ClusterLayerStyles, e as ClusterMapBoundsExpander, f as ClusterMapExpander, g as ClusterMapReader, h as ClusterTextStyleOptions, i as ClusterableGeoJSONSource, j as ColorExpression, k as CoordinateValidationResult, D as DEFAULT_SIMPLIFICATION_THRESHOLDS, l as DynamicLODOptions, m as DynamicLODState, E as ExtrusionHeightOptions, F as FeatureGroup, n as FilterExpression, o as FilterOperator, p as FilterValue, G as GenerateLODOptions, q as GeoJSONFingerprint, r as GroupFeaturesOptions, K as KEYBOARD_CONTROLS, L as LODData, s as LODDataWithSimplification, t as LoadGeoJSONOptions, u as LoadGeoJSONResult, v as LotFillStyleOptions, w as LotOutlineStyleOptions, M as MARKER_PROTECTION_CLASS, N as NumberExpression, P as PaintProps,
|
|
1
|
+
export { C as ClusterCircleStyleOptions, a as ClusterExpandOptions, b as ClusterExpansionResult, c as ClusterFeatureProperties, d as ClusterLayerStyles, e as ClusterMapBoundsExpander, f as ClusterMapExpander, g as ClusterMapReader, h as ClusterTextStyleOptions, i as ClusterableGeoJSONSource, j as ColorExpression, k as CoordinateValidationResult, D as DEFAULT_SIMPLIFICATION_THRESHOLDS, l as DynamicLODOptions, m as DynamicLODState, E as ExtrusionHeightOptions, F as FeatureGroup, n as FilterExpression, o as FilterOperator, p as FilterValue, G as GenerateLODOptions, q as GeoJSONFingerprint, r as GroupFeaturesOptions, K as KEYBOARD_CONTROLS, L as LODData, s as LODDataWithSimplification, t as LoadGeoJSONOptions, u as LoadGeoJSONResult, v as LotFillStyleOptions, w as LotOutlineStyleOptions, M as MARKER_PROTECTION_CLASS, x as MapLibreWorkerApi, N as NumberExpression, P as PaintProps, y as PaintPropsDiff, S as SimplificationStats, z as SimplificationThreshold, U as UnclusteredPointStyleOptions, V as ValidationResult, A as applyMarkerChildProtection, B as applyMarkerProtection, H as boundsToPolygon, I as calculateBounds, J as calculateCentroid, O as calculateZoomThresholds, Q as clampLatitude, R as combineBounds, T as countFeaturesByType, W as createCategoricalColorExpression, X as createCircleStyle, Y as createClusterCirclePaint, Z as createClusterStyles, _ as createClusterTextLayout, $ as createContinuousColorExpression, a0 as createDynamicLODManager, a1 as createExtrusionHeightExpression, a2 as createExtrusionStyle, a3 as createFillStyle, a4 as createGeoJSONFingerprint, a5 as createHeatmapStyle, a6 as createHoverExpression, a7 as createInteractiveExpression, a8 as createInteractiveStatusColorExpression, a9 as createLineStyle, aa as createLotFillStyle, ab as createLotOutlineStyle, ac as createSelectionExpression, ad as createStatusColorExpression, ae as createZoomExpression, af as decimalToDMS, ag as deepEqual, ah as ensureValidCoordinates, ai as expandCluster, aj as expandClusterToBounds, ak as extendBounds, al as filterByGeometryType, am as filterEqual, an as fingerprintEqual, ao as formatArea, ap as formatBearing, aq as formatBounds, ar as formatCoordinates, as as formatDistance, at as formatFeatureProperties, au as formatLabel, av as formatPitch, aw as formatPropertyValue, ax as formatScale, ay as formatZoom, az as generateBoundingPolygon, aA as generateConvexHull, aB as generateFeatureCollectionDescription, aC as generateFeatureTable, aD as generateKeyboardControlsDescription, aE as generateLODData, aF as generateLODDataWithSimplification, aG as generateMapDescription, aH as generateMarkerList, aI as generateMarkersDescription, aJ as generateMoveAnnouncement, aK as geoJSONEqual, aL as getChangedPaintProps, aM as getClusterBounds, aN as getClusterChildren, aO as getClusterExpansionZoom, aP as getClusterLeaves, aQ as getGridNavigationIndex, aR as getHighlightStyle, aS as getSelectionStyle, aT as getSimplificationToleranceForZoom, aU as getSimplifiedFeaturesForZoom, aV as groupFeaturesByProperty, aW as isClusterFeature, aX as isValidBounds, aY as isValidLatitude, aZ as isValidLongitude, a_ as loadGeoJSON, a$ as normalizeLongitude, b0 as paintPropsEqual, b1 as removeMarkerProtection, b2 as resetWorkerUrlWarning, b3 as serializeFilter, b4 as simplifyFeature, b5 as simplifyFeatureCollection, b6 as simplifyFeatureCollectionWithStats, b7 as simplifyPolygon, b8 as validateBoundsArray, b9 as validateCoordinates, ba as validateGeoJSON, bb as warnIfWorkerUrlMissing, bc as zoomToScale } from '../worker-BvmbGSPq.cjs';
|
|
2
2
|
export { B as BuildRTreeIndexOptions, a as BuildSpatialIndexOptions, I as IdleViewportManagerOptions, b as IdleViewportResult, P as PanVelocity, c as PredictiveViewportResult, Q as QuerySpatialIndexOptions, d as QueryStats, R as RTreeIndex, e as RTreeItem, f as RTreeQueryStats, S as SpatialIndex, V as ViewportManagedDataOptions, g as ViewportManagedResult, h as buildRTreeIndex, i as buildSpatialIndex, j as createIdleViewportManager, k as createPredictiveViewportManager, l as createRTreeViewportManager, m as createViewportManager, n as createViewportQuery, q as queryByBounds, o as queryByBoundsWithStats, p as queryRTreeByBounds, r as queryRTreeByBoundsWithStats } from '../spatial-pNn2rgAH.cjs';
|
|
3
3
|
import '../data-DCyEqgN0.cjs';
|
|
4
4
|
import '../generator-CU9ZTZ1v.cjs';
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { C as ClusterCircleStyleOptions, a as ClusterExpandOptions, b as ClusterExpansionResult, c as ClusterFeatureProperties, d as ClusterLayerStyles, e as ClusterMapBoundsExpander, f as ClusterMapExpander, g as ClusterMapReader, h as ClusterTextStyleOptions, i as ClusterableGeoJSONSource, j as ColorExpression, k as CoordinateValidationResult, D as DEFAULT_SIMPLIFICATION_THRESHOLDS, l as DynamicLODOptions, m as DynamicLODState, E as ExtrusionHeightOptions, F as FeatureGroup, n as FilterExpression, o as FilterOperator, p as FilterValue, G as GenerateLODOptions, q as GeoJSONFingerprint, r as GroupFeaturesOptions, K as KEYBOARD_CONTROLS, L as LODData, s as LODDataWithSimplification, t as LoadGeoJSONOptions, u as LoadGeoJSONResult, v as LotFillStyleOptions, w as LotOutlineStyleOptions, M as MARKER_PROTECTION_CLASS, N as NumberExpression, P as PaintProps,
|
|
1
|
+
export { C as ClusterCircleStyleOptions, a as ClusterExpandOptions, b as ClusterExpansionResult, c as ClusterFeatureProperties, d as ClusterLayerStyles, e as ClusterMapBoundsExpander, f as ClusterMapExpander, g as ClusterMapReader, h as ClusterTextStyleOptions, i as ClusterableGeoJSONSource, j as ColorExpression, k as CoordinateValidationResult, D as DEFAULT_SIMPLIFICATION_THRESHOLDS, l as DynamicLODOptions, m as DynamicLODState, E as ExtrusionHeightOptions, F as FeatureGroup, n as FilterExpression, o as FilterOperator, p as FilterValue, G as GenerateLODOptions, q as GeoJSONFingerprint, r as GroupFeaturesOptions, K as KEYBOARD_CONTROLS, L as LODData, s as LODDataWithSimplification, t as LoadGeoJSONOptions, u as LoadGeoJSONResult, v as LotFillStyleOptions, w as LotOutlineStyleOptions, M as MARKER_PROTECTION_CLASS, x as MapLibreWorkerApi, N as NumberExpression, P as PaintProps, y as PaintPropsDiff, S as SimplificationStats, z as SimplificationThreshold, U as UnclusteredPointStyleOptions, V as ValidationResult, A as applyMarkerChildProtection, B as applyMarkerProtection, H as boundsToPolygon, I as calculateBounds, J as calculateCentroid, O as calculateZoomThresholds, Q as clampLatitude, R as combineBounds, T as countFeaturesByType, W as createCategoricalColorExpression, X as createCircleStyle, Y as createClusterCirclePaint, Z as createClusterStyles, _ as createClusterTextLayout, $ as createContinuousColorExpression, a0 as createDynamicLODManager, a1 as createExtrusionHeightExpression, a2 as createExtrusionStyle, a3 as createFillStyle, a4 as createGeoJSONFingerprint, a5 as createHeatmapStyle, a6 as createHoverExpression, a7 as createInteractiveExpression, a8 as createInteractiveStatusColorExpression, a9 as createLineStyle, aa as createLotFillStyle, ab as createLotOutlineStyle, ac as createSelectionExpression, ad as createStatusColorExpression, ae as createZoomExpression, af as decimalToDMS, ag as deepEqual, ah as ensureValidCoordinates, ai as expandCluster, aj as expandClusterToBounds, ak as extendBounds, al as filterByGeometryType, am as filterEqual, an as fingerprintEqual, ao as formatArea, ap as formatBearing, aq as formatBounds, ar as formatCoordinates, as as formatDistance, at as formatFeatureProperties, au as formatLabel, av as formatPitch, aw as formatPropertyValue, ax as formatScale, ay as formatZoom, az as generateBoundingPolygon, aA as generateConvexHull, aB as generateFeatureCollectionDescription, aC as generateFeatureTable, aD as generateKeyboardControlsDescription, aE as generateLODData, aF as generateLODDataWithSimplification, aG as generateMapDescription, aH as generateMarkerList, aI as generateMarkersDescription, aJ as generateMoveAnnouncement, aK as geoJSONEqual, aL as getChangedPaintProps, aM as getClusterBounds, aN as getClusterChildren, aO as getClusterExpansionZoom, aP as getClusterLeaves, aQ as getGridNavigationIndex, aR as getHighlightStyle, aS as getSelectionStyle, aT as getSimplificationToleranceForZoom, aU as getSimplifiedFeaturesForZoom, aV as groupFeaturesByProperty, aW as isClusterFeature, aX as isValidBounds, aY as isValidLatitude, aZ as isValidLongitude, a_ as loadGeoJSON, a$ as normalizeLongitude, b0 as paintPropsEqual, b1 as removeMarkerProtection, b2 as resetWorkerUrlWarning, b3 as serializeFilter, b4 as simplifyFeature, b5 as simplifyFeatureCollection, b6 as simplifyFeatureCollectionWithStats, b7 as simplifyPolygon, b8 as validateBoundsArray, b9 as validateCoordinates, ba as validateGeoJSON, bb as warnIfWorkerUrlMissing, bc as zoomToScale } from '../worker-Cmyx33j4.js';
|
|
2
2
|
export { B as BuildRTreeIndexOptions, a as BuildSpatialIndexOptions, I as IdleViewportManagerOptions, b as IdleViewportResult, P as PanVelocity, c as PredictiveViewportResult, Q as QuerySpatialIndexOptions, d as QueryStats, R as RTreeIndex, e as RTreeItem, f as RTreeQueryStats, S as SpatialIndex, V as ViewportManagedDataOptions, g as ViewportManagedResult, h as buildRTreeIndex, i as buildSpatialIndex, j as createIdleViewportManager, k as createPredictiveViewportManager, l as createRTreeViewportManager, m as createViewportManager, n as createViewportQuery, q as queryByBounds, o as queryByBoundsWithStats, p as queryRTreeByBounds, r as queryRTreeByBoundsWithStats } from '../spatial-Df48Jj9D.js';
|
|
3
3
|
import '../data-DCyEqgN0.js';
|
|
4
4
|
import '../generator-CU9ZTZ1v.js';
|
package/dist/utils/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { DEFAULT_SIMPLIFICATION_THRESHOLDS, KEYBOARD_CONTROLS, MARKER_PROTECTION_CLASS, applyMarkerChildProtection, applyMarkerProtection, boundsToPolygon, buildRTreeIndex, buildSpatialIndex, calculateBounds, calculateCentroid, calculateZoomThresholds, clampLatitude, combineBounds, countFeaturesByType, createCategoricalColorExpression, createCircleStyle, createClusterCirclePaint, createClusterStyles, createClusterTextLayout, createContinuousColorExpression, createDynamicLODManager, createExtrusionHeightExpression, createExtrusionStyle, createFillStyle, createGeoJSONFingerprint, createHeatmapStyle, createHoverExpression, createIdleViewportManager, createInteractiveExpression, createInteractiveStatusColorExpression, createLineStyle, createLotFillStyle, createLotOutlineStyle, createPredictiveViewportManager, createRTreeViewportManager, createSelectionExpression, createStatusColorExpression, createViewportManager, createViewportQuery, createZoomExpression, decimalToDMS, deepEqual, ensureValidCoordinates, expandCluster, expandClusterToBounds, extendBounds, filterByGeometryType, filterEqual, fingerprintEqual, formatArea, formatBearing, formatBounds, formatCoordinates, formatDistance, formatFeatureProperties, formatLabel, formatPitch, formatPropertyValue, formatScale, formatZoom, generateBoundingPolygon, generateConvexHull, generateFeatureCollectionDescription, generateFeatureTable, generateKeyboardControlsDescription, generateLODData, generateLODDataWithSimplification, generateMapDescription, generateMarkerList, generateMarkersDescription, generateMoveAnnouncement, geoJSONEqual, getChangedPaintProps, getClusterBounds, getClusterChildren, getClusterExpansionZoom, getClusterLeaves, getHighlightStyle, getSelectionStyle, getSimplificationToleranceForZoom, getSimplifiedFeaturesForZoom, groupFeaturesByProperty, isClusterFeature, isValidBounds, isValidLatitude, isValidLongitude, loadGeoJSON, normalizeLongitude, normalizePadding, paintPropsEqual, panToFitPopup, prefersReducedMotion, queryByBounds, queryByBoundsWithStats, queryRTreeByBounds, queryRTreeByBoundsWithStats, removeMarkerProtection, serializeFilter, simplifyFeature, simplifyFeatureCollection, simplifyFeatureCollectionWithStats, simplifyPolygon, validateBoundsArray, validateCoordinates, validateGeoJSON, zoomToScale } from '../chunk-
|
|
1
|
+
export { DEFAULT_SIMPLIFICATION_THRESHOLDS, KEYBOARD_CONTROLS, MARKER_PROTECTION_CLASS, applyMarkerChildProtection, applyMarkerProtection, boundsToPolygon, buildRTreeIndex, buildSpatialIndex, calculateBounds, calculateCentroid, calculateZoomThresholds, clampLatitude, combineBounds, countFeaturesByType, createCategoricalColorExpression, createCircleStyle, createClusterCirclePaint, createClusterStyles, createClusterTextLayout, createContinuousColorExpression, createDynamicLODManager, createExtrusionHeightExpression, createExtrusionStyle, createFillStyle, createGeoJSONFingerprint, createHeatmapStyle, createHoverExpression, createIdleViewportManager, createInteractiveExpression, createInteractiveStatusColorExpression, createLineStyle, createLotFillStyle, createLotOutlineStyle, createPredictiveViewportManager, createRTreeViewportManager, createSelectionExpression, createStatusColorExpression, createViewportManager, createViewportQuery, createZoomExpression, decimalToDMS, deepEqual, ensureValidCoordinates, expandCluster, expandClusterToBounds, extendBounds, filterByGeometryType, filterEqual, fingerprintEqual, formatArea, formatBearing, formatBounds, formatCoordinates, formatDistance, formatFeatureProperties, formatLabel, formatPitch, formatPropertyValue, formatScale, formatZoom, generateBoundingPolygon, generateConvexHull, generateFeatureCollectionDescription, generateFeatureTable, generateKeyboardControlsDescription, generateLODData, generateLODDataWithSimplification, generateMapDescription, generateMarkerList, generateMarkersDescription, generateMoveAnnouncement, geoJSONEqual, getChangedPaintProps, getClusterBounds, getClusterChildren, getClusterExpansionZoom, getClusterLeaves, getGridNavigationIndex, getHighlightStyle, getSelectionStyle, getSimplificationToleranceForZoom, getSimplifiedFeaturesForZoom, groupFeaturesByProperty, isClusterFeature, isValidBounds, isValidLatitude, isValidLongitude, loadGeoJSON, normalizeLongitude, normalizePadding, paintPropsEqual, panToFitPopup, prefersReducedMotion, queryByBounds, queryByBoundsWithStats, queryRTreeByBounds, queryRTreeByBoundsWithStats, removeMarkerProtection, resetWorkerUrlWarning, serializeFilter, simplifyFeature, simplifyFeatureCollection, simplifyFeatureCollectionWithStats, simplifyPolygon, validateBoundsArray, validateCoordinates, validateGeoJSON, warnIfWorkerUrlMissing, zoomToScale } from '../chunk-4YUKENCX.js';
|
|
2
2
|
import '../chunk-ZGUACUEF.js';
|
|
@@ -68,6 +68,14 @@ declare function generateMarkerList(markers: MarkerData[]): string;
|
|
|
68
68
|
* Generate live region announcement for map changes
|
|
69
69
|
*/
|
|
70
70
|
declare function generateMoveAnnouncement(center: LngLat, zoom: number, action: 'pan' | 'zoom' | 'move'): string;
|
|
71
|
+
/**
|
|
72
|
+
* Next focus index for arrow-key navigation through a grid of options laid out
|
|
73
|
+
* row by row (a radiogroup of thumbnails, for example). Left/Right step one
|
|
74
|
+
* option and wrap, Up/Down step one row and stop at the edges, Home/End jump to
|
|
75
|
+
* the first/last option. Returns null for any other key, so the caller can let
|
|
76
|
+
* it through.
|
|
77
|
+
*/
|
|
78
|
+
declare function getGridNavigationIndex(key: string, index: number, count: number, columns: number): number | null;
|
|
71
79
|
|
|
72
80
|
/**
|
|
73
81
|
* Style utilities for map layers
|
|
@@ -1487,4 +1495,35 @@ declare function removeMarkerProtection(element: HTMLElement): void;
|
|
|
1487
1495
|
*/
|
|
1488
1496
|
declare function applyMarkerChildProtection(element: HTMLElement): void;
|
|
1489
1497
|
|
|
1490
|
-
|
|
1498
|
+
/**
|
|
1499
|
+
* MapLibre worker-URL guard.
|
|
1500
|
+
*
|
|
1501
|
+
* MapLibre 6 loads its tile worker from a separate file. Under a bundler it
|
|
1502
|
+
* cannot find that file itself: its fallback resolves the worker next to its
|
|
1503
|
+
* own module via `import.meta.url`, which a bundler (and Vite's dependency
|
|
1504
|
+
* pre-bundling) moves. The app has to hand it the URL once with
|
|
1505
|
+
* `setWorkerUrl()`. Without it the worker fails to load and the map shows
|
|
1506
|
+
* MapLibre's "Worker failed to load" error, which names the symptom but not the
|
|
1507
|
+
* fix.
|
|
1508
|
+
*
|
|
1509
|
+
* This warns before the first map is built, with the fix. It cannot fix the
|
|
1510
|
+
* problem from inside the library: the URL is bundler-specific (`?worker&url`
|
|
1511
|
+
* in Vite, `new URL(...)` in webpack), so it belongs to the app.
|
|
1512
|
+
*/
|
|
1513
|
+
/** The slice of the maplibre-gl module namespace the worker-URL check needs */
|
|
1514
|
+
interface MapLibreWorkerApi {
|
|
1515
|
+
getVersion?: () => string;
|
|
1516
|
+
getWorkerUrl?: () => string;
|
|
1517
|
+
}
|
|
1518
|
+
/** Reset the once-per-session latch. Tests only. */
|
|
1519
|
+
declare function resetWorkerUrlWarning(): void;
|
|
1520
|
+
/**
|
|
1521
|
+
* Warn once when MapLibre 6+ has no worker URL set.
|
|
1522
|
+
*
|
|
1523
|
+
* Silent on MapLibre 5, which bundles its own worker, and silent when the
|
|
1524
|
+
* version cannot be read - a guess is not worth a false alarm in a consumer's
|
|
1525
|
+
* console. Never throws: it is a diagnostic and must not stop a map mounting.
|
|
1526
|
+
*/
|
|
1527
|
+
declare function warnIfWorkerUrlMissing(maplibregl: MapLibreWorkerApi, log?: (message: string) => void): boolean;
|
|
1528
|
+
|
|
1529
|
+
export { createContinuousColorExpression as $, applyMarkerChildProtection as A, applyMarkerProtection as B, type ClusterCircleStyleOptions as C, DEFAULT_SIMPLIFICATION_THRESHOLDS as D, type ExtrusionHeightOptions as E, type FeatureGroup as F, type GenerateLODOptions as G, boundsToPolygon as H, calculateBounds as I, calculateCentroid as J, KEYBOARD_CONTROLS as K, type LODData as L, MARKER_PROTECTION_CLASS as M, type NumberExpression as N, calculateZoomThresholds as O, type PaintProps as P, clampLatitude as Q, combineBounds as R, type SimplificationStats as S, countFeaturesByType as T, type UnclusteredPointStyleOptions as U, type ValidationResult as V, createCategoricalColorExpression as W, createCircleStyle as X, createClusterCirclePaint as Y, createClusterStyles as Z, createClusterTextLayout as _, type ClusterExpandOptions as a, normalizeLongitude as a$, createDynamicLODManager as a0, createExtrusionHeightExpression as a1, createExtrusionStyle as a2, createFillStyle as a3, createGeoJSONFingerprint as a4, createHeatmapStyle as a5, createHoverExpression as a6, createInteractiveExpression as a7, createInteractiveStatusColorExpression as a8, createLineStyle as a9, generateConvexHull as aA, generateFeatureCollectionDescription as aB, generateFeatureTable as aC, generateKeyboardControlsDescription as aD, generateLODData as aE, generateLODDataWithSimplification as aF, generateMapDescription as aG, generateMarkerList as aH, generateMarkersDescription as aI, generateMoveAnnouncement as aJ, geoJSONEqual as aK, getChangedPaintProps as aL, getClusterBounds as aM, getClusterChildren as aN, getClusterExpansionZoom as aO, getClusterLeaves as aP, getGridNavigationIndex as aQ, getHighlightStyle as aR, getSelectionStyle as aS, getSimplificationToleranceForZoom as aT, getSimplifiedFeaturesForZoom as aU, groupFeaturesByProperty as aV, isClusterFeature as aW, isValidBounds as aX, isValidLatitude as aY, isValidLongitude as aZ, loadGeoJSON as a_, createLotFillStyle as aa, createLotOutlineStyle as ab, createSelectionExpression as ac, createStatusColorExpression as ad, createZoomExpression as ae, decimalToDMS as af, deepEqual as ag, ensureValidCoordinates as ah, expandCluster as ai, expandClusterToBounds as aj, extendBounds as ak, filterByGeometryType as al, filterEqual as am, fingerprintEqual as an, formatArea as ao, formatBearing as ap, formatBounds as aq, formatCoordinates as ar, formatDistance as as, formatFeatureProperties as at, formatLabel as au, formatPitch as av, formatPropertyValue as aw, formatScale as ax, formatZoom as ay, generateBoundingPolygon as az, type ClusterExpansionResult as b, paintPropsEqual as b0, removeMarkerProtection as b1, resetWorkerUrlWarning as b2, serializeFilter as b3, simplifyFeature as b4, simplifyFeatureCollection as b5, simplifyFeatureCollectionWithStats as b6, simplifyPolygon as b7, validateBoundsArray as b8, validateCoordinates as b9, validateGeoJSON as ba, warnIfWorkerUrlMissing as bb, zoomToScale as bc, type ClusterFeatureProperties as c, type ClusterLayerStyles as d, type ClusterMapBoundsExpander as e, type ClusterMapExpander as f, type ClusterMapReader as g, type ClusterTextStyleOptions as h, type ClusterableGeoJSONSource as i, type ColorExpression as j, type CoordinateValidationResult as k, type DynamicLODOptions as l, type DynamicLODState as m, type FilterExpression as n, type FilterOperator as o, type FilterValue as p, type GeoJSONFingerprint as q, type GroupFeaturesOptions as r, type LODDataWithSimplification as s, type LoadGeoJSONOptions as t, type LoadGeoJSONResult as u, type LotFillStyleOptions as v, type LotOutlineStyleOptions as w, type MapLibreWorkerApi as x, type PaintPropsDiff as y, type SimplificationThreshold as z };
|
|
@@ -68,6 +68,14 @@ declare function generateMarkerList(markers: MarkerData[]): string;
|
|
|
68
68
|
* Generate live region announcement for map changes
|
|
69
69
|
*/
|
|
70
70
|
declare function generateMoveAnnouncement(center: LngLat, zoom: number, action: 'pan' | 'zoom' | 'move'): string;
|
|
71
|
+
/**
|
|
72
|
+
* Next focus index for arrow-key navigation through a grid of options laid out
|
|
73
|
+
* row by row (a radiogroup of thumbnails, for example). Left/Right step one
|
|
74
|
+
* option and wrap, Up/Down step one row and stop at the edges, Home/End jump to
|
|
75
|
+
* the first/last option. Returns null for any other key, so the caller can let
|
|
76
|
+
* it through.
|
|
77
|
+
*/
|
|
78
|
+
declare function getGridNavigationIndex(key: string, index: number, count: number, columns: number): number | null;
|
|
71
79
|
|
|
72
80
|
/**
|
|
73
81
|
* Style utilities for map layers
|
|
@@ -1487,4 +1495,35 @@ declare function removeMarkerProtection(element: HTMLElement): void;
|
|
|
1487
1495
|
*/
|
|
1488
1496
|
declare function applyMarkerChildProtection(element: HTMLElement): void;
|
|
1489
1497
|
|
|
1490
|
-
|
|
1498
|
+
/**
|
|
1499
|
+
* MapLibre worker-URL guard.
|
|
1500
|
+
*
|
|
1501
|
+
* MapLibre 6 loads its tile worker from a separate file. Under a bundler it
|
|
1502
|
+
* cannot find that file itself: its fallback resolves the worker next to its
|
|
1503
|
+
* own module via `import.meta.url`, which a bundler (and Vite's dependency
|
|
1504
|
+
* pre-bundling) moves. The app has to hand it the URL once with
|
|
1505
|
+
* `setWorkerUrl()`. Without it the worker fails to load and the map shows
|
|
1506
|
+
* MapLibre's "Worker failed to load" error, which names the symptom but not the
|
|
1507
|
+
* fix.
|
|
1508
|
+
*
|
|
1509
|
+
* This warns before the first map is built, with the fix. It cannot fix the
|
|
1510
|
+
* problem from inside the library: the URL is bundler-specific (`?worker&url`
|
|
1511
|
+
* in Vite, `new URL(...)` in webpack), so it belongs to the app.
|
|
1512
|
+
*/
|
|
1513
|
+
/** The slice of the maplibre-gl module namespace the worker-URL check needs */
|
|
1514
|
+
interface MapLibreWorkerApi {
|
|
1515
|
+
getVersion?: () => string;
|
|
1516
|
+
getWorkerUrl?: () => string;
|
|
1517
|
+
}
|
|
1518
|
+
/** Reset the once-per-session latch. Tests only. */
|
|
1519
|
+
declare function resetWorkerUrlWarning(): void;
|
|
1520
|
+
/**
|
|
1521
|
+
* Warn once when MapLibre 6+ has no worker URL set.
|
|
1522
|
+
*
|
|
1523
|
+
* Silent on MapLibre 5, which bundles its own worker, and silent when the
|
|
1524
|
+
* version cannot be read - a guess is not worth a false alarm in a consumer's
|
|
1525
|
+
* console. Never throws: it is a diagnostic and must not stop a map mounting.
|
|
1526
|
+
*/
|
|
1527
|
+
declare function warnIfWorkerUrlMissing(maplibregl: MapLibreWorkerApi, log?: (message: string) => void): boolean;
|
|
1528
|
+
|
|
1529
|
+
export { createContinuousColorExpression as $, applyMarkerChildProtection as A, applyMarkerProtection as B, type ClusterCircleStyleOptions as C, DEFAULT_SIMPLIFICATION_THRESHOLDS as D, type ExtrusionHeightOptions as E, type FeatureGroup as F, type GenerateLODOptions as G, boundsToPolygon as H, calculateBounds as I, calculateCentroid as J, KEYBOARD_CONTROLS as K, type LODData as L, MARKER_PROTECTION_CLASS as M, type NumberExpression as N, calculateZoomThresholds as O, type PaintProps as P, clampLatitude as Q, combineBounds as R, type SimplificationStats as S, countFeaturesByType as T, type UnclusteredPointStyleOptions as U, type ValidationResult as V, createCategoricalColorExpression as W, createCircleStyle as X, createClusterCirclePaint as Y, createClusterStyles as Z, createClusterTextLayout as _, type ClusterExpandOptions as a, normalizeLongitude as a$, createDynamicLODManager as a0, createExtrusionHeightExpression as a1, createExtrusionStyle as a2, createFillStyle as a3, createGeoJSONFingerprint as a4, createHeatmapStyle as a5, createHoverExpression as a6, createInteractiveExpression as a7, createInteractiveStatusColorExpression as a8, createLineStyle as a9, generateConvexHull as aA, generateFeatureCollectionDescription as aB, generateFeatureTable as aC, generateKeyboardControlsDescription as aD, generateLODData as aE, generateLODDataWithSimplification as aF, generateMapDescription as aG, generateMarkerList as aH, generateMarkersDescription as aI, generateMoveAnnouncement as aJ, geoJSONEqual as aK, getChangedPaintProps as aL, getClusterBounds as aM, getClusterChildren as aN, getClusterExpansionZoom as aO, getClusterLeaves as aP, getGridNavigationIndex as aQ, getHighlightStyle as aR, getSelectionStyle as aS, getSimplificationToleranceForZoom as aT, getSimplifiedFeaturesForZoom as aU, groupFeaturesByProperty as aV, isClusterFeature as aW, isValidBounds as aX, isValidLatitude as aY, isValidLongitude as aZ, loadGeoJSON as a_, createLotFillStyle as aa, createLotOutlineStyle as ab, createSelectionExpression as ac, createStatusColorExpression as ad, createZoomExpression as ae, decimalToDMS as af, deepEqual as ag, ensureValidCoordinates as ah, expandCluster as ai, expandClusterToBounds as aj, extendBounds as ak, filterByGeometryType as al, filterEqual as am, fingerprintEqual as an, formatArea as ao, formatBearing as ap, formatBounds as aq, formatCoordinates as ar, formatDistance as as, formatFeatureProperties as at, formatLabel as au, formatPitch as av, formatPropertyValue as aw, formatScale as ax, formatZoom as ay, generateBoundingPolygon as az, type ClusterExpansionResult as b, paintPropsEqual as b0, removeMarkerProtection as b1, resetWorkerUrlWarning as b2, serializeFilter as b3, simplifyFeature as b4, simplifyFeatureCollection as b5, simplifyFeatureCollectionWithStats as b6, simplifyPolygon as b7, validateBoundsArray as b8, validateCoordinates as b9, validateGeoJSON as ba, warnIfWorkerUrlMissing as bb, zoomToScale as bc, type ClusterFeatureProperties as c, type ClusterLayerStyles as d, type ClusterMapBoundsExpander as e, type ClusterMapExpander as f, type ClusterMapReader as g, type ClusterTextStyleOptions as h, type ClusterableGeoJSONSource as i, type ColorExpression as j, type CoordinateValidationResult as k, type DynamicLODOptions as l, type DynamicLODState as m, type FilterExpression as n, type FilterOperator as o, type FilterValue as p, type GeoJSONFingerprint as q, type GroupFeaturesOptions as r, type LODDataWithSimplification as s, type LoadGeoJSONOptions as t, type LoadGeoJSONResult as u, type LotFillStyleOptions as v, type LotOutlineStyleOptions as w, type MapLibreWorkerApi as x, type PaintPropsDiff as y, type SimplificationThreshold as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@classic-homes/maps-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Core utilities and theme for Classic Theme maps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"maps",
|
|
@@ -125,11 +125,11 @@
|
|
|
125
125
|
"rbush": "^4.0.1"
|
|
126
126
|
},
|
|
127
127
|
"peerDependencies": {
|
|
128
|
-
"maplibre-gl": "^
|
|
128
|
+
"maplibre-gl": "^5.0.0 || ^6.11.0"
|
|
129
129
|
},
|
|
130
130
|
"devDependencies": {
|
|
131
131
|
"@types/rbush": "^4.0.0",
|
|
132
|
-
"maplibre-gl": "^
|
|
132
|
+
"maplibre-gl": "^6.14.0",
|
|
133
133
|
"tsup": "^8.0.0",
|
|
134
134
|
"typescript": "^5.3.0",
|
|
135
135
|
"vitest": "^4.1.10"
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
padding: 0.5rem 0.75rem;
|
|
30
30
|
cursor: pointer;
|
|
31
31
|
border-radius: 0.375rem;
|
|
32
|
-
transition: background-color 150ms ease;
|
|
33
32
|
}
|
|
34
33
|
|
|
34
|
+
/* Hover colours snap: a colour fade under a moving pointer reads as flicker */
|
|
35
35
|
.classic-layer-category-header:hover {
|
|
36
36
|
background-color: hsl(var(--muted));
|
|
37
37
|
}
|
|
@@ -52,7 +52,6 @@
|
|
|
52
52
|
gap: 0.5rem;
|
|
53
53
|
padding: 0.5rem 0.75rem;
|
|
54
54
|
border-radius: 0.375rem;
|
|
55
|
-
transition: background-color 150ms ease;
|
|
56
55
|
}
|
|
57
56
|
|
|
58
57
|
.classic-layer-item:hover {
|
|
@@ -203,9 +202,6 @@
|
|
|
203
202
|
background: transparent;
|
|
204
203
|
color: hsl(var(--muted-foreground));
|
|
205
204
|
cursor: pointer;
|
|
206
|
-
transition:
|
|
207
|
-
background-color 150ms ease,
|
|
208
|
-
color 150ms ease;
|
|
209
205
|
}
|
|
210
206
|
|
|
211
207
|
.classic-layer-tab:hover {
|
package/src/styles/popup.css
CHANGED
|
@@ -65,9 +65,7 @@
|
|
|
65
65
|
right: 0.5rem !important;
|
|
66
66
|
top: 0.5rem !important;
|
|
67
67
|
background: transparent !important;
|
|
68
|
-
transition:
|
|
69
|
-
background-color 150ms ease,
|
|
70
|
-
color 150ms ease !important;
|
|
68
|
+
/* No colour transition: hover colours snap */
|
|
71
69
|
cursor: pointer !important;
|
|
72
70
|
}
|
|
73
71
|
|