@accelint/map-toolkit 1.1.0 → 1.3.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 +17 -0
- package/catalog-info.yaml +3 -3
- package/dist/camera/events.d.ts +45 -0
- package/dist/camera/events.js +45 -0
- package/dist/camera/events.js.map +1 -1
- package/dist/camera/store.d.ts +47 -0
- package/dist/camera/store.js +81 -0
- package/dist/camera/store.js.map +1 -1
- package/dist/camera/types.d.ts +81 -0
- package/dist/cursor-coordinates/constants.d.ts +8 -0
- package/dist/cursor-coordinates/constants.js +22 -0
- package/dist/cursor-coordinates/constants.js.map +1 -0
- package/dist/cursor-coordinates/store.d.ts +1 -0
- package/dist/cursor-coordinates/store.js +1 -0
- package/dist/cursor-coordinates/store.js.map +1 -1
- package/dist/cursor-coordinates/use-cursor-coordinates.d.ts +5 -0
- package/dist/cursor-coordinates/use-cursor-coordinates.js +21 -6
- package/dist/cursor-coordinates/use-cursor-coordinates.js.map +1 -1
- package/dist/deckgl/base-map/constants.d.ts +12 -0
- package/dist/deckgl/base-map/constants.js +12 -0
- package/dist/deckgl/base-map/constants.js.map +1 -1
- package/dist/deckgl/base-map/controls.d.ts +10 -0
- package/dist/deckgl/base-map/controls.js +5 -0
- package/dist/deckgl/base-map/controls.js.map +1 -1
- package/dist/deckgl/base-map/events.d.ts +30 -0
- package/dist/deckgl/base-map/events.js +30 -0
- package/dist/deckgl/base-map/events.js.map +1 -1
- package/dist/deckgl/base-map/index.d.ts +2 -2
- package/dist/deckgl/base-map/index.js +30 -0
- package/dist/deckgl/base-map/index.js.map +1 -1
- package/dist/deckgl/saved-viewports/index.d.ts +75 -0
- package/dist/deckgl/saved-viewports/index.js +58 -0
- package/dist/deckgl/saved-viewports/index.js.map +1 -1
- package/dist/deckgl/saved-viewports/storage.d.ts +51 -0
- package/dist/deckgl/saved-viewports/storage.js +64 -0
- package/dist/deckgl/saved-viewports/storage.js.map +1 -1
- package/dist/deckgl/shapes/display-shape-layer/constants.js +18 -6
- package/dist/deckgl/shapes/display-shape-layer/constants.js.map +1 -1
- package/dist/deckgl/shapes/display-shape-layer/fiber.d.ts +7 -0
- package/dist/deckgl/shapes/display-shape-layer/fiber.js.map +1 -1
- package/dist/deckgl/shapes/display-shape-layer/utils/display-style.js +61 -4
- package/dist/deckgl/shapes/display-shape-layer/utils/display-style.js.map +1 -1
- package/dist/deckgl/shapes/display-shape-layer/utils/labels.d.ts +22 -8
- package/dist/deckgl/shapes/display-shape-layer/utils/labels.js +75 -4
- package/dist/deckgl/shapes/display-shape-layer/utils/labels.js.map +1 -1
- package/dist/deckgl/shapes/draw-shape-layer/constants.js +30 -0
- package/dist/deckgl/shapes/draw-shape-layer/constants.js.map +1 -1
- package/dist/deckgl/shapes/draw-shape-layer/fiber.js +36 -0
- package/dist/deckgl/shapes/draw-shape-layer/fiber.js.map +1 -1
- package/dist/deckgl/shapes/draw-shape-layer/modes/draw-circle-mode-with-tooltip.js +32 -1
- 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 +37 -8
- package/dist/deckgl/shapes/draw-shape-layer/modes/draw-ellipse-mode-with-tooltip.js.map +1 -1
- package/dist/deckgl/shapes/draw-shape-layer/modes/draw-line-string-mode-with-tooltip.js +43 -1
- 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 +44 -1
- 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 +46 -3
- 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 +37 -1
- package/dist/deckgl/shapes/draw-shape-layer/modes/index.js.map +1 -1
- package/dist/deckgl/shapes/draw-shape-layer/store.js +50 -2
- package/dist/deckgl/shapes/draw-shape-layer/store.js.map +1 -1
- package/dist/deckgl/shapes/draw-shape-layer/utils/feature-conversion.js +137 -16
- package/dist/deckgl/shapes/draw-shape-layer/utils/feature-conversion.js.map +1 -1
- package/dist/deckgl/shapes/edit-shape-layer/events.js +1 -1
- package/dist/deckgl/shapes/edit-shape-layer/events.js.map +1 -1
- package/dist/deckgl/shapes/edit-shape-layer/index.d.ts +2 -2
- package/dist/deckgl/shapes/edit-shape-layer/index.js +14 -0
- package/dist/deckgl/shapes/edit-shape-layer/index.js.map +1 -1
- package/dist/deckgl/shapes/edit-shape-layer/modes/base-transform-mode.js +56 -8
- 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 +26 -4
- 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 +28 -3
- 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 +24 -0
- package/dist/deckgl/shapes/edit-shape-layer/modes/index.js.map +1 -1
- package/dist/deckgl/shapes/edit-shape-layer/modes/rotate-mode-with-snap.js +33 -4
- 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 +21 -2
- 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 +35 -11
- package/dist/deckgl/shapes/edit-shape-layer/modes/vertex-transform-mode.js.map +1 -1
- package/dist/deckgl/shapes/edit-shape-layer/store.js +1 -1
- package/dist/deckgl/shapes/edit-shape-layer/store.js.map +1 -1
- package/dist/deckgl/shapes/shared/hooks/use-shift-zoom-disable.js +12 -0
- package/dist/deckgl/shapes/shared/hooks/use-shift-zoom-disable.js.map +1 -1
- package/dist/deckgl/shapes/shared/types.d.ts +3 -3
- package/dist/deckgl/shapes/shared/types.js +2 -2
- package/dist/deckgl/shapes/shared/types.js.map +1 -1
- package/dist/deckgl/shapes/shared/utils/geometry-measurements.js +3 -3
- package/dist/deckgl/shapes/shared/utils/geometry-measurements.js.map +1 -1
- package/dist/deckgl/shapes/shared/utils/pick-filtering.js +1 -1
- package/dist/deckgl/shapes/shared/utils/pick-filtering.js.map +1 -1
- package/dist/deckgl/symbol-layer/fiber.d.ts +18 -0
- package/dist/deckgl/symbol-layer/fiber.js.map +1 -1
- package/dist/deckgl/symbol-layer/index.d.ts +79 -1
- package/dist/deckgl/symbol-layer/index.js +72 -1
- package/dist/deckgl/symbol-layer/index.js.map +1 -1
- package/dist/deckgl/text-layer/character-sets.d.ts +30 -0
- package/dist/deckgl/text-layer/character-sets.js +26 -0
- package/dist/deckgl/text-layer/character-sets.js.map +1 -1
- package/dist/deckgl/text-layer/default-settings.d.ts +29 -0
- package/dist/deckgl/text-layer/default-settings.js +28 -0
- package/dist/deckgl/text-layer/default-settings.js.map +1 -1
- package/dist/deckgl/text-layer/index.d.ts +65 -0
- package/dist/deckgl/text-layer/index.js +56 -0
- package/dist/deckgl/text-layer/index.js.map +1 -1
- package/dist/map-cursor/events.d.ts +19 -0
- package/dist/map-cursor/events.js +19 -0
- package/dist/map-cursor/events.js.map +1 -1
- package/dist/map-cursor/store.d.ts +34 -2
- package/dist/map-cursor/store.js +44 -3
- package/dist/map-cursor/store.js.map +1 -1
- package/dist/map-mode/store.d.ts +43 -4
- package/dist/map-mode/store.js +55 -5
- package/dist/map-mode/store.js.map +1 -1
- package/dist/shared/create-map-store.d.ts +14 -0
- package/dist/shared/create-map-store.js +26 -2
- package/dist/shared/create-map-store.js.map +1 -1
- package/dist/shared/units.d.ts +24 -0
- package/dist/shared/units.js +24 -0
- package/dist/shared/units.js.map +1 -1
- package/dist/viewport/store.d.ts +1 -0
- package/dist/viewport/store.js +4 -0
- package/dist/viewport/store.js.map +1 -1
- package/package.json +7 -7
|
@@ -15,6 +15,9 @@ import { IconLayer, IconLayerProps } from "@deck.gl/layers";
|
|
|
15
15
|
import { SymbolOptions } from "milsymbol";
|
|
16
16
|
|
|
17
17
|
//#region src/deckgl/symbol-layer/index.d.ts
|
|
18
|
+
/**
|
|
19
|
+
* Internal props specific to SymbolLayer.
|
|
20
|
+
*/
|
|
18
21
|
type _SymbolLayerProps<TData = unknown> = {
|
|
19
22
|
/**
|
|
20
23
|
* An accessor function that returns the SIDC for a given data point.
|
|
@@ -29,9 +32,84 @@ type _SymbolLayerProps<TData = unknown> = {
|
|
|
29
32
|
*/
|
|
30
33
|
defaultSymbolOptions?: SymbolOptions;
|
|
31
34
|
};
|
|
35
|
+
/**
|
|
36
|
+
* Props for SymbolLayer component.
|
|
37
|
+
* Extends IconLayer props with MIL-STD-2525 symbol rendering support.
|
|
38
|
+
*/
|
|
32
39
|
type SymbolLayerProps<TData = unknown> = _SymbolLayerProps<TData> & Omit<IconLayerProps<TData>, 'getIcon' | 'getColor' | 'iconAtlas' | 'iconMapping'>;
|
|
33
40
|
/**
|
|
34
|
-
*
|
|
41
|
+
* A Deck.gl layer for rendering MIL-STD-2525 and APP-6 military symbols.
|
|
42
|
+
*
|
|
43
|
+
* This layer extends IconLayer and automatically generates symbol icons from SIDC codes.
|
|
44
|
+
* It supports multiple symbology standards including MIL-STD-2525 B/C/D/E, STANAG APP6 B/D/E,
|
|
45
|
+
* and FM 1-02.2.
|
|
46
|
+
*
|
|
47
|
+
* Features:
|
|
48
|
+
* - Automatic symbol generation from SIDC codes
|
|
49
|
+
* - Caching for performance optimization
|
|
50
|
+
* - Customizable symbol options per data point
|
|
51
|
+
* - Dark/Light color modes
|
|
52
|
+
*
|
|
53
|
+
* Can be used directly with Deck.gl or as a JSX element with React Fiber:
|
|
54
|
+
* - React Fiber: `<symbolLayer id="symbols" data={[...]} ... />`
|
|
55
|
+
* - Direct: `new SymbolLayer({ id: 'symbols', data: [...], ... })`
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* Direct Deck.gl usage:
|
|
59
|
+
* ```typescript
|
|
60
|
+
* import { Deck } from '@deck.gl/core';
|
|
61
|
+
* import { SymbolLayer } from '@accelint/map-toolkit/deckgl/symbol-layer';
|
|
62
|
+
*
|
|
63
|
+
* const layer = new SymbolLayer({
|
|
64
|
+
* id: 'military-symbols',
|
|
65
|
+
* data: [
|
|
66
|
+
* { position: [-122.4, 37.74], sidc: 'SFG-UCI----D', name: 'Unit 1' },
|
|
67
|
+
* { position: [-118.2, 34.05], sidc: 'SFG-UCIZ---D', name: 'Unit 2' },
|
|
68
|
+
* ],
|
|
69
|
+
* getSidc: d => d.sidc,
|
|
70
|
+
* getPosition: d => d.position,
|
|
71
|
+
* getSize: 32,
|
|
72
|
+
* defaultSymbolOptions: {
|
|
73
|
+
* colorMode: 'Dark',
|
|
74
|
+
* size: 100,
|
|
75
|
+
* },
|
|
76
|
+
* });
|
|
77
|
+
*
|
|
78
|
+
* new Deck({
|
|
79
|
+
* initialViewState: { longitude: -120, latitude: 36, zoom: 6 },
|
|
80
|
+
* controller: true,
|
|
81
|
+
* layers: [layer],
|
|
82
|
+
* });
|
|
83
|
+
* ```
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* React Fiber usage:
|
|
87
|
+
* ```tsx
|
|
88
|
+
* import '@accelint/map-toolkit/deckgl/symbol-layer/fiber';
|
|
89
|
+
* import { BaseMap } from '@accelint/map-toolkit/deckgl';
|
|
90
|
+
* import { View } from '@deckgl-fiber-renderer/dom';
|
|
91
|
+
*
|
|
92
|
+
* function MilitaryMap() {
|
|
93
|
+
* const units = [
|
|
94
|
+
* { position: [-122.4, 37.74], sidc: 'SFG-UCI----D', name: 'Unit 1' },
|
|
95
|
+
* { position: [-118.2, 34.05], sidc: 'SFG-UCIZ---D', name: 'Unit 2' },
|
|
96
|
+
* ];
|
|
97
|
+
*
|
|
98
|
+
* return (
|
|
99
|
+
* <BaseMap id="map" className="w-full h-full">
|
|
100
|
+
* <View id="main" controller />
|
|
101
|
+
* <symbolLayer
|
|
102
|
+
* id="military-units"
|
|
103
|
+
* data={units}
|
|
104
|
+
* getSidc={d => d.sidc}
|
|
105
|
+
* getPosition={d => d.position}
|
|
106
|
+
* getSize={32}
|
|
107
|
+
* defaultSymbolOptions={{ colorMode: 'Dark' }}
|
|
108
|
+
* />
|
|
109
|
+
* </BaseMap>
|
|
110
|
+
* );
|
|
111
|
+
* }
|
|
112
|
+
* ```
|
|
35
113
|
*/
|
|
36
114
|
declare class SymbolLayer<TData = unknown, TExtraProps extends {} = {}> extends IconLayer<TData, TExtraProps & Required<_SymbolLayerProps<TData>>> {
|
|
37
115
|
static defaultProps: DefaultProps<SymbolLayerProps<unknown>>;
|
|
@@ -35,7 +35,78 @@ const defaultProps = {
|
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
/**
|
|
38
|
-
*
|
|
38
|
+
* A Deck.gl layer for rendering MIL-STD-2525 and APP-6 military symbols.
|
|
39
|
+
*
|
|
40
|
+
* This layer extends IconLayer and automatically generates symbol icons from SIDC codes.
|
|
41
|
+
* It supports multiple symbology standards including MIL-STD-2525 B/C/D/E, STANAG APP6 B/D/E,
|
|
42
|
+
* and FM 1-02.2.
|
|
43
|
+
*
|
|
44
|
+
* Features:
|
|
45
|
+
* - Automatic symbol generation from SIDC codes
|
|
46
|
+
* - Caching for performance optimization
|
|
47
|
+
* - Customizable symbol options per data point
|
|
48
|
+
* - Dark/Light color modes
|
|
49
|
+
*
|
|
50
|
+
* Can be used directly with Deck.gl or as a JSX element with React Fiber:
|
|
51
|
+
* - React Fiber: `<symbolLayer id="symbols" data={[...]} ... />`
|
|
52
|
+
* - Direct: `new SymbolLayer({ id: 'symbols', data: [...], ... })`
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* Direct Deck.gl usage:
|
|
56
|
+
* ```typescript
|
|
57
|
+
* import { Deck } from '@deck.gl/core';
|
|
58
|
+
* import { SymbolLayer } from '@accelint/map-toolkit/deckgl/symbol-layer';
|
|
59
|
+
*
|
|
60
|
+
* const layer = new SymbolLayer({
|
|
61
|
+
* id: 'military-symbols',
|
|
62
|
+
* data: [
|
|
63
|
+
* { position: [-122.4, 37.74], sidc: 'SFG-UCI----D', name: 'Unit 1' },
|
|
64
|
+
* { position: [-118.2, 34.05], sidc: 'SFG-UCIZ---D', name: 'Unit 2' },
|
|
65
|
+
* ],
|
|
66
|
+
* getSidc: d => d.sidc,
|
|
67
|
+
* getPosition: d => d.position,
|
|
68
|
+
* getSize: 32,
|
|
69
|
+
* defaultSymbolOptions: {
|
|
70
|
+
* colorMode: 'Dark',
|
|
71
|
+
* size: 100,
|
|
72
|
+
* },
|
|
73
|
+
* });
|
|
74
|
+
*
|
|
75
|
+
* new Deck({
|
|
76
|
+
* initialViewState: { longitude: -120, latitude: 36, zoom: 6 },
|
|
77
|
+
* controller: true,
|
|
78
|
+
* layers: [layer],
|
|
79
|
+
* });
|
|
80
|
+
* ```
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* React Fiber usage:
|
|
84
|
+
* ```tsx
|
|
85
|
+
* import '@accelint/map-toolkit/deckgl/symbol-layer/fiber';
|
|
86
|
+
* import { BaseMap } from '@accelint/map-toolkit/deckgl';
|
|
87
|
+
* import { View } from '@deckgl-fiber-renderer/dom';
|
|
88
|
+
*
|
|
89
|
+
* function MilitaryMap() {
|
|
90
|
+
* const units = [
|
|
91
|
+
* { position: [-122.4, 37.74], sidc: 'SFG-UCI----D', name: 'Unit 1' },
|
|
92
|
+
* { position: [-118.2, 34.05], sidc: 'SFG-UCIZ---D', name: 'Unit 2' },
|
|
93
|
+
* ];
|
|
94
|
+
*
|
|
95
|
+
* return (
|
|
96
|
+
* <BaseMap id="map" className="w-full h-full">
|
|
97
|
+
* <View id="main" controller />
|
|
98
|
+
* <symbolLayer
|
|
99
|
+
* id="military-units"
|
|
100
|
+
* data={units}
|
|
101
|
+
* getSidc={d => d.sidc}
|
|
102
|
+
* getPosition={d => d.position}
|
|
103
|
+
* getSize={32}
|
|
104
|
+
* defaultSymbolOptions={{ colorMode: 'Dark' }}
|
|
105
|
+
* />
|
|
106
|
+
* </BaseMap>
|
|
107
|
+
* );
|
|
108
|
+
* }
|
|
109
|
+
* ```
|
|
39
110
|
*/
|
|
40
111
|
var SymbolLayer = class extends IconLayer {
|
|
41
112
|
static defaultProps = defaultProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["defaultProps: DefaultProps<SymbolLayerProps>"],"sources":["../../../src/deckgl/symbol-layer/index.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 { IconLayer, type IconLayerProps } from '@deck.gl/layers';\nimport ms, { type SymbolOptions } from 'milsymbol';\nimport type {\n AccessorContext,\n AccessorFunction,\n DefaultProps,\n} from '@deck.gl/core';\n\nconst MilSymbol = ms.Symbol;\n\ntype _SymbolLayerProps<TData = unknown> = {\n /**\n * An accessor function that returns the SIDC for a given data point.\n */\n getSidc?: AccessorFunction<TData, string | number | bigint>;\n /**\n * An accessor function that returns symbol options for a given data point.\n */\n getSymbolOptions?: AccessorFunction<TData, SymbolOptions | null>;\n /**\n * Default symbol options to use when rendering symbols.\n */\n defaultSymbolOptions?: SymbolOptions;\n};\n\nexport type SymbolLayerProps<TData = unknown> = _SymbolLayerProps<TData> &\n Omit<\n IconLayerProps<TData>,\n 'getIcon' | 'getColor' | 'iconAtlas' | 'iconMapping'\n >;\n\nconst defaultProps: DefaultProps<SymbolLayerProps> = {\n // biome-ignore lint/suspicious/noExplicitAny: We don't know what the data type is.\n getSidc: { type: 'accessor', value: (x: any) => x.sidc },\n getSymbolOptions: { type: 'accessor', value: () => null },\n getSize: { type: 'accessor', value: 32 },\n defaultSymbolOptions: { type: 'object', value: {} },\n};\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"index.js","names":["defaultProps: DefaultProps<SymbolLayerProps>"],"sources":["../../../src/deckgl/symbol-layer/index.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 { IconLayer, type IconLayerProps } from '@deck.gl/layers';\nimport ms, { type SymbolOptions } from 'milsymbol';\nimport type {\n AccessorContext,\n AccessorFunction,\n DefaultProps,\n} from '@deck.gl/core';\n\nconst MilSymbol = ms.Symbol;\n\n/**\n * Internal props specific to SymbolLayer.\n */\ntype _SymbolLayerProps<TData = unknown> = {\n /**\n * An accessor function that returns the SIDC for a given data point.\n */\n getSidc?: AccessorFunction<TData, string | number | bigint>;\n /**\n * An accessor function that returns symbol options for a given data point.\n */\n getSymbolOptions?: AccessorFunction<TData, SymbolOptions | null>;\n /**\n * Default symbol options to use when rendering symbols.\n */\n defaultSymbolOptions?: SymbolOptions;\n};\n\n/**\n * Props for SymbolLayer component.\n * Extends IconLayer props with MIL-STD-2525 symbol rendering support.\n */\nexport type SymbolLayerProps<TData = unknown> = _SymbolLayerProps<TData> &\n Omit<\n IconLayerProps<TData>,\n 'getIcon' | 'getColor' | 'iconAtlas' | 'iconMapping'\n >;\n\nconst defaultProps: DefaultProps<SymbolLayerProps> = {\n // biome-ignore lint/suspicious/noExplicitAny: We don't know what the data type is.\n getSidc: { type: 'accessor', value: (x: any) => x.sidc },\n getSymbolOptions: { type: 'accessor', value: () => null },\n getSize: { type: 'accessor', value: 32 },\n defaultSymbolOptions: { type: 'object', value: {} },\n};\n\n/**\n * A Deck.gl layer for rendering MIL-STD-2525 and APP-6 military symbols.\n *\n * This layer extends IconLayer and automatically generates symbol icons from SIDC codes.\n * It supports multiple symbology standards including MIL-STD-2525 B/C/D/E, STANAG APP6 B/D/E,\n * and FM 1-02.2.\n *\n * Features:\n * - Automatic symbol generation from SIDC codes\n * - Caching for performance optimization\n * - Customizable symbol options per data point\n * - Dark/Light color modes\n *\n * Can be used directly with Deck.gl or as a JSX element with React Fiber:\n * - React Fiber: `<symbolLayer id=\"symbols\" data={[...]} ... />`\n * - Direct: `new SymbolLayer({ id: 'symbols', data: [...], ... })`\n *\n * @example\n * Direct Deck.gl usage:\n * ```typescript\n * import { Deck } from '@deck.gl/core';\n * import { SymbolLayer } from '@accelint/map-toolkit/deckgl/symbol-layer';\n *\n * const layer = new SymbolLayer({\n * id: 'military-symbols',\n * data: [\n * { position: [-122.4, 37.74], sidc: 'SFG-UCI----D', name: 'Unit 1' },\n * { position: [-118.2, 34.05], sidc: 'SFG-UCIZ---D', name: 'Unit 2' },\n * ],\n * getSidc: d => d.sidc,\n * getPosition: d => d.position,\n * getSize: 32,\n * defaultSymbolOptions: {\n * colorMode: 'Dark',\n * size: 100,\n * },\n * });\n *\n * new Deck({\n * initialViewState: { longitude: -120, latitude: 36, zoom: 6 },\n * controller: true,\n * layers: [layer],\n * });\n * ```\n *\n * @example\n * React Fiber usage:\n * ```tsx\n * import '@accelint/map-toolkit/deckgl/symbol-layer/fiber';\n * import { BaseMap } from '@accelint/map-toolkit/deckgl';\n * import { View } from '@deckgl-fiber-renderer/dom';\n *\n * function MilitaryMap() {\n * const units = [\n * { position: [-122.4, 37.74], sidc: 'SFG-UCI----D', name: 'Unit 1' },\n * { position: [-118.2, 34.05], sidc: 'SFG-UCIZ---D', name: 'Unit 2' },\n * ];\n *\n * return (\n * <BaseMap id=\"map\" className=\"w-full h-full\">\n * <View id=\"main\" controller />\n * <symbolLayer\n * id=\"military-units\"\n * data={units}\n * getSidc={d => d.sidc}\n * getPosition={d => d.position}\n * getSize={32}\n * defaultSymbolOptions={{ colorMode: 'Dark' }}\n * />\n * </BaseMap>\n * );\n * }\n * ```\n */\nexport class SymbolLayer<\n TData = unknown,\n // biome-ignore lint/complexity/noBannedTypes: Follows DeckGL format.\n TExtraProps extends {} = {},\n> extends IconLayer<TData, TExtraProps & Required<_SymbolLayerProps<TData>>> {\n static override defaultProps = defaultProps;\n static override layerName = 'SymbolLayer';\n\n /**\n * The default symbol options to use when rendering symbols.\n *\n * @internal\n */\n protected defaultOptions: SymbolOptions;\n\n /**\n * Caches the results of the icon generation\n *\n * @internal\n * @todo Use LRU cache to limit memory usage.\n */\n protected generationCache = new Map<string, string>();\n\n constructor(...args: Partial<SymbolLayerProps<TData>>[]) {\n // Props are frozen after the construction\n const customGetIcons = {\n getIcon: (data: TData, info: AccessorContext<TData>) =>\n this.generateIcon(data, info),\n } as IconLayerProps<TData>;\n\n // biome-ignore lint/suspicious/noExplicitAny: Needed to retype the layer.\n super(...(args as any), customGetIcons as any);\n\n // Default options need to be set in the constructor.\n this.defaultOptions = {\n size: 100,\n colorMode: 'Dark',\n ...this.props.defaultSymbolOptions,\n };\n }\n\n /**\n * Generates an icon using the provided SIDC and symbol options.\n *\n * @param data A point's data\n * @param info Contextual information about the point\n * @returns DeckGL Icon Object\n */\n protected generateIcon = (data: TData, info: AccessorContext<TData>) => {\n const { getSidc, getSymbolOptions } = this.props;\n const sidc = getSidc(data, info).toString();\n\n let currentSymbolOptions = this.defaultOptions;\n\n const localOptions = getSymbolOptions(data, info);\n\n if (localOptions) {\n currentSymbolOptions = {\n ...currentSymbolOptions,\n ...localOptions,\n };\n }\n\n const size = currentSymbolOptions.size as number;\n\n const cacheKey = this.generateCacheKey(sidc, currentSymbolOptions);\n\n if (this.generationCache.has(cacheKey)) {\n const cachedUrl = this.generationCache.get(cacheKey) as string;\n\n return {\n id: cacheKey,\n url: cachedUrl,\n height: size,\n width: size,\n };\n }\n\n const dataUrl = new MilSymbol(sidc, currentSymbolOptions).toDataURL();\n\n this.generationCache.set(cacheKey, dataUrl);\n\n const returnData = {\n id: cacheKey,\n url: dataUrl,\n height: size,\n width: size,\n };\n\n return returnData;\n };\n\n /**\n * Generates a cache key for the given SIDC and symbol options.\n *\n * @param sidc SIDC of the symbol\n * @param options Options used to generate the symbol\n * @returns String key for caching\n */\n protected generateCacheKey(sidc: string, options: SymbolOptions) {\n return `${sidc}-${JSON.stringify(options)}`;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAoBA,MAAM,YAAY,GAAG;AA8BrB,MAAMA,eAA+C;CAEnD,SAAS;EAAE,MAAM;EAAY,QAAQ,MAAW,EAAE;EAAM;CACxD,kBAAkB;EAAE,MAAM;EAAY,aAAa;EAAM;CACzD,SAAS;EAAE,MAAM;EAAY,OAAO;EAAI;CACxC,sBAAsB;EAAE,MAAM;EAAU,OAAO,EAAE;EAAE;CACpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4ED,IAAa,cAAb,cAIU,UAAmE;CAC3E,OAAgB,eAAe;CAC/B,OAAgB,YAAY;;;;;;CAO5B,AAAU;;;;;;;CAQV,AAAU,kCAAkB,IAAI,KAAqB;CAErD,YAAY,GAAG,MAA0C;EAEvD,MAAM,iBAAiB,EACrB,UAAU,MAAa,SACrB,KAAK,aAAa,MAAM,KAAK,EAChC;AAGD,QAAM,GAAI,MAAc,eAAsB;AAG9C,OAAK,iBAAiB;GACpB,MAAM;GACN,WAAW;GACX,GAAG,KAAK,MAAM;GACf;;;;;;;;;CAUH,AAAU,gBAAgB,MAAa,SAAiC;EACtE,MAAM,EAAE,SAAS,qBAAqB,KAAK;EAC3C,MAAM,OAAO,QAAQ,MAAM,KAAK,CAAC,UAAU;EAE3C,IAAI,uBAAuB,KAAK;EAEhC,MAAM,eAAe,iBAAiB,MAAM,KAAK;AAEjD,MAAI,aACF,wBAAuB;GACrB,GAAG;GACH,GAAG;GACJ;EAGH,MAAM,OAAO,qBAAqB;EAElC,MAAM,WAAW,KAAK,iBAAiB,MAAM,qBAAqB;AAElE,MAAI,KAAK,gBAAgB,IAAI,SAAS,CAGpC,QAAO;GACL,IAAI;GACJ,KAJgB,KAAK,gBAAgB,IAAI,SAAS;GAKlD,QAAQ;GACR,OAAO;GACR;EAGH,MAAM,UAAU,IAAI,UAAU,MAAM,qBAAqB,CAAC,WAAW;AAErE,OAAK,gBAAgB,IAAI,UAAU,QAAQ;AAS3C,SAPmB;GACjB,IAAI;GACJ,KAAK;GACL,QAAQ;GACR,OAAO;GACR;;;;;;;;;CAYH,AAAU,iBAAiB,MAAc,SAAwB;AAC/D,SAAO,GAAG,KAAK,GAAG,KAAK,UAAU,QAAQ"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
//#region src/deckgl/text-layer/character-sets.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Valid keys for predefined character sets.
|
|
4
|
+
* Used for type-safe character set selection.
|
|
5
|
+
*/
|
|
2
6
|
type CharacterSetsKeys = keyof typeof CHARACTER_SETS;
|
|
3
7
|
/**
|
|
4
8
|
* Predefined character sets for TextLayer.
|
|
@@ -6,6 +10,32 @@ type CharacterSetsKeys = keyof typeof CHARACTER_SETS;
|
|
|
6
10
|
* Use smaller character sets (ASCII_ALL, ASCII_ALPHA_NUMERIC) for better performance,
|
|
7
11
|
* or use AUTO for dynamic optimization based on content.
|
|
8
12
|
* EXPANDED includes ASCII and Latin characters with diacritics for international text.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* import { TextLayer, CHARACTER_SETS } from '@accelint/map-toolkit/deckgl/text-layer';
|
|
17
|
+
*
|
|
18
|
+
* // Use ASCII-only for better performance
|
|
19
|
+
* const asciiLayer = new TextLayer({
|
|
20
|
+
* id: 'ascii-text',
|
|
21
|
+
* data: [...],
|
|
22
|
+
* characterSet: CHARACTER_SETS.ASCII_ALL,
|
|
23
|
+
* });
|
|
24
|
+
*
|
|
25
|
+
* // Use EXPANDED for international text with diacritics
|
|
26
|
+
* const internationalLayer = new TextLayer({
|
|
27
|
+
* id: 'international-text',
|
|
28
|
+
* data: [...],
|
|
29
|
+
* characterSet: CHARACTER_SETS.EXPANDED,
|
|
30
|
+
* });
|
|
31
|
+
*
|
|
32
|
+
* // Use AUTO for dynamic optimization
|
|
33
|
+
* const autoLayer = new TextLayer({
|
|
34
|
+
* id: 'auto-text',
|
|
35
|
+
* data: [...],
|
|
36
|
+
* characterSet: CHARACTER_SETS.AUTO,
|
|
37
|
+
* });
|
|
38
|
+
* ```
|
|
9
39
|
*/
|
|
10
40
|
declare const CHARACTER_SETS: Readonly<{
|
|
11
41
|
readonly ALL_NUMBERS: "1234567890";
|
|
@@ -33,6 +33,32 @@ const EXPANDED = `${ASCII_ALL}${LATIN_ALL}`;
|
|
|
33
33
|
* Use smaller character sets (ASCII_ALL, ASCII_ALPHA_NUMERIC) for better performance,
|
|
34
34
|
* or use AUTO for dynamic optimization based on content.
|
|
35
35
|
* EXPANDED includes ASCII and Latin characters with diacritics for international text.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```typescript
|
|
39
|
+
* import { TextLayer, CHARACTER_SETS } from '@accelint/map-toolkit/deckgl/text-layer';
|
|
40
|
+
*
|
|
41
|
+
* // Use ASCII-only for better performance
|
|
42
|
+
* const asciiLayer = new TextLayer({
|
|
43
|
+
* id: 'ascii-text',
|
|
44
|
+
* data: [...],
|
|
45
|
+
* characterSet: CHARACTER_SETS.ASCII_ALL,
|
|
46
|
+
* });
|
|
47
|
+
*
|
|
48
|
+
* // Use EXPANDED for international text with diacritics
|
|
49
|
+
* const internationalLayer = new TextLayer({
|
|
50
|
+
* id: 'international-text',
|
|
51
|
+
* data: [...],
|
|
52
|
+
* characterSet: CHARACTER_SETS.EXPANDED,
|
|
53
|
+
* });
|
|
54
|
+
*
|
|
55
|
+
* // Use AUTO for dynamic optimization
|
|
56
|
+
* const autoLayer = new TextLayer({
|
|
57
|
+
* id: 'auto-text',
|
|
58
|
+
* data: [...],
|
|
59
|
+
* characterSet: CHARACTER_SETS.AUTO,
|
|
60
|
+
* });
|
|
61
|
+
* ```
|
|
36
62
|
*/
|
|
37
63
|
const CHARACTER_SETS = Object.freeze({
|
|
38
64
|
ALL_NUMBERS,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"character-sets.js","names":[],"sources":["../../../src/deckgl/text-layer/character-sets.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\nconst ALL_NUMBERS = '1234567890';\n\nconst ASCII_LETTERS_LOWERCASE = 'abcdefghijklmnopqrstuvwxyz';\nconst ASCII_LETTERS_UPPERCASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\nconst ASCII_SYMBOLS = ' !\"#$%&\\'()*+,-./:;<=>?@[]^_`{|}~';\n\nconst ASCII_LETTERS = `${ASCII_LETTERS_LOWERCASE}${ASCII_LETTERS_UPPERCASE}`;\nconst ASCII_ALPHA_NUMERIC = `${ASCII_LETTERS}${ALL_NUMBERS}`;\nconst ASCII_ALL = `${ASCII_LETTERS}${ALL_NUMBERS}${ASCII_SYMBOLS}`;\n\nconst AUTO = 'auto';\n\nconst LATIN_LETTERS_LOWERCASE = 'àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿß';\nconst LATIN_LETTERS_UPPERCASE = 'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ';\nconst LATIN_SYMBOLS = ' ¡¿¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿×÷';\n\nconst LATIN_LETTERS = `${LATIN_LETTERS_LOWERCASE}${LATIN_LETTERS_UPPERCASE}`;\nconst LATIN_ALPHA_NUMERIC = `${LATIN_LETTERS}${ALL_NUMBERS}`;\nconst LATIN_ALL = `${LATIN_LETTERS}${ALL_NUMBERS}${LATIN_SYMBOLS}`;\n\nconst EXPANDED = `${ASCII_ALL}${LATIN_ALL}`;\n\nexport type CharacterSetsKeys = keyof typeof CHARACTER_SETS;\n\n/**\n * Predefined character sets for TextLayer.\n *\n * Use smaller character sets (ASCII_ALL, ASCII_ALPHA_NUMERIC) for better performance,\n * or use AUTO for dynamic optimization based on content.\n * EXPANDED includes ASCII and Latin characters with diacritics for international text.\n */\nexport const CHARACTER_SETS = Object.freeze({\n ALL_NUMBERS,\n\n ASCII_ALL,\n ASCII_ALPHA_NUMERIC,\n ASCII_LETTERS,\n ASCII_LETTERS_LOWERCASE,\n ASCII_LETTERS_UPPERCASE,\n ASCII_SYMBOLS,\n\n AUTO,\n EXPANDED,\n\n LATIN_ALL,\n LATIN_ALPHA_NUMERIC,\n LATIN_LETTERS,\n LATIN_LETTERS_LOWERCASE,\n LATIN_LETTERS_UPPERCASE,\n LATIN_SYMBOLS,\n} as const);\n"],"mappings":";;;;;;;;;;;;;;AAYA,MAAM,cAAc;AAEpB,MAAM,0BAA0B;AAChC,MAAM,0BAA0B;AAChC,MAAM,gBAAgB;AAEtB,MAAM,gBAAgB,GAAG,0BAA0B;AACnD,MAAM,sBAAsB,GAAG,gBAAgB;AAC/C,MAAM,YAAY,GAAG,gBAAgB,cAAc;AAEnD,MAAM,OAAO;AAEb,MAAM,0BAA0B;AAChC,MAAM,0BAA0B;AAChC,MAAM,gBAAgB;AAEtB,MAAM,gBAAgB,GAAG,0BAA0B;AACnD,MAAM,sBAAsB,GAAG,gBAAgB;AAC/C,MAAM,YAAY,GAAG,gBAAgB,cAAc;AAEnD,MAAM,WAAW,GAAG,YAAY
|
|
1
|
+
{"version":3,"file":"character-sets.js","names":[],"sources":["../../../src/deckgl/text-layer/character-sets.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\nconst ALL_NUMBERS = '1234567890';\n\nconst ASCII_LETTERS_LOWERCASE = 'abcdefghijklmnopqrstuvwxyz';\nconst ASCII_LETTERS_UPPERCASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\nconst ASCII_SYMBOLS = ' !\"#$%&\\'()*+,-./:;<=>?@[]^_`{|}~';\n\nconst ASCII_LETTERS = `${ASCII_LETTERS_LOWERCASE}${ASCII_LETTERS_UPPERCASE}`;\nconst ASCII_ALPHA_NUMERIC = `${ASCII_LETTERS}${ALL_NUMBERS}`;\nconst ASCII_ALL = `${ASCII_LETTERS}${ALL_NUMBERS}${ASCII_SYMBOLS}`;\n\nconst AUTO = 'auto';\n\nconst LATIN_LETTERS_LOWERCASE = 'àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿß';\nconst LATIN_LETTERS_UPPERCASE = 'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ';\nconst LATIN_SYMBOLS = ' ¡¿¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿×÷';\n\nconst LATIN_LETTERS = `${LATIN_LETTERS_LOWERCASE}${LATIN_LETTERS_UPPERCASE}`;\nconst LATIN_ALPHA_NUMERIC = `${LATIN_LETTERS}${ALL_NUMBERS}`;\nconst LATIN_ALL = `${LATIN_LETTERS}${ALL_NUMBERS}${LATIN_SYMBOLS}`;\n\nconst EXPANDED = `${ASCII_ALL}${LATIN_ALL}`;\n\n/**\n * Valid keys for predefined character sets.\n * Used for type-safe character set selection.\n */\nexport type CharacterSetsKeys = keyof typeof CHARACTER_SETS;\n\n/**\n * Predefined character sets for TextLayer.\n *\n * Use smaller character sets (ASCII_ALL, ASCII_ALPHA_NUMERIC) for better performance,\n * or use AUTO for dynamic optimization based on content.\n * EXPANDED includes ASCII and Latin characters with diacritics for international text.\n *\n * @example\n * ```typescript\n * import { TextLayer, CHARACTER_SETS } from '@accelint/map-toolkit/deckgl/text-layer';\n *\n * // Use ASCII-only for better performance\n * const asciiLayer = new TextLayer({\n * id: 'ascii-text',\n * data: [...],\n * characterSet: CHARACTER_SETS.ASCII_ALL,\n * });\n *\n * // Use EXPANDED for international text with diacritics\n * const internationalLayer = new TextLayer({\n * id: 'international-text',\n * data: [...],\n * characterSet: CHARACTER_SETS.EXPANDED,\n * });\n *\n * // Use AUTO for dynamic optimization\n * const autoLayer = new TextLayer({\n * id: 'auto-text',\n * data: [...],\n * characterSet: CHARACTER_SETS.AUTO,\n * });\n * ```\n */\nexport const CHARACTER_SETS = Object.freeze({\n ALL_NUMBERS,\n\n ASCII_ALL,\n ASCII_ALPHA_NUMERIC,\n ASCII_LETTERS,\n ASCII_LETTERS_LOWERCASE,\n ASCII_LETTERS_UPPERCASE,\n ASCII_SYMBOLS,\n\n AUTO,\n EXPANDED,\n\n LATIN_ALL,\n LATIN_ALPHA_NUMERIC,\n LATIN_LETTERS,\n LATIN_LETTERS_LOWERCASE,\n LATIN_LETTERS_UPPERCASE,\n LATIN_SYMBOLS,\n} as const);\n"],"mappings":";;;;;;;;;;;;;;AAYA,MAAM,cAAc;AAEpB,MAAM,0BAA0B;AAChC,MAAM,0BAA0B;AAChC,MAAM,gBAAgB;AAEtB,MAAM,gBAAgB,GAAG,0BAA0B;AACnD,MAAM,sBAAsB,GAAG,gBAAgB;AAC/C,MAAM,YAAY,GAAG,gBAAgB,cAAc;AAEnD,MAAM,OAAO;AAEb,MAAM,0BAA0B;AAChC,MAAM,0BAA0B;AAChC,MAAM,gBAAgB;AAEtB,MAAM,gBAAgB,GAAG,0BAA0B;AACnD,MAAM,sBAAsB,GAAG,gBAAgB;AAC/C,MAAM,YAAY,GAAG,gBAAgB,cAAc;AAEnD,MAAM,WAAW,GAAG,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyChC,MAAa,iBAAiB,OAAO,OAAO;CAC1C;CAEA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CACD,CAAU"}
|
|
@@ -13,6 +13,35 @@
|
|
|
13
13
|
import { TextLayerProps } from "@deck.gl/layers";
|
|
14
14
|
|
|
15
15
|
//#region src/deckgl/text-layer/default-settings.d.ts
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Default settings for TextLayer with opinionated styling.
|
|
19
|
+
*
|
|
20
|
+
* Provides consistent text rendering with white text, black outline,
|
|
21
|
+
* centered alignment, and system font stack for optimal performance.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* import { TextLayer } from '@accelint/map-toolkit/deckgl/text-layer';
|
|
26
|
+
* import { defaultSettings } from '@accelint/map-toolkit/deckgl/text-layer/default-settings';
|
|
27
|
+
*
|
|
28
|
+
* // Use defaults as-is
|
|
29
|
+
* const layer = new TextLayer({
|
|
30
|
+
* id: 'text',
|
|
31
|
+
* data: [...],
|
|
32
|
+
* ...defaultSettings,
|
|
33
|
+
* });
|
|
34
|
+
*
|
|
35
|
+
* // Override specific defaults
|
|
36
|
+
* const customLayer = new TextLayer({
|
|
37
|
+
* id: 'text',
|
|
38
|
+
* data: [...],
|
|
39
|
+
* ...defaultSettings,
|
|
40
|
+
* fontFamily: 'Arial',
|
|
41
|
+
* getSize: 14,
|
|
42
|
+
* });
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
16
45
|
declare const defaultSettings: Partial<TextLayerProps>;
|
|
17
46
|
//#endregion
|
|
18
47
|
export { defaultSettings };
|
|
@@ -14,6 +14,34 @@
|
|
|
14
14
|
import { DEFAULT_TEXT_STYLE } from "../text-settings.js";
|
|
15
15
|
|
|
16
16
|
//#region src/deckgl/text-layer/default-settings.ts
|
|
17
|
+
/**
|
|
18
|
+
* Default settings for TextLayer with opinionated styling.
|
|
19
|
+
*
|
|
20
|
+
* Provides consistent text rendering with white text, black outline,
|
|
21
|
+
* centered alignment, and system font stack for optimal performance.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* import { TextLayer } from '@accelint/map-toolkit/deckgl/text-layer';
|
|
26
|
+
* import { defaultSettings } from '@accelint/map-toolkit/deckgl/text-layer/default-settings';
|
|
27
|
+
*
|
|
28
|
+
* // Use defaults as-is
|
|
29
|
+
* const layer = new TextLayer({
|
|
30
|
+
* id: 'text',
|
|
31
|
+
* data: [...],
|
|
32
|
+
* ...defaultSettings,
|
|
33
|
+
* });
|
|
34
|
+
*
|
|
35
|
+
* // Override specific defaults
|
|
36
|
+
* const customLayer = new TextLayer({
|
|
37
|
+
* id: 'text',
|
|
38
|
+
* data: [...],
|
|
39
|
+
* ...defaultSettings,
|
|
40
|
+
* fontFamily: 'Arial',
|
|
41
|
+
* getSize: 14,
|
|
42
|
+
* });
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
17
45
|
const defaultSettings = {
|
|
18
46
|
...DEFAULT_TEXT_STYLE,
|
|
19
47
|
fontFamily: "system-ui, sans-serif",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-settings.js","names":["defaultSettings: Partial<DglTextLayerProps>"],"sources":["../../../src/deckgl/text-layer/default-settings.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 { DEFAULT_TEXT_STYLE } from '../text-settings';\nimport type { TextLayerProps as DglTextLayerProps } from '@deck.gl/layers';\n\nexport const defaultSettings: Partial<DglTextLayerProps> = {\n ...DEFAULT_TEXT_STYLE,\n fontFamily: 'system-ui, sans-serif',\n getAlignmentBaseline: 'center',\n getTextAnchor: 'middle',\n lineHeight: 1,\n} as const;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"default-settings.js","names":["defaultSettings: Partial<DglTextLayerProps>"],"sources":["../../../src/deckgl/text-layer/default-settings.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 { DEFAULT_TEXT_STYLE } from '../text-settings';\nimport type { TextLayerProps as DglTextLayerProps } from '@deck.gl/layers';\n\n/**\n * Default settings for TextLayer with opinionated styling.\n *\n * Provides consistent text rendering with white text, black outline,\n * centered alignment, and system font stack for optimal performance.\n *\n * @example\n * ```typescript\n * import { TextLayer } from '@accelint/map-toolkit/deckgl/text-layer';\n * import { defaultSettings } from '@accelint/map-toolkit/deckgl/text-layer/default-settings';\n *\n * // Use defaults as-is\n * const layer = new TextLayer({\n * id: 'text',\n * data: [...],\n * ...defaultSettings,\n * });\n *\n * // Override specific defaults\n * const customLayer = new TextLayer({\n * id: 'text',\n * data: [...],\n * ...defaultSettings,\n * fontFamily: 'Arial',\n * getSize: 14,\n * });\n * ```\n */\nexport const defaultSettings: Partial<DglTextLayerProps> = {\n ...DEFAULT_TEXT_STYLE,\n fontFamily: 'system-ui, sans-serif',\n getAlignmentBaseline: 'center',\n getTextAnchor: 'middle',\n lineHeight: 1,\n} as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,MAAaA,kBAA8C;CACzD,GAAG;CACH,YAAY;CACZ,sBAAsB;CACtB,eAAe;CACf,YAAY;CACb"}
|
|
@@ -15,7 +15,16 @@ import { TextLayer as TextLayer$1, TextLayerProps as TextLayerProps$1 } from "@d
|
|
|
15
15
|
import { LiteralUnion } from "type-fest";
|
|
16
16
|
|
|
17
17
|
//#region src/deckgl/text-layer/index.d.ts
|
|
18
|
+
/**
|
|
19
|
+
* Props for TextLayer component.
|
|
20
|
+
* Extends Deck.gl's TextLayerProps with enhanced character set support.
|
|
21
|
+
*/
|
|
18
22
|
interface TextLayerProps<TData = unknown> extends TextLayerProps$1<TData> {
|
|
23
|
+
/**
|
|
24
|
+
* Character set to use for text rendering.
|
|
25
|
+
* Can be a predefined CHARACTER_SETS key or a custom string of characters.
|
|
26
|
+
* Defaults to CHARACTER_SETS.EXPANDED for international text support.
|
|
27
|
+
*/
|
|
19
28
|
characterSet?: LiteralUnion<CharacterSetsKeys, string>;
|
|
20
29
|
}
|
|
21
30
|
/**
|
|
@@ -30,6 +39,62 @@ interface TextLayerProps<TData = unknown> extends TextLayerProps$1<TData> {
|
|
|
30
39
|
* Can be used directly with Deck.gl or as a JSX element with React Fiber:
|
|
31
40
|
* - React Fiber: `<textLayer id="text" data={[...]} ... />`
|
|
32
41
|
* - Direct: `new TextLayer({ id: 'text', data: [...], ... })`
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* Direct Deck.gl usage:
|
|
45
|
+
* ```typescript
|
|
46
|
+
* import { Deck } from '@deck.gl/core';
|
|
47
|
+
* import { TextLayer } from '@accelint/map-toolkit/deckgl/text-layer';
|
|
48
|
+
*
|
|
49
|
+
* const layer = new TextLayer({
|
|
50
|
+
* id: 'text-labels',
|
|
51
|
+
* data: [
|
|
52
|
+
* { position: [-122.4, 37.74], text: 'San Francisco' },
|
|
53
|
+
* { position: [-118.2, 34.05], text: 'Los Angeles' },
|
|
54
|
+
* ],
|
|
55
|
+
* getText: d => d.text,
|
|
56
|
+
* getPosition: d => d.position,
|
|
57
|
+
* getSize: 14,
|
|
58
|
+
* fontWeight: 600,
|
|
59
|
+
* outlineWidth: 2,
|
|
60
|
+
* });
|
|
61
|
+
*
|
|
62
|
+
* new Deck({
|
|
63
|
+
* initialViewState: { longitude: -120, latitude: 36, zoom: 6 },
|
|
64
|
+
* controller: true,
|
|
65
|
+
* layers: [layer],
|
|
66
|
+
* });
|
|
67
|
+
* ```
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* React Fiber usage:
|
|
71
|
+
* ```tsx
|
|
72
|
+
* import '@accelint/map-toolkit/deckgl/text-layer/fiber';
|
|
73
|
+
* import { BaseMap } from '@accelint/map-toolkit/deckgl';
|
|
74
|
+
* import { View } from '@deckgl-fiber-renderer/dom';
|
|
75
|
+
*
|
|
76
|
+
* function MapWithLabels() {
|
|
77
|
+
* const cities = [
|
|
78
|
+
* { position: [-122.4, 37.74], text: 'San Francisco' },
|
|
79
|
+
* { position: [-118.2, 34.05], text: 'Los Angeles' },
|
|
80
|
+
* ];
|
|
81
|
+
*
|
|
82
|
+
* return (
|
|
83
|
+
* <BaseMap id="map" className="w-full h-full">
|
|
84
|
+
* <View id="main" controller />
|
|
85
|
+
* <textLayer
|
|
86
|
+
* id="city-labels"
|
|
87
|
+
* data={cities}
|
|
88
|
+
* getText={d => d.text}
|
|
89
|
+
* getPosition={d => d.position}
|
|
90
|
+
* getSize={14}
|
|
91
|
+
* fontWeight={600}
|
|
92
|
+
* outlineWidth={2}
|
|
93
|
+
* />
|
|
94
|
+
* </BaseMap>
|
|
95
|
+
* );
|
|
96
|
+
* }
|
|
97
|
+
* ```
|
|
33
98
|
*/
|
|
34
99
|
declare class TextLayer<TData = unknown> extends TextLayer$1<TData> {
|
|
35
100
|
static CHARACTER_SETS: Readonly<{
|
|
@@ -28,6 +28,62 @@ import { TextLayer as TextLayer$1 } from "@deck.gl/layers";
|
|
|
28
28
|
* Can be used directly with Deck.gl or as a JSX element with React Fiber:
|
|
29
29
|
* - React Fiber: `<textLayer id="text" data={[...]} ... />`
|
|
30
30
|
* - Direct: `new TextLayer({ id: 'text', data: [...], ... })`
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* Direct Deck.gl usage:
|
|
34
|
+
* ```typescript
|
|
35
|
+
* import { Deck } from '@deck.gl/core';
|
|
36
|
+
* import { TextLayer } from '@accelint/map-toolkit/deckgl/text-layer';
|
|
37
|
+
*
|
|
38
|
+
* const layer = new TextLayer({
|
|
39
|
+
* id: 'text-labels',
|
|
40
|
+
* data: [
|
|
41
|
+
* { position: [-122.4, 37.74], text: 'San Francisco' },
|
|
42
|
+
* { position: [-118.2, 34.05], text: 'Los Angeles' },
|
|
43
|
+
* ],
|
|
44
|
+
* getText: d => d.text,
|
|
45
|
+
* getPosition: d => d.position,
|
|
46
|
+
* getSize: 14,
|
|
47
|
+
* fontWeight: 600,
|
|
48
|
+
* outlineWidth: 2,
|
|
49
|
+
* });
|
|
50
|
+
*
|
|
51
|
+
* new Deck({
|
|
52
|
+
* initialViewState: { longitude: -120, latitude: 36, zoom: 6 },
|
|
53
|
+
* controller: true,
|
|
54
|
+
* layers: [layer],
|
|
55
|
+
* });
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* React Fiber usage:
|
|
60
|
+
* ```tsx
|
|
61
|
+
* import '@accelint/map-toolkit/deckgl/text-layer/fiber';
|
|
62
|
+
* import { BaseMap } from '@accelint/map-toolkit/deckgl';
|
|
63
|
+
* import { View } from '@deckgl-fiber-renderer/dom';
|
|
64
|
+
*
|
|
65
|
+
* function MapWithLabels() {
|
|
66
|
+
* const cities = [
|
|
67
|
+
* { position: [-122.4, 37.74], text: 'San Francisco' },
|
|
68
|
+
* { position: [-118.2, 34.05], text: 'Los Angeles' },
|
|
69
|
+
* ];
|
|
70
|
+
*
|
|
71
|
+
* return (
|
|
72
|
+
* <BaseMap id="map" className="w-full h-full">
|
|
73
|
+
* <View id="main" controller />
|
|
74
|
+
* <textLayer
|
|
75
|
+
* id="city-labels"
|
|
76
|
+
* data={cities}
|
|
77
|
+
* getText={d => d.text}
|
|
78
|
+
* getPosition={d => d.position}
|
|
79
|
+
* getSize={14}
|
|
80
|
+
* fontWeight={600}
|
|
81
|
+
* outlineWidth={2}
|
|
82
|
+
* />
|
|
83
|
+
* </BaseMap>
|
|
84
|
+
* );
|
|
85
|
+
* }
|
|
86
|
+
* ```
|
|
31
87
|
*/
|
|
32
88
|
var TextLayer = class extends TextLayer$1 {
|
|
33
89
|
static CHARACTER_SETS = CHARACTER_SETS;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["DglTextLayer"],"sources":["../../../src/deckgl/text-layer/index.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 {\n TextLayer as DglTextLayer,\n type TextLayerProps as DglTextLayerProps,\n} from '@deck.gl/layers';\nimport { CHARACTER_SETS, type CharacterSetsKeys } from './character-sets.js';\nimport { defaultSettings } from './default-settings.js';\nimport type { LiteralUnion } from 'type-fest';\n\nexport interface TextLayerProps<TData = unknown>\n extends DglTextLayerProps<TData> {\n
|
|
1
|
+
{"version":3,"file":"index.js","names":["DglTextLayer"],"sources":["../../../src/deckgl/text-layer/index.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 {\n TextLayer as DglTextLayer,\n type TextLayerProps as DglTextLayerProps,\n} from '@deck.gl/layers';\nimport { CHARACTER_SETS, type CharacterSetsKeys } from './character-sets.js';\nimport { defaultSettings } from './default-settings.js';\nimport type { LiteralUnion } from 'type-fest';\n\n/**\n * Props for TextLayer component.\n * Extends Deck.gl's TextLayerProps with enhanced character set support.\n */\nexport interface TextLayerProps<TData = unknown>\n extends DglTextLayerProps<TData> {\n /**\n * Character set to use for text rendering.\n * Can be a predefined CHARACTER_SETS key or a custom string of characters.\n * Defaults to CHARACTER_SETS.EXPANDED for international text support.\n */\n characterSet?: LiteralUnion<CharacterSetsKeys, string>;\n}\n\n/**\n * A styled text layer that extends Deck.gl's TextLayer with enhanced styling capabilities.\n *\n * This layer provides:\n * - Customizable font styling (size, weight, family, line height)\n * - Text outline support\n * - Extended character set support\n * - Consistent styling based on design specifications\n *\n * Can be used directly with Deck.gl or as a JSX element with React Fiber:\n * - React Fiber: `<textLayer id=\"text\" data={[...]} ... />`\n * - Direct: `new TextLayer({ id: 'text', data: [...], ... })`\n *\n * @example\n * Direct Deck.gl usage:\n * ```typescript\n * import { Deck } from '@deck.gl/core';\n * import { TextLayer } from '@accelint/map-toolkit/deckgl/text-layer';\n *\n * const layer = new TextLayer({\n * id: 'text-labels',\n * data: [\n * { position: [-122.4, 37.74], text: 'San Francisco' },\n * { position: [-118.2, 34.05], text: 'Los Angeles' },\n * ],\n * getText: d => d.text,\n * getPosition: d => d.position,\n * getSize: 14,\n * fontWeight: 600,\n * outlineWidth: 2,\n * });\n *\n * new Deck({\n * initialViewState: { longitude: -120, latitude: 36, zoom: 6 },\n * controller: true,\n * layers: [layer],\n * });\n * ```\n *\n * @example\n * React Fiber usage:\n * ```tsx\n * import '@accelint/map-toolkit/deckgl/text-layer/fiber';\n * import { BaseMap } from '@accelint/map-toolkit/deckgl';\n * import { View } from '@deckgl-fiber-renderer/dom';\n *\n * function MapWithLabels() {\n * const cities = [\n * { position: [-122.4, 37.74], text: 'San Francisco' },\n * { position: [-118.2, 34.05], text: 'Los Angeles' },\n * ];\n *\n * return (\n * <BaseMap id=\"map\" className=\"w-full h-full\">\n * <View id=\"main\" controller />\n * <textLayer\n * id=\"city-labels\"\n * data={cities}\n * getText={d => d.text}\n * getPosition={d => d.position}\n * getSize={14}\n * fontWeight={600}\n * outlineWidth={2}\n * />\n * </BaseMap>\n * );\n * }\n * ```\n */\nexport class TextLayer<TData = unknown> extends DglTextLayer<TData> {\n static CHARACTER_SETS = CHARACTER_SETS;\n\n static override layerName = 'textLayer';\n\n constructor(props: TextLayerProps<TData>) {\n const {\n characterSet = CHARACTER_SETS.EXPANDED,\n fontSettings,\n ...rest\n } = props;\n\n super({\n // set opinionated defaults\n ...defaultSettings,\n\n // user props override defaults\n ...rest,\n\n // handle special characterSet logic\n characterSet:\n CHARACTER_SETS[characterSet as CharacterSetsKeys] ?? characterSet,\n\n fontSettings: {\n // merge fontSettings\n ...defaultSettings.fontSettings,\n\n // user props override defaults\n ...fontSettings,\n },\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuGA,IAAa,YAAb,cAAgDA,YAAoB;CAClE,OAAO,iBAAiB;CAExB,OAAgB,YAAY;CAE5B,YAAY,OAA8B;EACxC,MAAM,EACJ,eAAe,eAAe,UAC9B,cACA,GAAG,SACD;AAEJ,QAAM;GAEJ,GAAG;GAGH,GAAG;GAGH,cACE,eAAe,iBAAsC;GAEvD,cAAc;IAEZ,GAAG,gBAAgB;IAGnB,GAAG;IACJ;GACF,CAAC"}
|
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Event keys for map cursor state changes.
|
|
4
4
|
* These events are used for communication between cursor stores and consumers.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* import { Broadcast } from '@accelint/bus';
|
|
9
|
+
* import { MapCursorEvents } from '@accelint/map-toolkit/map-cursor';
|
|
10
|
+
* import type { MapCursorEventType } from '@accelint/map-toolkit/map-cursor';
|
|
11
|
+
*
|
|
12
|
+
* const bus = Broadcast.getInstance<MapCursorEventType>();
|
|
13
|
+
*
|
|
14
|
+
* // Listen for cursor changes
|
|
15
|
+
* bus.on(MapCursorEvents.changed, (event) => {
|
|
16
|
+
* console.log('Cursor changed to:', event.payload.currentCursor);
|
|
17
|
+
* });
|
|
18
|
+
*
|
|
19
|
+
* // Listen for rejections
|
|
20
|
+
* bus.on(MapCursorEvents.rejected, (event) => {
|
|
21
|
+
* console.warn('Cursor change rejected:', event.payload.reason);
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
5
24
|
*/
|
|
6
25
|
declare const MapCursorEvents: {
|
|
7
26
|
/** Emitted when a component requests a cursor change */
|
|
@@ -15,6 +15,25 @@
|
|
|
15
15
|
/**
|
|
16
16
|
* Event keys for map cursor state changes.
|
|
17
17
|
* These events are used for communication between cursor stores and consumers.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* import { Broadcast } from '@accelint/bus';
|
|
22
|
+
* import { MapCursorEvents } from '@accelint/map-toolkit/map-cursor';
|
|
23
|
+
* import type { MapCursorEventType } from '@accelint/map-toolkit/map-cursor';
|
|
24
|
+
*
|
|
25
|
+
* const bus = Broadcast.getInstance<MapCursorEventType>();
|
|
26
|
+
*
|
|
27
|
+
* // Listen for cursor changes
|
|
28
|
+
* bus.on(MapCursorEvents.changed, (event) => {
|
|
29
|
+
* console.log('Cursor changed to:', event.payload.currentCursor);
|
|
30
|
+
* });
|
|
31
|
+
*
|
|
32
|
+
* // Listen for rejections
|
|
33
|
+
* bus.on(MapCursorEvents.rejected, (event) => {
|
|
34
|
+
* console.warn('Cursor change rejected:', event.payload.reason);
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
18
37
|
*/
|
|
19
38
|
const MapCursorEvents = {
|
|
20
39
|
changeRequest: "cursor:change-request",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","names":[],"sources":["../../src/map-cursor/events.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/**\n * Event keys for map cursor state changes.\n * These events are used for communication between cursor stores and consumers.\n */\nexport const MapCursorEvents = {\n /** Emitted when a component requests a cursor change */\n changeRequest: 'cursor:change-request',\n /** Emitted when the cursor has been changed */\n changed: 'cursor:changed',\n /** Emitted when a cursor change request is rejected */\n rejected: 'cursor:rejected',\n} as const;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"events.js","names":[],"sources":["../../src/map-cursor/events.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/**\n * Event keys for map cursor state changes.\n * These events are used for communication between cursor stores and consumers.\n *\n * @example\n * ```typescript\n * import { Broadcast } from '@accelint/bus';\n * import { MapCursorEvents } from '@accelint/map-toolkit/map-cursor';\n * import type { MapCursorEventType } from '@accelint/map-toolkit/map-cursor';\n *\n * const bus = Broadcast.getInstance<MapCursorEventType>();\n *\n * // Listen for cursor changes\n * bus.on(MapCursorEvents.changed, (event) => {\n * console.log('Cursor changed to:', event.payload.currentCursor);\n * });\n *\n * // Listen for rejections\n * bus.on(MapCursorEvents.rejected, (event) => {\n * console.warn('Cursor change rejected:', event.payload.reason);\n * });\n * ```\n */\nexport const MapCursorEvents = {\n /** Emitted when a component requests a cursor change */\n changeRequest: 'cursor:change-request',\n /** Emitted when the cursor has been changed */\n changed: 'cursor:changed',\n /** Emitted when a cursor change request is rejected */\n rejected: 'cursor:rejected',\n} as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,MAAa,kBAAkB;CAE7B,eAAe;CAEf,SAAS;CAET,UAAU;CACX"}
|