@classic-homes/maps-core 0.7.2 → 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 +1 -1
- package/dist/{chunk-ZGUACUEF.js → chunk-KEBZDTH3.js} +35 -49
- package/dist/{chunk-6WMCIBJJ.js → chunk-Q4ISJ6FV.js} +1 -1
- package/dist/{chunk-4YUKENCX.js → chunk-ZAGAADA3.js} +96 -17
- package/dist/{worker-Cmyx33j4.d.ts → deck-Crhj7TKV.d.ts} +65 -33
- package/dist/{worker-BvmbGSPq.d.cts → deck-Cvmx9g1O.d.cts} +65 -33
- package/dist/index.cjs +288 -204
- package/dist/index.d.cts +60 -35
- package/dist/index.d.ts +60 -35
- package/dist/index.js +124 -109
- package/dist/theme/index.cjs +34 -48
- package/dist/theme/index.js +2 -2
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/utils/index.cjs +129 -63
- package/dist/utils/index.d.cts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +2 -2
- package/package.json +1 -1
- package/src/styles/bundled.css +58 -75
- package/src/styles/bundled.test.ts +44 -0
- package/src/styles/controls.css +14 -11
- package/src/styles/layer-manager.css +29 -16
- package/src/styles/popup.css +12 -11
- package/src/styles/utilities.css +32 -52
|
@@ -225,9 +225,9 @@ interface LotFillStyleOptions {
|
|
|
225
225
|
* @example
|
|
226
226
|
* ```tsx
|
|
227
227
|
* const fillStyle = createLotFillStyle({
|
|
228
|
-
* defaultColor: '#
|
|
229
|
-
* hoverColor: '#
|
|
230
|
-
* selectedColor: '#
|
|
228
|
+
* defaultColor: '#34999c', // Accent Teal
|
|
229
|
+
* hoverColor: '#1b373b', // Heritage Teal
|
|
230
|
+
* selectedColor: '#2b4660', // Steel Navy
|
|
231
231
|
* opacity: 0.7,
|
|
232
232
|
* });
|
|
233
233
|
*
|
|
@@ -264,8 +264,8 @@ interface LotOutlineStyleOptions {
|
|
|
264
264
|
* @example
|
|
265
265
|
* ```tsx
|
|
266
266
|
* const outlineStyle = createLotOutlineStyle({
|
|
267
|
-
* defaultColor: '#
|
|
268
|
-
* hoverColor: '#
|
|
267
|
+
* defaultColor: '#50504f', // Grey 01
|
|
268
|
+
* hoverColor: '#1b373b', // Heritage Teal
|
|
269
269
|
* defaultWidth: 1,
|
|
270
270
|
* hoverWidth: 2,
|
|
271
271
|
* });
|
|
@@ -325,15 +325,15 @@ declare function createExtrusionHeightExpression(property: string, options?: Ext
|
|
|
325
325
|
* Commonly used for real estate lot statuses like available, sold, pending.
|
|
326
326
|
*
|
|
327
327
|
* @param statusColors - Map of status values to colors
|
|
328
|
-
* @param defaultColor - Fallback color for unknown statuses (default: '#
|
|
328
|
+
* @param defaultColor - Fallback color for unknown statuses (default: Grey 02, '#767574', 4.29:1 on the basemap land)
|
|
329
329
|
*
|
|
330
330
|
* @example
|
|
331
331
|
* ```tsx
|
|
332
332
|
* const statusColorExpr = createStatusColorExpression({
|
|
333
|
-
* available: '#
|
|
334
|
-
* pending: '#
|
|
335
|
-
* sold: '#
|
|
336
|
-
* reserved: '#
|
|
333
|
+
* available: '#1b373b', // Heritage Teal
|
|
334
|
+
* pending: '#34999c', // Accent Teal
|
|
335
|
+
* sold: '#767574', // Grey 02 (sold is not a problem: no red)
|
|
336
|
+
* reserved: '#2b4660', // Steel Navy
|
|
337
337
|
* });
|
|
338
338
|
*
|
|
339
339
|
* <FillLayer fillColor={statusColorExpr} />
|
|
@@ -352,8 +352,8 @@ declare function createStatusColorExpression(statusColors: Record<string, string
|
|
|
352
352
|
* @example
|
|
353
353
|
* ```tsx
|
|
354
354
|
* const colorExpr = createInteractiveStatusColorExpression(
|
|
355
|
-
* { available: '#
|
|
356
|
-
* { hoverColor: '#
|
|
355
|
+
* { available: '#1b373b', sold: '#767574' },
|
|
356
|
+
* { hoverColor: '#34999c', selectedColor: '#2b4660' }
|
|
357
357
|
* );
|
|
358
358
|
*
|
|
359
359
|
* <FillLayer fillColor={colorExpr} />
|
|
@@ -829,11 +829,11 @@ declare function expandClusterToBounds(map: ClusterMapBoundsExpander, sourceId:
|
|
|
829
829
|
* Options for cluster circle layer style
|
|
830
830
|
*/
|
|
831
831
|
interface ClusterCircleStyleOptions {
|
|
832
|
-
/** Base color for small clusters (default:
|
|
832
|
+
/** Base color for small clusters (default: Heritage Teal) */
|
|
833
833
|
smallColor?: string;
|
|
834
|
-
/** Color for medium clusters (default:
|
|
834
|
+
/** Color for medium clusters (default: Steel Navy) */
|
|
835
835
|
mediumColor?: string;
|
|
836
|
-
/** Color for large clusters (default:
|
|
836
|
+
/** Color for large clusters (default: Aubergine) */
|
|
837
837
|
largeColor?: string;
|
|
838
838
|
/** Point count threshold for medium size (default: 100) */
|
|
839
839
|
mediumThreshold?: number;
|
|
@@ -856,7 +856,7 @@ interface ClusterCircleStyleOptions {
|
|
|
856
856
|
* Options for cluster text layer style
|
|
857
857
|
*/
|
|
858
858
|
interface ClusterTextStyleOptions {
|
|
859
|
-
/** Text color (default:
|
|
859
|
+
/** Text color (default: White, 6.7:1 or more on the default circles) */
|
|
860
860
|
textColor?: string;
|
|
861
861
|
/** Text size (default: 12) */
|
|
862
862
|
textSize?: number;
|
|
@@ -869,7 +869,7 @@ interface ClusterTextStyleOptions {
|
|
|
869
869
|
* Options for unclustered point layer style
|
|
870
870
|
*/
|
|
871
871
|
interface UnclusteredPointStyleOptions {
|
|
872
|
-
/** Point color (default:
|
|
872
|
+
/** Point color (default: Heritage Teal) */
|
|
873
873
|
color?: string;
|
|
874
874
|
/** Point radius (default: 8) */
|
|
875
875
|
radius?: number;
|
|
@@ -907,9 +907,9 @@ interface ClusterLayerStyles {
|
|
|
907
907
|
* @example
|
|
908
908
|
* ```tsx
|
|
909
909
|
* const styles = createClusterStyles({
|
|
910
|
-
* smallColor: '#
|
|
911
|
-
* mediumColor: '#
|
|
912
|
-
* largeColor: '#
|
|
910
|
+
* smallColor: '#1b373b', // Heritage Teal
|
|
911
|
+
* mediumColor: '#2b4660', // Steel Navy
|
|
912
|
+
* largeColor: '#6a5280', // Aubergine
|
|
913
913
|
* });
|
|
914
914
|
*
|
|
915
915
|
* <Source id="points" type="geojson" data={data} cluster={true}>
|
|
@@ -948,7 +948,7 @@ declare function createClusterStyles(options?: {
|
|
|
948
948
|
* <CircleLayer
|
|
949
949
|
* id="clusters"
|
|
950
950
|
* filter={['has', 'point_count']}
|
|
951
|
-
* paint={createClusterCirclePaint({ smallColor: '#
|
|
951
|
+
* paint={createClusterCirclePaint({ smallColor: '#2b4660' })}
|
|
952
952
|
* />
|
|
953
953
|
* ```
|
|
954
954
|
*/
|
|
@@ -1325,14 +1325,18 @@ declare function getSimplificationToleranceForZoom(zoom: number, baseToleranceAt
|
|
|
1325
1325
|
declare const DEFAULT_SIMPLIFICATION_THRESHOLDS: SimplificationThreshold[];
|
|
1326
1326
|
|
|
1327
1327
|
/**
|
|
1328
|
-
*
|
|
1328
|
+
* Fingerprinting utilities for GeoJSON data equality checking.
|
|
1329
1329
|
*
|
|
1330
|
-
*
|
|
1331
|
-
*
|
|
1332
|
-
*
|
|
1333
|
-
* -
|
|
1330
|
+
* A fingerprint is the feature count, the first and last feature ids, and a
|
|
1331
|
+
* hash of every feature's id, geometry and properties. It is built in one pass
|
|
1332
|
+
* without serialising the data, so it costs far less than the `setData` it
|
|
1333
|
+
* guards (which structured-clones and re-parses the whole collection in the
|
|
1334
|
+
* worker).
|
|
1334
1335
|
*
|
|
1335
|
-
*
|
|
1336
|
+
* The hash is what makes it reliable: count and first/last id alone miss a
|
|
1337
|
+
* filter that keeps as many features, a change in the middle of the
|
|
1338
|
+
* collection, any geometry or property edit, and every change at all when the
|
|
1339
|
+
* features carry no top-level ids.
|
|
1336
1340
|
*/
|
|
1337
1341
|
|
|
1338
1342
|
/**
|
|
@@ -1345,9 +1349,12 @@ interface GeoJSONFingerprint {
|
|
|
1345
1349
|
firstId: string | number | undefined;
|
|
1346
1350
|
/** ID of the last feature (undefined if no features or no ID) */
|
|
1347
1351
|
lastId: string | number | undefined;
|
|
1352
|
+
/** Hash of every feature's id, geometry and properties (0 for no features) */
|
|
1353
|
+
hash: number;
|
|
1348
1354
|
}
|
|
1349
1355
|
/**
|
|
1350
|
-
* Creates a
|
|
1356
|
+
* Creates a fingerprint for a GeoJSON FeatureCollection. Linear in the size of
|
|
1357
|
+
* the data; two collections with the same content get the same fingerprint.
|
|
1351
1358
|
*
|
|
1352
1359
|
* @param data - GeoJSON data to fingerprint
|
|
1353
1360
|
* @returns Fingerprint object or null if data is not a FeatureCollection
|
|
@@ -1358,16 +1365,16 @@ declare function createGeoJSONFingerprint(data: GeoJSONFeatureCollection | GeoJS
|
|
|
1358
1365
|
*
|
|
1359
1366
|
* @param a - First fingerprint
|
|
1360
1367
|
* @param b - Second fingerprint
|
|
1361
|
-
* @returns true if fingerprints match (data
|
|
1368
|
+
* @returns true if fingerprints match (data unchanged)
|
|
1362
1369
|
*/
|
|
1363
1370
|
declare function fingerprintEqual(a: GeoJSONFingerprint | null, b: GeoJSONFingerprint | null): boolean;
|
|
1364
1371
|
/**
|
|
1365
|
-
* Checks if two GeoJSON data objects are equal based on their fingerprints
|
|
1366
|
-
*
|
|
1372
|
+
* Checks if two GeoJSON data objects are equal based on their fingerprints:
|
|
1373
|
+
* same features, ids, geometry and properties.
|
|
1367
1374
|
*
|
|
1368
1375
|
* @param a - First GeoJSON data
|
|
1369
1376
|
* @param b - Second GeoJSON data
|
|
1370
|
-
* @returns true if data is
|
|
1377
|
+
* @returns true if the data is unchanged (barring a 32-bit hash collision)
|
|
1371
1378
|
*/
|
|
1372
1379
|
declare function geoJSONEqual(a: GeoJSONFeatureCollection | GeoJSON.GeoJSON | string | null | undefined, b: GeoJSONFeatureCollection | GeoJSON.GeoJSON | string | null | undefined): boolean;
|
|
1373
1380
|
|
|
@@ -1526,4 +1533,29 @@ declare function resetWorkerUrlWarning(): void;
|
|
|
1526
1533
|
*/
|
|
1527
1534
|
declare function warnIfWorkerUrlMissing(maplibregl: MapLibreWorkerApi, log?: (message: string) => void): boolean;
|
|
1528
1535
|
|
|
1529
|
-
|
|
1536
|
+
/**
|
|
1537
|
+
* deck.gl interleaving guard.
|
|
1538
|
+
*
|
|
1539
|
+
* `@deck.gl/mapbox` draws interleaved layers from a MapLibre custom layer and
|
|
1540
|
+
* reads the camera from the map's undocumented `map.transform` (`height`,
|
|
1541
|
+
* `_nearZ`, `elevation`). MapLibre 6 moved the camera out of the `Map` class
|
|
1542
|
+
* into `map._camera`, so `map.transform` is `undefined` there and every
|
|
1543
|
+
* interleaved frame throws `Cannot read properties of undefined (reading
|
|
1544
|
+
* 'height')`. As of deck.gl 9.4.1 (and 10.0.0-alpha.1) no release handles it.
|
|
1545
|
+
*
|
|
1546
|
+
* Overlaid rendering (deck.gl's own canvas stacked above the map) only uses the
|
|
1547
|
+
* public camera API (`getCenter`, `getZoom`, ...), so it keeps working. The
|
|
1548
|
+
* check is on the property, not the MapLibre version, so interleaving comes
|
|
1549
|
+
* back on its own once either side restores it.
|
|
1550
|
+
*/
|
|
1551
|
+
/** Anything that might be a MapLibre/Mapbox map. */
|
|
1552
|
+
type DeckHostMap = object | null | undefined;
|
|
1553
|
+
/** Whether deck.gl can render interleaved into this map. */
|
|
1554
|
+
declare function supportsDeckInterleaving(map: DeckHostMap): boolean;
|
|
1555
|
+
/**
|
|
1556
|
+
* The `interleaved` value to hand `MapboxOverlay`: the requested one, or
|
|
1557
|
+
* `false` when the map cannot be drawn into interleaved (see above).
|
|
1558
|
+
*/
|
|
1559
|
+
declare function resolveDeckInterleaved(map: DeckHostMap, requested: boolean): boolean;
|
|
1560
|
+
|
|
1561
|
+
export { createClusterTextLayout as $, type SimplificationThreshold as A, applyMarkerChildProtection as B, type ClusterCircleStyleOptions as C, DEFAULT_SIMPLIFICATION_THRESHOLDS as D, type ExtrusionHeightOptions as E, type FeatureGroup as F, type GenerateLODOptions as G, applyMarkerProtection as H, boundsToPolygon as I, calculateBounds as J, KEYBOARD_CONTROLS as K, type LODData as L, MARKER_PROTECTION_CLASS as M, type NumberExpression as N, calculateCentroid as O, type PaintProps as P, calculateZoomThresholds as Q, clampLatitude as R, type SimplificationStats as S, combineBounds as T, type UnclusteredPointStyleOptions as U, type ValidationResult as V, countFeaturesByType as W, createCategoricalColorExpression as X, createCircleStyle as Y, createClusterCirclePaint as Z, createClusterStyles as _, type ClusterExpandOptions as a, loadGeoJSON as a$, createContinuousColorExpression as a0, createDynamicLODManager as a1, createExtrusionHeightExpression as a2, createExtrusionStyle as a3, createFillStyle as a4, createGeoJSONFingerprint as a5, createHeatmapStyle as a6, createHoverExpression as a7, createInteractiveExpression as a8, createInteractiveStatusColorExpression as a9, generateBoundingPolygon as aA, generateConvexHull as aB, generateFeatureCollectionDescription as aC, generateFeatureTable as aD, generateKeyboardControlsDescription as aE, generateLODData as aF, generateLODDataWithSimplification as aG, generateMapDescription as aH, generateMarkerList as aI, generateMarkersDescription as aJ, generateMoveAnnouncement as aK, geoJSONEqual as aL, getChangedPaintProps as aM, getClusterBounds as aN, getClusterChildren as aO, getClusterExpansionZoom as aP, getClusterLeaves as aQ, getGridNavigationIndex as aR, getHighlightStyle as aS, getSelectionStyle as aT, getSimplificationToleranceForZoom as aU, getSimplifiedFeaturesForZoom as aV, groupFeaturesByProperty as aW, isClusterFeature as aX, isValidBounds as aY, isValidLatitude as aZ, isValidLongitude as a_, createLineStyle as aa, createLotFillStyle as ab, createLotOutlineStyle as ac, createSelectionExpression as ad, createStatusColorExpression as ae, createZoomExpression as af, decimalToDMS as ag, deepEqual as ah, ensureValidCoordinates as ai, expandCluster as aj, expandClusterToBounds as ak, extendBounds as al, filterByGeometryType as am, filterEqual as an, fingerprintEqual as ao, formatArea as ap, formatBearing as aq, formatBounds as ar, formatCoordinates as as, formatDistance as at, formatFeatureProperties as au, formatLabel as av, formatPitch as aw, formatPropertyValue as ax, formatScale as ay, formatZoom as az, type ClusterExpansionResult as b, normalizeLongitude as b0, paintPropsEqual as b1, removeMarkerProtection as b2, resetWorkerUrlWarning as b3, resolveDeckInterleaved as b4, serializeFilter as b5, simplifyFeature as b6, simplifyFeatureCollection as b7, simplifyFeatureCollectionWithStats as b8, simplifyPolygon as b9, supportsDeckInterleaving as ba, validateBoundsArray as bb, validateCoordinates as bc, validateGeoJSON as bd, warnIfWorkerUrlMissing as be, zoomToScale as bf, 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 DeckHostMap as l, type DynamicLODOptions as m, type DynamicLODState as n, type FilterExpression as o, type FilterOperator as p, type FilterValue as q, type GeoJSONFingerprint as r, type GroupFeaturesOptions as s, type LODDataWithSimplification as t, type LoadGeoJSONOptions as u, type LoadGeoJSONResult as v, type LotFillStyleOptions as w, type LotOutlineStyleOptions as x, type MapLibreWorkerApi as y, type PaintPropsDiff as z };
|