@accelint/map-toolkit 1.5.0 → 2.0.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/CHANGELOG.md +33 -0
- package/catalog-info.yaml +4 -4
- package/dist/camera/events.js +1 -1
- package/dist/camera/index.d.ts +1 -1
- package/dist/camera/index.js +1 -1
- package/dist/camera/store.d.ts +1 -1
- package/dist/camera/store.js +3 -5
- package/dist/camera/store.js.map +1 -1
- package/dist/camera/types.d.ts +1 -1
- package/dist/camera/types.js +1 -1
- package/dist/cursor-coordinates/constants.js +1 -1
- package/dist/cursor-coordinates/index.d.ts +1 -1
- package/dist/cursor-coordinates/index.js +1 -1
- package/dist/cursor-coordinates/store.d.ts +1 -1
- package/dist/cursor-coordinates/store.js +1 -1
- package/dist/cursor-coordinates/types.d.ts +1 -1
- package/dist/cursor-coordinates/types.js +1 -1
- package/dist/cursor-coordinates/use-cursor-coordinates.d.ts +1 -1
- package/dist/cursor-coordinates/use-cursor-coordinates.js +4 -9
- package/dist/cursor-coordinates/use-cursor-coordinates.js.map +1 -1
- package/dist/deckgl/base-map/constants.js +1 -1
- package/dist/deckgl/base-map/controls.d.ts +1 -1
- package/dist/deckgl/base-map/controls.js +1 -1
- package/dist/deckgl/base-map/events.js +1 -1
- package/dist/deckgl/base-map/index.d.ts +1 -1
- package/dist/deckgl/base-map/index.js +1 -1
- package/dist/deckgl/base-map/provider.d.ts +3 -3
- package/dist/deckgl/base-map/provider.js +1 -1
- package/dist/deckgl/base-map/types.d.ts +1 -1
- package/dist/deckgl/base-map/types.js +1 -1
- package/dist/deckgl/index.d.ts +4 -4
- package/dist/deckgl/index.js +1 -1
- package/dist/deckgl/saved-viewports/index.d.ts +1 -1
- package/dist/deckgl/saved-viewports/index.js +1 -1
- package/dist/deckgl/saved-viewports/storage.d.ts +1 -1
- package/dist/deckgl/saved-viewports/storage.js +5 -10
- package/dist/deckgl/saved-viewports/storage.js.map +1 -1
- package/dist/deckgl/shapes/display-shape-layer/constants.js +66 -13
- package/dist/deckgl/shapes/display-shape-layer/constants.js.map +1 -1
- package/dist/deckgl/shapes/display-shape-layer/fiber.d.ts +1 -1
- package/dist/deckgl/shapes/display-shape-layer/fiber.js +1 -1
- package/dist/deckgl/shapes/display-shape-layer/index.d.ts +74 -35
- package/dist/deckgl/shapes/display-shape-layer/index.js +381 -154
- package/dist/deckgl/shapes/display-shape-layer/index.js.map +1 -1
- package/dist/deckgl/shapes/display-shape-layer/shape-label-layer.js +1 -1
- package/dist/deckgl/shapes/display-shape-layer/store.js +1 -1
- package/dist/deckgl/shapes/display-shape-layer/types.d.ts +108 -19
- package/dist/deckgl/shapes/display-shape-layer/types.js +1 -1
- package/dist/deckgl/shapes/display-shape-layer/use-select-shape.d.ts +1 -1
- package/dist/deckgl/shapes/display-shape-layer/use-select-shape.js +1 -1
- package/dist/deckgl/shapes/display-shape-layer/utils/display-style.js +66 -36
- package/dist/deckgl/shapes/display-shape-layer/utils/display-style.js.map +1 -1
- package/dist/deckgl/shapes/display-shape-layer/utils/elevation.js +407 -0
- package/dist/deckgl/shapes/display-shape-layer/utils/elevation.js.map +1 -0
- package/dist/deckgl/shapes/display-shape-layer/utils/icon-config.js +151 -0
- package/dist/deckgl/shapes/display-shape-layer/utils/icon-config.js.map +1 -0
- package/dist/deckgl/shapes/display-shape-layer/utils/interaction.js +50 -0
- package/dist/deckgl/shapes/display-shape-layer/utils/interaction.js.map +1 -0
- package/dist/deckgl/shapes/display-shape-layer/utils/labels.d.ts +1 -1
- package/dist/deckgl/shapes/display-shape-layer/utils/labels.js +28 -39
- package/dist/deckgl/shapes/display-shape-layer/utils/labels.js.map +1 -1
- package/dist/deckgl/shapes/draw-shape-layer/constants.js +1 -1
- package/dist/deckgl/shapes/draw-shape-layer/events.d.ts +1 -1
- package/dist/deckgl/shapes/draw-shape-layer/events.js +1 -1
- package/dist/deckgl/shapes/draw-shape-layer/fiber.js +1 -1
- package/dist/deckgl/shapes/draw-shape-layer/index.d.ts +1 -1
- package/dist/deckgl/shapes/draw-shape-layer/index.js +4 -14
- package/dist/deckgl/shapes/draw-shape-layer/index.js.map +1 -1
- package/dist/deckgl/shapes/draw-shape-layer/modes/draw-circle-mode-with-tooltip.js +2 -3
- package/dist/deckgl/shapes/draw-shape-layer/modes/draw-circle-mode-with-tooltip.js.map +1 -1
- package/dist/deckgl/shapes/draw-shape-layer/modes/draw-ellipse-mode-with-tooltip.js +1 -1
- package/dist/deckgl/shapes/draw-shape-layer/modes/draw-line-string-mode-with-tooltip.js +2 -19
- package/dist/deckgl/shapes/draw-shape-layer/modes/draw-line-string-mode-with-tooltip.js.map +1 -1
- package/dist/deckgl/shapes/draw-shape-layer/modes/draw-polygon-mode-with-tooltip.js +2 -32
- package/dist/deckgl/shapes/draw-shape-layer/modes/draw-polygon-mode-with-tooltip.js.map +1 -1
- package/dist/deckgl/shapes/draw-shape-layer/modes/draw-rectangle-mode-with-tooltip.js +9 -10
- package/dist/deckgl/shapes/draw-shape-layer/modes/draw-rectangle-mode-with-tooltip.js.map +1 -1
- package/dist/deckgl/shapes/draw-shape-layer/modes/index.js +2 -32
- package/dist/deckgl/shapes/draw-shape-layer/modes/index.js.map +1 -1
- package/dist/deckgl/shapes/draw-shape-layer/store.js +1 -1
- package/dist/deckgl/shapes/draw-shape-layer/types.d.ts +1 -1
- package/dist/deckgl/shapes/draw-shape-layer/types.js +1 -1
- package/dist/deckgl/shapes/draw-shape-layer/use-draw-shape.d.ts +1 -1
- package/dist/deckgl/shapes/draw-shape-layer/use-draw-shape.js +1 -1
- package/dist/deckgl/shapes/draw-shape-layer/utils/feature-conversion.js +3 -8
- package/dist/deckgl/shapes/draw-shape-layer/utils/feature-conversion.js.map +1 -1
- package/dist/deckgl/shapes/edit-shape-layer/constants.js +17 -2
- package/dist/deckgl/shapes/edit-shape-layer/constants.js.map +1 -1
- package/dist/deckgl/shapes/edit-shape-layer/events.d.ts +1 -1
- package/dist/deckgl/shapes/edit-shape-layer/events.js +1 -1
- package/dist/deckgl/shapes/edit-shape-layer/fiber.d.ts +1 -1
- package/dist/deckgl/shapes/edit-shape-layer/fiber.js +1 -1
- package/dist/deckgl/shapes/edit-shape-layer/index.d.ts +5 -2
- package/dist/deckgl/shapes/edit-shape-layer/index.js +51 -20
- package/dist/deckgl/shapes/edit-shape-layer/index.js.map +1 -1
- package/dist/deckgl/shapes/edit-shape-layer/modes/base-transform-mode.js +4 -1
- package/dist/deckgl/shapes/edit-shape-layer/modes/base-transform-mode.js.map +1 -1
- package/dist/deckgl/shapes/edit-shape-layer/modes/bounding-transform-mode.js +1 -1
- package/dist/deckgl/shapes/edit-shape-layer/modes/bounding-transform-mode.js.map +1 -1
- package/dist/deckgl/shapes/edit-shape-layer/modes/circle-transform-mode.js +1 -1
- package/dist/deckgl/shapes/edit-shape-layer/modes/circle-transform-mode.js.map +1 -1
- package/dist/deckgl/shapes/edit-shape-layer/modes/index.js +1 -1
- package/dist/deckgl/shapes/edit-shape-layer/modes/point-translate-mode.js +1 -1
- package/dist/deckgl/shapes/edit-shape-layer/modes/point-translate-mode.js.map +1 -1
- package/dist/deckgl/shapes/edit-shape-layer/modes/rotate-mode-with-snap.js +1 -1
- package/dist/deckgl/shapes/edit-shape-layer/modes/rotate-mode-with-snap.js.map +1 -1
- package/dist/deckgl/shapes/edit-shape-layer/modes/scale-mode-with-free-transform.js +1 -1
- package/dist/deckgl/shapes/edit-shape-layer/modes/scale-mode-with-free-transform.js.map +1 -1
- package/dist/deckgl/shapes/edit-shape-layer/modes/vertex-transform-mode.js +1 -1
- package/dist/deckgl/shapes/edit-shape-layer/modes/vertex-transform-mode.js.map +1 -1
- package/dist/deckgl/shapes/edit-shape-layer/store.js +70 -12
- package/dist/deckgl/shapes/edit-shape-layer/store.js.map +1 -1
- package/dist/deckgl/shapes/edit-shape-layer/types.d.ts +14 -2
- package/dist/deckgl/shapes/edit-shape-layer/types.js +1 -1
- package/dist/deckgl/shapes/edit-shape-layer/use-edit-shape.d.ts +1 -1
- package/dist/deckgl/shapes/edit-shape-layer/use-edit-shape.js +1 -1
- package/dist/deckgl/shapes/index.d.ts +4 -4
- package/dist/deckgl/shapes/index.js +1 -1
- package/dist/deckgl/shapes/shared/constants.d.ts +4 -3
- package/dist/deckgl/shapes/shared/constants.js +50 -10
- package/dist/deckgl/shapes/shared/constants.js.map +1 -1
- package/dist/deckgl/shapes/shared/events.d.ts +5 -1
- package/dist/deckgl/shapes/shared/events.js +1 -1
- package/dist/deckgl/shapes/shared/events.js.map +1 -1
- package/dist/deckgl/shapes/shared/hooks/use-shift-zoom-disable.js +19 -16
- package/dist/deckgl/shapes/shared/hooks/use-shift-zoom-disable.js.map +1 -1
- package/dist/deckgl/shapes/shared/types.d.ts +174 -53
- package/dist/deckgl/shapes/shared/types.js +155 -2
- package/dist/deckgl/shapes/shared/types.js.map +1 -1
- package/dist/deckgl/shapes/shared/utils/geometry-measurements.js +29 -24
- package/dist/deckgl/shapes/shared/utils/geometry-measurements.js.map +1 -1
- package/dist/deckgl/shapes/shared/utils/layer-config.js +8 -5
- package/dist/deckgl/shapes/shared/utils/layer-config.js.map +1 -1
- package/dist/deckgl/shapes/shared/utils/mode-utils.js +50 -20
- package/dist/deckgl/shapes/shared/utils/mode-utils.js.map +1 -1
- package/dist/deckgl/shapes/shared/utils/pick-filtering.js +22 -15
- package/dist/deckgl/shapes/shared/utils/pick-filtering.js.map +1 -1
- package/dist/deckgl/shapes/shared/utils/style-utils.d.ts +38 -14
- package/dist/deckgl/shapes/shared/utils/style-utils.js +43 -32
- package/dist/deckgl/shapes/shared/utils/style-utils.js.map +1 -1
- package/dist/deckgl/symbol-layer/fiber.d.ts +1 -1
- package/dist/deckgl/symbol-layer/fiber.js +1 -1
- package/dist/deckgl/symbol-layer/index.d.ts +1 -1
- package/dist/deckgl/symbol-layer/index.js +1 -1
- package/dist/deckgl/text-layer/character-sets.js +1 -1
- package/dist/deckgl/text-layer/default-settings.d.ts +1 -1
- package/dist/deckgl/text-layer/default-settings.js +1 -1
- package/dist/deckgl/text-layer/fiber.d.ts +1 -1
- package/dist/deckgl/text-layer/fiber.js +1 -1
- package/dist/deckgl/text-layer/index.d.ts +1 -1
- package/dist/deckgl/text-layer/index.js +1 -1
- package/dist/deckgl/text-settings.d.ts +3 -3
- package/dist/deckgl/text-settings.js +1 -1
- package/dist/map-cursor/events.js +1 -1
- package/dist/map-cursor/index.d.ts +1 -1
- package/dist/map-cursor/index.js +1 -1
- package/dist/map-cursor/store.d.ts +1 -1
- package/dist/map-cursor/store.js +1 -1
- package/dist/map-cursor/types.d.ts +1 -1
- package/dist/map-cursor/types.js +1 -1
- package/dist/map-cursor/use-map-cursor.d.ts +1 -1
- package/dist/map-cursor/use-map-cursor.js +1 -1
- package/dist/map-mode/events.js +1 -1
- package/dist/map-mode/index.d.ts +1 -1
- package/dist/map-mode/index.js +1 -1
- package/dist/map-mode/store.d.ts +1 -1
- package/dist/map-mode/store.js +3 -8
- package/dist/map-mode/store.js.map +1 -1
- package/dist/map-mode/types.d.ts +1 -1
- package/dist/map-mode/types.js +1 -1
- package/dist/map-mode/use-map-mode.d.ts +1 -1
- package/dist/map-mode/use-map-mode.js +1 -1
- package/dist/maplibre/hooks/use-maplibre.d.ts +1 -1
- package/dist/maplibre/hooks/use-maplibre.js +1 -1
- package/dist/maplibre/index.d.ts +1 -1
- package/dist/maplibre/index.js +1 -1
- package/dist/shared/cleanup.d.ts +1 -1
- package/dist/shared/cleanup.js +1 -1
- package/dist/shared/constants.js +1 -1
- package/dist/shared/create-map-store.d.ts +1 -1
- package/dist/shared/create-map-store.js +1 -1
- package/dist/shared/logger.js +31 -0
- package/dist/shared/logger.js.map +1 -0
- package/dist/shared/units.js +1 -1
- package/dist/viewport/index.d.ts +1 -1
- package/dist/viewport/index.js +1 -1
- package/dist/viewport/store.d.ts +1 -1
- package/dist/viewport/store.js +1 -1
- package/dist/viewport/types.d.ts +1 -1
- package/dist/viewport/types.js +1 -1
- package/dist/viewport/utils.d.ts +1 -1
- package/dist/viewport/utils.js +1 -1
- package/dist/viewport/viewport-size.d.ts +3 -3
- package/dist/viewport/viewport-size.js +1 -1
- package/package.json +22 -20
- package/dist/hotkey-manager/dist/react/use-hotkey.js +0 -39
- package/dist/hotkey-manager/dist/react/use-hotkey.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.js","names":[],"sources":["../../../src/deckgl/saved-viewports/storage.ts"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {
|
|
1
|
+
{"version":3,"file":"storage.js","names":[],"sources":["../../../src/deckgl/saved-viewports/storage.ts"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { createLoggerDomain } from '@/shared/logger';\nimport type { MapViewState } from '@deck.gl/core';\n\nconst logger = createLoggerDomain('[SavedViewports]');\n\n/**\n * Base storage key for saved viewports in localStorage.\n */\nexport const STORAGE_ID = 'deckgl-saved-viewports';\n\n/**\n * Generates a storage key, optionally namespaced by unique identifier.\n *\n * @param uniqueIdentifier - Optional namespace for multiple map instances\n * @returns Storage key string\n */\nconst getContainerKey = (uniqueIdentifier?: string) =>\n uniqueIdentifier ? `${STORAGE_ID}-${uniqueIdentifier}` : STORAGE_ID;\n\n/**\n * Retrieves the storage container from localStorage.\n * Returns empty object if parsing fails or key doesn't exist.\n *\n * @param containerKey - The storage key to retrieve\n * @returns Parsed storage container object\n */\nconst getContainer = (containerKey: string) => {\n try {\n return JSON.parse(localStorage.getItem(containerKey) ?? '{}');\n } catch (err) {\n logger\n .withError(err)\n .error(\n `Failed to parse storage container for key: ${containerKey}, returning empty container.`,\n );\n\n return {};\n }\n};\n\n/**\n * Persists a viewport state to localStorage.\n *\n * Saves the viewport under the given ID within a namespaced container.\n * If the container doesn't exist, creates it. If the ID already exists, overwrites it.\n *\n * @param id - Unique identifier for this viewport (typically a key combination ID)\n * @param obj - The MapViewState to persist\n * @param uniqueIdentifier - Optional namespace for multiple map instances\n *\n * @example\n * ```typescript\n * import { persist } from '@accelint/map-toolkit/deckgl/saved-viewports/storage';\n *\n * const viewport = {\n * latitude: 38.9072,\n * longitude: -77.0369,\n * zoom: 10,\n * pitch: 0,\n * bearing: 0,\n * };\n *\n * persist('Digit1', viewport);\n * persist('Digit2', viewport, 'main-map');\n * ```\n */\nexport const persist = (\n id: string,\n obj: MapViewState,\n uniqueIdentifier?: string,\n) => {\n const containerKey = getContainerKey(uniqueIdentifier);\n const container = getContainer(containerKey);\n container[id] = obj;\n localStorage.setItem(containerKey, JSON.stringify(container));\n};\n\n/**\n * Retrieves a saved viewport state from localStorage.\n *\n * Returns the viewport associated with the given ID, or undefined if not found.\n * Logs a warning if the viewport doesn't exist.\n *\n * @param id - Unique identifier for the viewport to retrieve\n * @param uniqueIdentifier - Optional namespace for multiple map instances\n * @returns The saved MapViewState or undefined if not found\n *\n * @example\n * ```typescript\n * import { retrieve } from '@accelint/map-toolkit/deckgl/saved-viewports/storage';\n *\n * const viewport = retrieve('Digit1');\n * if (viewport) {\n * console.log('Restored viewport:', viewport);\n * }\n *\n * const mainMapViewport = retrieve('Digit1', 'main-map');\n * ```\n */\nexport const retrieve = (id: string, uniqueIdentifier?: string) => {\n const containerKey = getContainerKey(uniqueIdentifier);\n const container = getContainer(containerKey);\n const obj = container[id];\n if (!obj) {\n logger.warn(`Object with id: ${id} does not exist`);\n }\n return obj;\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAeA,MAAM,SAAS,mBAAmB,mBAAmB;;;;AAKrD,MAAa,aAAa;;;;;;;AAQ1B,MAAM,mBAAmB,qBACvB,mBAAmB,GAAG,WAAW,GAAG,qBAAqB;;;;;;;;AAS3D,MAAM,gBAAgB,iBAAyB;AAC7C,KAAI;AACF,SAAO,KAAK,MAAM,aAAa,QAAQ,aAAa,IAAI,KAAK;UACtD,KAAK;AACZ,SACG,UAAU,IAAI,CACd,MACC,8CAA8C,aAAa,8BAC5D;AAEH,SAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8Bb,MAAa,WACX,IACA,KACA,qBACG;CACH,MAAM,eAAe,gBAAgB,iBAAiB;CACtD,MAAM,YAAY,aAAa,aAAa;AAC5C,WAAU,MAAM;AAChB,cAAa,QAAQ,cAAc,KAAK,UAAU,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;AAyB/D,MAAa,YAAY,IAAY,qBAA8B;CAGjE,MAAM,MADY,aADG,gBAAgB,iBAAiB,CACV,CACtB;AACtB,KAAI,CAAC,IACH,QAAO,KAAK,mBAAmB,GAAG,iBAAiB;AAErD,QAAO"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright
|
|
2
|
+
* Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
|
|
3
3
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
5
|
* of the License at https://www.apache.org/licenses/LICENSE-2.0
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
'use client';
|
|
15
15
|
|
|
16
16
|
import { DEFAULT_COLORS } from "../shared/constants.js";
|
|
17
|
+
import { PathStyleExtension } from "@deck.gl/extensions";
|
|
17
18
|
|
|
18
19
|
//#region src/deckgl/shapes/display-shape-layer/constants.ts
|
|
19
20
|
/**
|
|
@@ -28,16 +29,6 @@ const MAP_INTERACTION = {
|
|
|
28
29
|
ICON_HOVER_SIZE_INCREASE: 5
|
|
29
30
|
};
|
|
30
31
|
/**
|
|
31
|
-
* Selection highlight configuration.
|
|
32
|
-
*
|
|
33
|
-
* Controls the appearance of selected shapes, including highlight color
|
|
34
|
-
* and icon size adjustments for Point shapes.
|
|
35
|
-
*/
|
|
36
|
-
const SELECTION_HIGHLIGHT = {
|
|
37
|
-
COLOR: DEFAULT_COLORS.highlight,
|
|
38
|
-
ICON_SIZE_INCREASE: 8
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
32
|
* Coffin corners configuration for Point selection/hover feedback.
|
|
42
33
|
*
|
|
43
34
|
* Coffin corners are bracket-like corners that appear around Point shapes
|
|
@@ -62,9 +53,71 @@ const DEFAULT_DISPLAY_PROPS = {
|
|
|
62
53
|
showLabels: "always",
|
|
63
54
|
showHighlight: false,
|
|
64
55
|
applyBaseOpacity: true,
|
|
65
|
-
highlightColor:
|
|
56
|
+
highlightColor: DEFAULT_COLORS.highlight
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Material settings for lighting effects on polygon shapes.
|
|
60
|
+
* Controls fill brightness for hover and selection overlay layers.
|
|
61
|
+
* Keys mirror BRIGHTNESS_FACTOR for consistency.
|
|
62
|
+
*/
|
|
63
|
+
const MATERIAL_SETTINGS = {
|
|
64
|
+
NORMAL: {
|
|
65
|
+
ambient: .35,
|
|
66
|
+
diffuse: .6,
|
|
67
|
+
shininess: 32,
|
|
68
|
+
specularColor: [
|
|
69
|
+
255,
|
|
70
|
+
255,
|
|
71
|
+
255
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
HOVER_OR_SELECT: {
|
|
75
|
+
ambient: .6,
|
|
76
|
+
diffuse: .8,
|
|
77
|
+
shininess: 64,
|
|
78
|
+
specularColor: [
|
|
79
|
+
255,
|
|
80
|
+
255,
|
|
81
|
+
255
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
HOVER_AND_SELECT: {
|
|
85
|
+
ambient: .75,
|
|
86
|
+
diffuse: .95,
|
|
87
|
+
shininess: 80,
|
|
88
|
+
specularColor: [
|
|
89
|
+
255,
|
|
90
|
+
255,
|
|
91
|
+
255
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Brightness multipliers for interaction state feedback.
|
|
97
|
+
* Applied via brightenColor() to line colors, curtains, and elevation indicators.
|
|
98
|
+
* - HOVER_OR_SELECT: shape is hovered or selected (single active state)
|
|
99
|
+
* - HOVER_AND_SELECT: shape is both hovered and selected simultaneously
|
|
100
|
+
*/
|
|
101
|
+
const BRIGHTNESS_FACTOR = {
|
|
102
|
+
HOVER_OR_SELECT: 1.4,
|
|
103
|
+
HOVER_AND_SELECT: 1.7
|
|
66
104
|
};
|
|
105
|
+
/**
|
|
106
|
+
* Opacity multiplier for interaction overlay layers (hover, select).
|
|
107
|
+
* Applied to the shape's fill alpha — sits between the base opacity (0.2)
|
|
108
|
+
* and full opacity (1.0) so the overlay reads clearly without being too solid.
|
|
109
|
+
*/
|
|
110
|
+
const OVERLAY_FILL_OPACITY = .25;
|
|
111
|
+
/** Reusable deck.gl PathStyleExtension enabling dash patterns on GeoJsonLayer lines. */
|
|
112
|
+
const DASH_EXTENSION = [new PathStyleExtension({ dash: true })];
|
|
113
|
+
/** Readonly [r, g, b, a] tuple of DEFAULT_COLORS.highlight, pre-spread at module load for hot-path usage. */
|
|
114
|
+
const HIGHLIGHT_COLOR_TUPLE = [
|
|
115
|
+
DEFAULT_COLORS.highlight[0],
|
|
116
|
+
DEFAULT_COLORS.highlight[1],
|
|
117
|
+
DEFAULT_COLORS.highlight[2],
|
|
118
|
+
DEFAULT_COLORS.highlight[3] ?? 255
|
|
119
|
+
];
|
|
67
120
|
|
|
68
121
|
//#endregion
|
|
69
|
-
export { COFFIN_CORNERS, DEFAULT_DISPLAY_PROPS, MAP_INTERACTION };
|
|
122
|
+
export { BRIGHTNESS_FACTOR, COFFIN_CORNERS, DASH_EXTENSION, DEFAULT_DISPLAY_PROPS, HIGHLIGHT_COLOR_TUPLE, MAP_INTERACTION, MATERIAL_SETTINGS, OVERLAY_FILL_OPACITY };
|
|
70
123
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","names":[],"sources":["../../../../src/deckgl/shapes/display-shape-layer/constants.ts"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\
|
|
1
|
+
{"version":3,"file":"constants.js","names":["HIGHLIGHT_COLOR_TUPLE: Rgba255Tuple"],"sources":["../../../../src/deckgl/shapes/display-shape-layer/constants.ts"],"sourcesContent":["/*\n * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\nimport { PathStyleExtension } from '@deck.gl/extensions';\nimport { DEFAULT_COLORS } from '../shared/constants';\nimport type { Rgba255Tuple } from '@accelint/predicates';\n\n/**\n * Map interaction constants.\n *\n * Values derived from ngc2 for consistency with existing UI patterns.\n * Controls sizing and interaction feedback for shape rendering.\n */\nexport const MAP_INTERACTION = {\n LINE_WIDTH_MIN_PIXELS: 1, // Minimum line width in pixels\n ICON_SIZE: 38, // Size of shape icons\n ICON_HOVER_SIZE_INCREASE: 5, // Additional pixels added on hover\n} as const;\n\n/**\n * Coffin corners configuration for Point selection/hover feedback.\n *\n * Coffin corners are bracket-like corners that appear around Point shapes\n * with icons to indicate hover and selection states. They provide visual\n * feedback without obscuring the icon itself.\n */\nexport const COFFIN_CORNERS = {\n /** Icon name for hover state (white corners with background fill) */\n HOVER_ICON: 'coffin-corners-hover',\n /** Icon name for selected state (blue corners, no fill) */\n SELECTED_ICON: 'coffin-corners-selected',\n /** Icon name for selected+hover state (blue corners with background fill) */\n SELECTED_HOVER_ICON: 'coffin-corners-selected-hover',\n /** Size of the coffin corners icon */\n SIZE: 38,\n} as const;\n\n/**\n * Default props for DisplayShapeLayer.\n *\n * Provides sensible defaults for interactive shape display with labels,\n * standard opacity handling, and minimal visual feedback. These can be\n * overridden via layer props.\n */\nexport const DEFAULT_DISPLAY_PROPS = {\n pickable: true,\n showLabels: 'always' as const,\n showHighlight: false,\n applyBaseOpacity: true,\n highlightColor: DEFAULT_COLORS.highlight,\n};\n\n/**\n * Material settings for lighting effects on polygon shapes.\n * Controls fill brightness for hover and selection overlay layers.\n * Keys mirror BRIGHTNESS_FACTOR for consistency.\n */\nexport const MATERIAL_SETTINGS = {\n // Normal state - standard lighting\n NORMAL: {\n ambient: 0.35,\n diffuse: 0.6,\n shininess: 32,\n specularColor: [255, 255, 255] as [number, number, number],\n },\n // Hovered or selected (single active state)\n HOVER_OR_SELECT: {\n ambient: 0.6,\n diffuse: 0.8,\n shininess: 64,\n specularColor: [255, 255, 255] as [number, number, number],\n },\n // Hovered and selected simultaneously - brighter\n HOVER_AND_SELECT: {\n ambient: 0.75,\n diffuse: 0.95,\n shininess: 80,\n specularColor: [255, 255, 255] as [number, number, number],\n },\n} as const;\n\n/**\n * Brightness multipliers for interaction state feedback.\n * Applied via brightenColor() to line colors, curtains, and elevation indicators.\n * - HOVER_OR_SELECT: shape is hovered or selected (single active state)\n * - HOVER_AND_SELECT: shape is both hovered and selected simultaneously\n */\nexport const BRIGHTNESS_FACTOR = {\n HOVER_OR_SELECT: 1.4,\n HOVER_AND_SELECT: 1.7,\n} as const;\n\n/**\n * Opacity multiplier for interaction overlay layers (hover, select).\n * Applied to the shape's fill alpha — sits between the base opacity (0.2)\n * and full opacity (1.0) so the overlay reads clearly without being too solid.\n */\nexport const OVERLAY_FILL_OPACITY = 0.25;\n\n/** Reusable deck.gl PathStyleExtension enabling dash patterns on GeoJsonLayer lines. */\nexport const DASH_EXTENSION = [new PathStyleExtension({ dash: true })];\n\n/** Readonly [r, g, b, a] tuple of DEFAULT_COLORS.highlight, pre-spread at module load for hot-path usage. */\nexport const HIGHLIGHT_COLOR_TUPLE: Rgba255Tuple = [\n DEFAULT_COLORS.highlight[0],\n DEFAULT_COLORS.highlight[1],\n DEFAULT_COLORS.highlight[2],\n DEFAULT_COLORS.highlight[3] ?? 255,\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAa,kBAAkB;CAC7B,uBAAuB;CACvB,WAAW;CACX,0BAA0B;CAC3B;;;;;;;;AASD,MAAa,iBAAiB;CAE5B,YAAY;CAEZ,eAAe;CAEf,qBAAqB;CAErB,MAAM;CACP;;;;;;;;AASD,MAAa,wBAAwB;CACnC,UAAU;CACV,YAAY;CACZ,eAAe;CACf,kBAAkB;CAClB,gBAAgB,eAAe;CAChC;;;;;;AAOD,MAAa,oBAAoB;CAE/B,QAAQ;EACN,SAAS;EACT,SAAS;EACT,WAAW;EACX,eAAe;GAAC;GAAK;GAAK;GAAI;EAC/B;CAED,iBAAiB;EACf,SAAS;EACT,SAAS;EACT,WAAW;EACX,eAAe;GAAC;GAAK;GAAK;GAAI;EAC/B;CAED,kBAAkB;EAChB,SAAS;EACT,SAAS;EACT,WAAW;EACX,eAAe;GAAC;GAAK;GAAK;GAAI;EAC/B;CACF;;;;;;;AAQD,MAAa,oBAAoB;CAC/B,iBAAiB;CACjB,kBAAkB;CACnB;;;;;;AAOD,MAAa,uBAAuB;;AAGpC,MAAa,iBAAiB,CAAC,IAAI,mBAAmB,EAAE,MAAM,MAAM,CAAC,CAAC;;AAGtE,MAAaA,wBAAsC;CACjD,eAAe,UAAU;CACzB,eAAe,UAAU;CACzB,eAAe,UAAU;CACzB,eAAe,UAAU,MAAM;CAChC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright
|
|
2
|
+
* Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
|
|
3
3
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
5
|
* of the License at https://www.apache.org/licenses/LICENSE-2.0
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright
|
|
2
|
+
* Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
|
|
3
3
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
5
|
* of the License at https://www.apache.org/licenses/LICENSE-2.0
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright
|
|
2
|
+
* Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
|
|
3
3
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
5
|
* of the License at https://www.apache.org/licenses/LICENSE-2.0
|
|
@@ -10,23 +10,12 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import {
|
|
14
|
-
import { DisplayShapeLayerProps } from "./types.js";
|
|
13
|
+
import { DisplayShapeLayerProps, DisplayShapeLayerState } from "./types.js";
|
|
15
14
|
import * as _deck_gl_core0 from "@deck.gl/core";
|
|
16
15
|
import { CompositeLayer, Layer, PickingInfo } from "@deck.gl/core";
|
|
17
16
|
|
|
18
17
|
//#region src/deckgl/shapes/display-shape-layer/index.d.ts
|
|
19
|
-
|
|
20
|
-
* State type for DisplayShapeLayer
|
|
21
|
-
*/
|
|
22
|
-
type DisplayShapeLayerState = {
|
|
23
|
-
/** Index of currently hovered shape, undefined when not hovering */
|
|
24
|
-
hoverIndex?: number;
|
|
25
|
-
/** ID of the last hovered shape for event deduplication */
|
|
26
|
-
lastHoveredId?: ShapeId | null;
|
|
27
|
-
/** Allow additional properties from base layer state */
|
|
28
|
-
[key: string]: unknown;
|
|
29
|
-
};
|
|
18
|
+
|
|
30
19
|
/**
|
|
31
20
|
* DisplayShapeLayer - Read-only shapes visualization layer
|
|
32
21
|
*
|
|
@@ -36,24 +25,27 @@ type DisplayShapeLayerState = {
|
|
|
36
25
|
* ## Features
|
|
37
26
|
* - **Multiple geometry types**: Point, LineString, Polygon, and Circle
|
|
38
27
|
* - **Icon support**: Custom icons for Point geometries via icon atlases
|
|
39
|
-
* - **Interactive selection**: Click handling with
|
|
40
|
-
* - **Hover effects**:
|
|
28
|
+
* - **Interactive selection**: Click handling with brightness overlay on polygon select, optional highlight effect for non-icon-Point shapes (if showHighlight=true)
|
|
29
|
+
* - **Hover effects**: Polygon fills brighten via material lighting; outline width increases by 2px on hover
|
|
41
30
|
* - **Customizable labels**: Flexible label positioning with per-shape or global options
|
|
42
31
|
* - **Style properties**: Full control over colors, border/outline patterns, and opacity
|
|
43
32
|
* - **Event bus integration**: Automatically emits shape events via @accelint/bus
|
|
44
33
|
* - **Multi-map support**: Events include map instance ID for isolation
|
|
45
34
|
*
|
|
46
|
-
* ##
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* -
|
|
35
|
+
* ## Interaction Philosophy
|
|
36
|
+
* Interactions never modify a shape's innate styling. Hover and selection are always
|
|
37
|
+
* additive overlays rendered apart from the main layer using opacity-scaled fill colors
|
|
38
|
+
* and material-based brightness — the base shape is never altered.
|
|
50
39
|
*
|
|
51
40
|
* ## Layer Structure
|
|
52
|
-
* Renders up to
|
|
53
|
-
* 1. **
|
|
54
|
-
* 2. **
|
|
55
|
-
* 3. **
|
|
56
|
-
* 4. **
|
|
41
|
+
* Renders up to seven sublayers (in order, bottom to top):
|
|
42
|
+
* 1. **Select layer**: Selection brightness overlay for polygon shapes
|
|
43
|
+
* 2. **Hover layer**: Hover brightness overlay for polygon shapes
|
|
44
|
+
* 3. **Coffin corners layer**: Selection/hover feedback for Point shapes with icons
|
|
45
|
+
* 4. **Elevation visualization**: Curtains (LineStrings) or wireframes (polygons) — elevation only
|
|
46
|
+
* 5. **Elevation indicators**: Vertical strut lines for elevated non-polygon shapes — elevation only
|
|
47
|
+
* 6. **Main GeoJsonLayer**: Shape geometries with styling and interaction
|
|
48
|
+
* 7. **Label layer**: Text labels (if showLabels enabled)
|
|
57
49
|
*
|
|
58
50
|
* ## Icon Atlas Constraint
|
|
59
51
|
* When using icons for Point geometries, all shapes in a single layer must share the
|
|
@@ -115,6 +107,10 @@ declare class DisplayShapeLayer extends CompositeLayer<DisplayShapeLayerProps> {
|
|
|
115
107
|
state: DisplayShapeLayerState;
|
|
116
108
|
/** Cache for transformed features to avoid recreating objects on every render */
|
|
117
109
|
private featuresCache;
|
|
110
|
+
/** Cache for elevation classification and curtain features */
|
|
111
|
+
private elevationCache;
|
|
112
|
+
/** Cache for elevation indicator line segments */
|
|
113
|
+
private indicatorCache;
|
|
118
114
|
static layerName: string;
|
|
119
115
|
static defaultProps: {
|
|
120
116
|
pickable: boolean;
|
|
@@ -127,6 +123,18 @@ declare class DisplayShapeLayer extends CompositeLayer<DisplayShapeLayerProps> {
|
|
|
127
123
|
* Clean up state and caches when layer is destroyed
|
|
128
124
|
*/
|
|
129
125
|
finalizeState(): void;
|
|
126
|
+
/**
|
|
127
|
+
* Resolved highlight color — uses prop if provided, falls back to default.
|
|
128
|
+
*/
|
|
129
|
+
private get resolvedHighlight();
|
|
130
|
+
/**
|
|
131
|
+
* Handle picking events from the main shapes layer
|
|
132
|
+
*/
|
|
133
|
+
private handleMainLayerPick;
|
|
134
|
+
/**
|
|
135
|
+
* Handle picking events from curtain layers and map back to original LineString
|
|
136
|
+
*/
|
|
137
|
+
private handleCurtainPick;
|
|
130
138
|
/**
|
|
131
139
|
* Override getPickingInfo to handle events from sublayers
|
|
132
140
|
* This is the correct pattern for CompositeLayer event handling
|
|
@@ -138,7 +146,7 @@ declare class DisplayShapeLayer extends CompositeLayer<DisplayShapeLayerProps> {
|
|
|
138
146
|
}: {
|
|
139
147
|
info: PickingInfo;
|
|
140
148
|
mode?: string;
|
|
141
|
-
sourceLayer?:
|
|
149
|
+
sourceLayer?: Layer | null;
|
|
142
150
|
}): {
|
|
143
151
|
color: Uint8Array | null;
|
|
144
152
|
layer: Layer | null;
|
|
@@ -173,21 +181,32 @@ declare class DisplayShapeLayer extends CompositeLayer<DisplayShapeLayerProps> {
|
|
|
173
181
|
*/
|
|
174
182
|
private handleShapeHover;
|
|
175
183
|
/**
|
|
176
|
-
*
|
|
177
|
-
*
|
|
184
|
+
* Get or compute elevation-derived data (feature classification + curtain features).
|
|
185
|
+
* Cached on features identity and applyBaseOpacity to avoid per-frame recomputation.
|
|
186
|
+
*/
|
|
187
|
+
private getElevationData;
|
|
188
|
+
/**
|
|
189
|
+
* Render highlight sublayer (underneath main layer).
|
|
190
|
+
* Note: Points with icons use coffin corners instead of highlight layer.
|
|
178
191
|
*/
|
|
179
192
|
private renderHighlightLayer;
|
|
180
193
|
/**
|
|
181
|
-
* Render
|
|
182
|
-
*
|
|
194
|
+
* Render selection overlay layer for polygon shapes.
|
|
195
|
+
* Mirrors renderHoverLayer but triggers on selectedShapeId instead of hover.
|
|
196
|
+
* When a shape is both selected and hovered, both layers stack for a brighter combined effect.
|
|
183
197
|
*/
|
|
184
|
-
private
|
|
198
|
+
private renderSelectLayer;
|
|
185
199
|
/**
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
*
|
|
200
|
+
* Render hover layer for all polygon shapes (2D and 3D).
|
|
201
|
+
* Overlays the shape's base fill with brighter material lighting.
|
|
202
|
+
* Stacks with other interaction layers (e.g. selection highlight underneath).
|
|
189
203
|
*/
|
|
190
|
-
private
|
|
204
|
+
private renderHoverLayer;
|
|
205
|
+
/**
|
|
206
|
+
* Render coffin corners layer for Point geometries that have icons on hover/select
|
|
207
|
+
* Coffin corners provide visual feedback for points instead of select layer
|
|
208
|
+
*/
|
|
209
|
+
private renderCoffinCornersLayer;
|
|
191
210
|
/**
|
|
192
211
|
* Render main shapes layer
|
|
193
212
|
*/
|
|
@@ -200,6 +219,26 @@ declare class DisplayShapeLayer extends CompositeLayer<DisplayShapeLayerProps> {
|
|
|
200
219
|
* - 'never': No labels
|
|
201
220
|
*/
|
|
202
221
|
private renderLabelsLayer;
|
|
222
|
+
/**
|
|
223
|
+
* Render vertical elevation indicator lines for non-polygon shapes.
|
|
224
|
+
* Creates vertical "strut" lines from ground level to elevated features.
|
|
225
|
+
* For LineStrings, creates a "curtain" effect with vertical lines at each coordinate.
|
|
226
|
+
* Polygons use wireframe extrusion instead.
|
|
227
|
+
*/
|
|
228
|
+
private renderElevationIndicatorLayer;
|
|
229
|
+
/**
|
|
230
|
+
* Create a single curtain GeoJsonLayer with shared configuration.
|
|
231
|
+
*/
|
|
232
|
+
private createCurtainGeoJsonLayer;
|
|
233
|
+
/**
|
|
234
|
+
* Render curtain layers for elevated LineStrings.
|
|
235
|
+
* Creates three separate layers for main, hovered, and selected states.
|
|
236
|
+
*/
|
|
237
|
+
private renderCurtainLayers;
|
|
238
|
+
/**
|
|
239
|
+
* Render elevation visualization layers (curtains for lines, wireframes for polygons).
|
|
240
|
+
*/
|
|
241
|
+
private renderElevationVisualizationLayer;
|
|
203
242
|
/**
|
|
204
243
|
* Render all sublayers
|
|
205
244
|
*/
|