@tomtom-org/maps-sdk 0.56.0 → 0.57.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 +32 -0
- package/README.md +1 -1
- package/core/dist/core.es.js +1 -1
- package/map/dist/index.d.ts +459 -301
- package/map/dist/map.es.js +1 -1
- package/map/dist/map.es.js.map +1 -1
- package/package.json +1 -1
- package/services/dist/index.d.ts +61 -30
- package/services/dist/services.es.js +1 -1
- package/services/dist/services.es.js.map +1 -1
package/map/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BackgroundLayerSpecification, CircleLayerSpecification, DataDrivenPropertyValueSpecification, ExpressionFilterSpecification, ExpressionSpecification, GeoJSONSource, GeoJSONSourceSpecification, LayerSpecification, LineLayerSpecification, LngLat, Map, MapGeoJSONFeature, MapOptions, Source, SourceSpecification, StyleImageInterface, StyleImageMetadata, StyleSpecification, SymbolLayerSpecification } from "maplibre-gl";
|
|
1
|
+
import { AllLayoutProperties, AllPaintProperties, BackgroundLayerSpecification, CircleLayerSpecification, DataDrivenPropertyValueSpecification, ExpressionFilterSpecification, ExpressionSpecification, FilterSpecification, GeoJSONSource, GeoJSONSourceSpecification, LayerSpecification, LineLayerSpecification, LngLat, Map, MapGeoJSONFeature, MapOptions, Source, SourceSpecification, StyleImageInterface, StyleImageMetadata, StyleSpecification, SymbolLayerSpecification } from "maplibre-gl";
|
|
2
2
|
import { Anything, AreaAnalyticsMetricKey, AreaAnalyticsMetrics, BBox, ChargingSpeed, ChargingStop, ChargingStopProps, CommonPlaceProps, CountrySectionProps, DelayMagnitude, DisplayUnits, GetPositionEntryPointOption, GlobalConfig, Instruction, Language, POICategory, Place, Places, PolygonFeature, PolygonFeatures, Route, RouteProps, Routes, SectionProps, SectionType, TrafficAreaAnalytics, TrafficIncident, TrafficIncidentBaseProperties, TrafficIncidentCategory, TrafficIncidentDetails, TrafficIncidentTimeValidity, TrafficSectionProps, Waypoint, WaypointLike, Waypoints } from "@tomtom-org/maps-sdk/core";
|
|
3
3
|
//#region src/shared/types/style.d.ts
|
|
4
4
|
/**
|
|
@@ -311,7 +311,7 @@ export type StandardStyle = {
|
|
|
311
311
|
* Available modules:
|
|
312
312
|
* - `trafficIncidents`: Real-time traffic incidents (accidents, closures)
|
|
313
313
|
* - `trafficFlow`: Real-time traffic flow visualization
|
|
314
|
-
* - `hillshade`: Terrain elevation shading
|
|
314
|
+
* - `hillshade`: Terrain elevation data, for hillshade shading and 3D terrain
|
|
315
315
|
*
|
|
316
316
|
* @example
|
|
317
317
|
* ```typescript
|
|
@@ -432,7 +432,7 @@ export declare const styleModules: readonly ["trafficIncidents", "trafficFlow",
|
|
|
432
432
|
* @remarks
|
|
433
433
|
* - `trafficIncidents`: Shows real-time traffic incidents on the map
|
|
434
434
|
* - `trafficFlow`: Shows real-time traffic flow with color-coded speeds
|
|
435
|
-
* - `hillshade`: Adds terrain elevation shading
|
|
435
|
+
* - `hillshade`: Adds terrain elevation data, drawn by {@link TerrainModule} as hillshade shading and 3D terrain
|
|
436
436
|
*
|
|
437
437
|
* @group Map Style
|
|
438
438
|
*/
|
|
@@ -577,7 +577,6 @@ export type TomTomMapParams = Partial<GlobalConfig> & {
|
|
|
577
577
|
* zoom: 12,
|
|
578
578
|
* pitch: 45,
|
|
579
579
|
* bearing: -17.6,
|
|
580
|
-
* antialias: true,
|
|
581
580
|
* maxZoom: 18,
|
|
582
581
|
* minZoom: 8
|
|
583
582
|
* }
|
|
@@ -944,7 +943,6 @@ export declare class TomTomMap {
|
|
|
944
943
|
* zoom: 13,
|
|
945
944
|
* pitch: 45,
|
|
946
945
|
* bearing: -17.6,
|
|
947
|
-
* antialias: true,
|
|
948
946
|
* maxZoom: 18,
|
|
949
947
|
* minZoom: 8
|
|
950
948
|
* }
|
|
@@ -3844,8 +3842,7 @@ export declare abstract class AbstractMapModule<SOURCES_WITH_LAYERS extends Sour
|
|
|
3844
3842
|
* module behavior even when the map's base style is modified.
|
|
3845
3843
|
*
|
|
3846
3844
|
* Unless a module documents otherwise, the given configuration **replaces** the current one
|
|
3847
|
-
* rather than being merged into it. To change one part of it,
|
|
3848
|
-
* configuration into the new one: `myModule.applyConfig({ ...myModule.getConfig(), theme })`.
|
|
3845
|
+
* rather than being merged into it. To change one part of it, use {@link updateConfig}.
|
|
3849
3846
|
*
|
|
3850
3847
|
* @example
|
|
3851
3848
|
* ```typescript
|
|
@@ -3860,6 +3857,25 @@ export declare abstract class AbstractMapModule<SOURCES_WITH_LAYERS extends Sour
|
|
|
3860
3857
|
* @see {@link getConfig} to retrieve the current configuration
|
|
3861
3858
|
*/
|
|
3862
3859
|
applyConfig(config: CFG | undefined): void;
|
|
3860
|
+
/**
|
|
3861
|
+
* Changes part of the configuration and keeps the rest.
|
|
3862
|
+
*
|
|
3863
|
+
* The given properties are laid over the current configuration — one level deep, so a nested
|
|
3864
|
+
* object you pass replaces the nested object that was there — and the result is applied with
|
|
3865
|
+
* {@link applyConfig}. This is the same on every module, whatever its `applyConfig` does with a
|
|
3866
|
+
* whole configuration.
|
|
3867
|
+
*
|
|
3868
|
+
* @param partial - The properties to change.
|
|
3869
|
+
*
|
|
3870
|
+
* @example
|
|
3871
|
+
* ```typescript
|
|
3872
|
+
* routing.applyConfig({ displayUnits: 'imperial', theme: { mainColor: '#0a3653' } });
|
|
3873
|
+
* routing.updateConfig({ theme: { mainColor: '#c2185b' } }); // displayUnits stays imperial
|
|
3874
|
+
* ```
|
|
3875
|
+
*
|
|
3876
|
+
* @see {@link applyConfig} to apply a whole configuration
|
|
3877
|
+
*/
|
|
3878
|
+
updateConfig(partial: Partial<NonNullable<CFG>>): void;
|
|
3863
3879
|
/**
|
|
3864
3880
|
* Emits a `config-change` event to all registered handlers.
|
|
3865
3881
|
* Skipped during module initialisation to avoid spurious events.
|
|
@@ -4003,6 +4019,12 @@ export declare abstract class AbstractMapModule<SOURCES_WITH_LAYERS extends Sour
|
|
|
4003
4019
|
* @ignore
|
|
4004
4020
|
*/
|
|
4005
4021
|
protected userEvents<T = MapGeoJSONFeature, WHERE_SCOPE = never>(sourceNames: (keyof SOURCES_WITH_LAYERS)[], options?: EventScopeOptions<T, WHERE_SCOPE>): UserEvents<T, WHERE_SCOPE>;
|
|
4022
|
+
/**
|
|
4023
|
+
* `config-change` alone: the event surface of a module with no `show` and nothing on the map a
|
|
4024
|
+
* user can interact with, and the lifecycle half of {@link moduleEvents}.
|
|
4025
|
+
* @ignore
|
|
4026
|
+
*/
|
|
4027
|
+
protected lifecycleEvents(): ModuleEvents<CFG, never>;
|
|
4006
4028
|
/**
|
|
4007
4029
|
* The event surface of a module with no `show`: user events over the named sources, plus
|
|
4008
4030
|
* `config-change`. `shown-features` is not subscribable here — `TShown` is `never`, which
|
|
@@ -4065,10 +4087,10 @@ export declare abstract class AbstractDataOwnedMapModule<SOURCES_WITH_LAYERS ext
|
|
|
4065
4087
|
//#region src/shared/AbstractStyleOwnedMapModule.d.ts
|
|
4066
4088
|
/**
|
|
4067
4089
|
* Base class for the map modules that control sources and layers the loaded map style already
|
|
4068
|
-
* provides, under fixed global IDs: the base map, POIs, the traffic tiles and
|
|
4090
|
+
* provides, under fixed global IDs: the base map, POIs, the traffic tiles and the terrain.
|
|
4069
4091
|
*
|
|
4070
4092
|
* @remarks
|
|
4071
|
-
* The style owns the data, so such a module
|
|
4093
|
+
* The style owns the data, so such a module brings no data of its own and shows nothing by
|
|
4072
4094
|
* itself. It changes how the parts the style provides are drawn, filtered and made visible.
|
|
4073
4095
|
* The SDK memoizes one instance per map, obtained with `get(map, config?)`, so every handle on it
|
|
4074
4096
|
* sees the same state.
|
|
@@ -4372,15 +4394,25 @@ type MapFont = (typeof mapFonts)[number];
|
|
|
4372
4394
|
*/
|
|
4373
4395
|
export declare const POI_SOURCE_ID = "vectorTiles";
|
|
4374
4396
|
/**
|
|
4375
|
-
* Source identifier
|
|
4397
|
+
* Source identifier of the style's elevation data, added by the `hillshade` style part.
|
|
4376
4398
|
*
|
|
4377
4399
|
* @remarks
|
|
4378
|
-
*
|
|
4379
|
-
*
|
|
4400
|
+
* A raster-dem source, drawn as the hillshade layer. {@link TerrainModule} raises the 3D surface
|
|
4401
|
+
* from a copy of it, {@link TERRAIN_SOURCE_ID}.
|
|
4380
4402
|
*
|
|
4381
|
-
* @group
|
|
4403
|
+
* @group Terrain
|
|
4382
4404
|
*/
|
|
4383
4405
|
export declare const HILLSHADE_SOURCE_ID = "hillshade";
|
|
4406
|
+
/**
|
|
4407
|
+
* Source identifier of the 3D terrain surface: a copy of {@link HILLSHADE_SOURCE_ID} that
|
|
4408
|
+
* {@link TerrainModule} adds when elevation is first enabled.
|
|
4409
|
+
*
|
|
4410
|
+
* @remarks
|
|
4411
|
+
* MapLibre renders hillshade and 3D terrain at a lower quality when both share one source.
|
|
4412
|
+
*
|
|
4413
|
+
* @group Terrain
|
|
4414
|
+
*/
|
|
4415
|
+
export declare const TERRAIN_SOURCE_ID = "hillshade-terrain";
|
|
4384
4416
|
/**
|
|
4385
4417
|
* Source identifier for base map vector tiles.
|
|
4386
4418
|
*
|
|
@@ -4418,7 +4450,7 @@ export declare const TRAFFIC_FLOW_SOURCE_ID = "vectorTilesFlow";
|
|
|
4418
4450
|
*
|
|
4419
4451
|
* Style-owned modules control sources and layers the map style already provides, under fixed
|
|
4420
4452
|
* global IDs, so a second instance would be a second controller over one piece of shared state.
|
|
4421
|
-
* Callers get the same instance instead — two components each asking for
|
|
4453
|
+
* Callers get the same instance instead — two components each asking for the terrain is reasonable
|
|
4422
4454
|
* code, and making them hoist a shared reference would be work pushed onto them for no benefit.
|
|
4423
4455
|
*
|
|
4424
4456
|
* @param map The map the module belongs to.
|
|
@@ -4711,7 +4743,7 @@ export type BaseMapEvents = CombinedEvents<MapGeoJSONFeature, BaseMapModuleConfi
|
|
|
4711
4743
|
*
|
|
4712
4744
|
* @remarks
|
|
4713
4745
|
* **Managed Layers:**
|
|
4714
|
-
* - Background and
|
|
4746
|
+
* - Background and land cover
|
|
4715
4747
|
* - Water bodies and coastlines
|
|
4716
4748
|
* - Country and administrative borders
|
|
4717
4749
|
* - Buildings (2D and 3D)
|
|
@@ -4722,7 +4754,7 @@ export type BaseMapEvents = CombinedEvents<MapGeoJSONFeature, BaseMapModuleConfi
|
|
|
4722
4754
|
* **Does NOT Include:**
|
|
4723
4755
|
* - Traffic flow/incidents (use {@link TrafficFlowModule} or {@link TrafficIncidentsModule})
|
|
4724
4756
|
* - Points of Interest/POIs (use {@link POIsModule})
|
|
4725
|
-
* - Hillshade
|
|
4757
|
+
* - Hillshade and 3D terrain (use {@link TerrainModule})
|
|
4726
4758
|
*
|
|
4727
4759
|
* **Use Cases:**
|
|
4728
4760
|
* - Toggle base map visibility on/off
|
|
@@ -6494,207 +6526,6 @@ export type ExtraGeometryDisplayProps = {
|
|
|
6494
6526
|
*/
|
|
6495
6527
|
export type DisplayGeometryProps = CommonPlaceProps & ExtraGeometryDisplayProps;
|
|
6496
6528
|
//#endregion
|
|
6497
|
-
//#region src/hillshade/HillshadeModule.d.ts
|
|
6498
|
-
/**
|
|
6499
|
-
* IDs of sources and layers for hillshade module.
|
|
6500
|
-
*/
|
|
6501
|
-
type HillshadeSourcesWithLayers = {
|
|
6502
|
-
hillshade: StyleSourceWithLayers;
|
|
6503
|
-
};
|
|
6504
|
-
/**
|
|
6505
|
-
* Map module for displaying terrain shading (hillshade).
|
|
6506
|
-
*
|
|
6507
|
-
* The HillshadeModule adds realistic terrain depth perception to the map by rendering
|
|
6508
|
-
* shadow and highlight effects based on elevation data. This enhances the 3D appearance
|
|
6509
|
-
* of mountainous and hilly terrain.
|
|
6510
|
-
*
|
|
6511
|
-
* @remarks
|
|
6512
|
-
* **Features:**
|
|
6513
|
-
* - Realistic terrain shading
|
|
6514
|
-
* - Uses vector tile elevation data
|
|
6515
|
-
* - Lightweight performance impact
|
|
6516
|
-
* - Seamlessly integrates with other map layers
|
|
6517
|
-
* - Toggle visibility on/off
|
|
6518
|
-
*
|
|
6519
|
-
* **Common Use Cases:**
|
|
6520
|
-
* - Outdoor recreation maps (hiking, skiing)
|
|
6521
|
-
* - Geographic/topographic applications
|
|
6522
|
-
* - Environmental visualization
|
|
6523
|
-
* - Landscape planning tools
|
|
6524
|
-
*
|
|
6525
|
-
* @example
|
|
6526
|
-
* ```typescript
|
|
6527
|
-
* // Create the module with hillshade visible
|
|
6528
|
-
* const hillshade = await HillshadeModule.getInstance(map, {
|
|
6529
|
-
* visible: true
|
|
6530
|
-
* });
|
|
6531
|
-
*
|
|
6532
|
-
* // Toggle visibility
|
|
6533
|
-
* hillshade.setVisible(false);
|
|
6534
|
-
*
|
|
6535
|
-
* // Listen to events
|
|
6536
|
-
* hillshade.events.on('click', (feature, lngLat) => {
|
|
6537
|
-
* console.log('Clicked hillshade at:', lngLat);
|
|
6538
|
-
* });
|
|
6539
|
-
* ```
|
|
6540
|
-
*
|
|
6541
|
-
* @see [Hillshade Guide](https://docs.tomtom.com/maps-sdk-js/guides/map/hillshade)
|
|
6542
|
-
*
|
|
6543
|
-
* @group Hillshade
|
|
6544
|
-
*/
|
|
6545
|
-
export declare class HillshadeModule extends AbstractStyleOwnedMapModule<HillshadeSourcesWithLayers, HillshadeModuleConfig> {
|
|
6546
|
-
/**
|
|
6547
|
-
* Retrieves a HillshadeModule instance for the given map.
|
|
6548
|
-
*
|
|
6549
|
-
* @param map - The TomTomMap instance to attach this module to.
|
|
6550
|
-
* @param config - Optional configuration for initialization and visibility.
|
|
6551
|
-
*
|
|
6552
|
-
* @returns A promise that resolves to the initialized HillshadeModule.
|
|
6553
|
-
*
|
|
6554
|
-
* @remarks
|
|
6555
|
-
* **Configuration:**
|
|
6556
|
-
* - `visible`: Initial visibility state
|
|
6557
|
-
* - `ensureAddedToStyle`: Auto-add hillshade to style if missing
|
|
6558
|
-
*
|
|
6559
|
-
* **Style Requirement:**
|
|
6560
|
-
* - Hillshade must be included in the map style or added via `ensureAddedToStyle`
|
|
6561
|
-
* - Some styles may not support hillshade (e.g., satellite)
|
|
6562
|
-
*
|
|
6563
|
-
* @throws Error if hillshade source is not in style and `ensureAddedToStyle` is false
|
|
6564
|
-
*
|
|
6565
|
-
* @example
|
|
6566
|
-
* Default initialization:
|
|
6567
|
-
* ```typescript
|
|
6568
|
-
* const hillshadeModule = await HillshadeModule.get(map);
|
|
6569
|
-
* ```
|
|
6570
|
-
*
|
|
6571
|
-
* @example
|
|
6572
|
-
* Auto-add to style if missing:
|
|
6573
|
-
* ```typescript
|
|
6574
|
-
* const hillshadeModule = await HillshadeModule.get(map, {
|
|
6575
|
-
* visible: true
|
|
6576
|
-
* });
|
|
6577
|
-
* ```
|
|
6578
|
-
*
|
|
6579
|
-
* @example
|
|
6580
|
-
* Start hidden:
|
|
6581
|
-
* ```typescript
|
|
6582
|
-
* const hillshadeModule = await HillshadeModule.get(map, {
|
|
6583
|
-
* visible: false
|
|
6584
|
-
* });
|
|
6585
|
-
* ```
|
|
6586
|
-
*
|
|
6587
|
-
* @remarks
|
|
6588
|
-
* **Instances:**
|
|
6589
|
-
* `HillshadeModule` controls the hillshade source and layers the map style already provides,
|
|
6590
|
-
* under fixed global IDs. Every instance is another handle on that same shared state, so
|
|
6591
|
-
* visibility applied through one is visible through all of them.
|
|
6592
|
-
*/
|
|
6593
|
-
static get(map: TomTomMap, config?: HillshadeModuleConfig): Promise<HillshadeModule>;
|
|
6594
|
-
private constructor();
|
|
6595
|
-
/**
|
|
6596
|
-
* @ignore
|
|
6597
|
-
*/
|
|
6598
|
-
protected _initSourcesWithLayers(): {
|
|
6599
|
-
hillshade: StyleSourceWithLayers<import("maplibre-gl").SourceSpecification, import("maplibre-gl").Source>;
|
|
6600
|
-
};
|
|
6601
|
-
/**
|
|
6602
|
-
* @ignore
|
|
6603
|
-
*/
|
|
6604
|
-
protected _applyConfig(config: HillshadeModuleConfig | undefined): HillshadeModuleConfig | undefined;
|
|
6605
|
-
/**
|
|
6606
|
-
* Sets the visibility of the hillshade layer.
|
|
6607
|
-
*
|
|
6608
|
-
* @param visible - `true` to show hillshade, `false` to hide it.
|
|
6609
|
-
*
|
|
6610
|
-
* @remarks
|
|
6611
|
-
* Changes are applied immediately if the map is ready.
|
|
6612
|
-
*
|
|
6613
|
-
* @example
|
|
6614
|
-
* ```typescript
|
|
6615
|
-
* hillshade.setVisible(true); // Show terrain shading
|
|
6616
|
-
* hillshade.setVisible(false); // Hide terrain shading
|
|
6617
|
-
* ```
|
|
6618
|
-
*/
|
|
6619
|
-
setVisible(visible: boolean): void;
|
|
6620
|
-
private _setVisible;
|
|
6621
|
-
/**
|
|
6622
|
-
* Checks if the hillshade layer is currently visible.
|
|
6623
|
-
*
|
|
6624
|
-
* @returns `true` if visible, `false` if hidden.
|
|
6625
|
-
*
|
|
6626
|
-
* @example
|
|
6627
|
-
* ```typescript
|
|
6628
|
-
* if (hillshade.isVisible()) {
|
|
6629
|
-
* console.log('Terrain shading is active');
|
|
6630
|
-
* }
|
|
6631
|
-
* ```
|
|
6632
|
-
*/
|
|
6633
|
-
isVisible(): boolean;
|
|
6634
|
-
/**
|
|
6635
|
-
* Gets the unified events interface for this module, covering both user interactions
|
|
6636
|
-
* and module lifecycle events.
|
|
6637
|
-
*
|
|
6638
|
-
* **User interaction events** (`click`, `contextmenu`, `hover`, `long-hover`):
|
|
6639
|
-
* ```typescript
|
|
6640
|
-
* hillshade.events.on('click', (feature, lngLat) => {
|
|
6641
|
-
* console.log('Clicked terrain at:', lngLat);
|
|
6642
|
-
* });
|
|
6643
|
-
* ```
|
|
6644
|
-
*
|
|
6645
|
-
* **Module lifecycle events** (`config-change`):
|
|
6646
|
-
* ```typescript
|
|
6647
|
-
* const unsub = hillshade.events.on('config-change', (config) => {
|
|
6648
|
-
* console.log('Hillshade config changed:', config);
|
|
6649
|
-
* });
|
|
6650
|
-
* unsub();
|
|
6651
|
-
* ```
|
|
6652
|
-
*/
|
|
6653
|
-
get events(): CombinedEvents<import('maplibre-gl').MapGeoJSONFeature, HillshadeModuleConfig, never>;
|
|
6654
|
-
}
|
|
6655
|
-
//#endregion
|
|
6656
|
-
//#region src/hillshade/types/hillshadeModuleConfig.d.ts
|
|
6657
|
-
/**
|
|
6658
|
-
* Configuration options for the HillshadeModule.
|
|
6659
|
-
*
|
|
6660
|
-
* Controls the appearance and visibility of terrain shading on the map.
|
|
6661
|
-
*
|
|
6662
|
-
* @remarks
|
|
6663
|
-
* The HillshadeModule uses vector tile elevation data to create shadow/highlight
|
|
6664
|
-
* effects that enhance the 3D perception of terrain features like mountains and valleys.
|
|
6665
|
-
*
|
|
6666
|
-
* **Configuration Options:**
|
|
6667
|
-
* - `visible`: Whether the hillshade layer is shown or hidden
|
|
6668
|
-
*
|
|
6669
|
-
* **Visual Effect:**
|
|
6670
|
-
* - Creates realistic terrain depth perception
|
|
6671
|
-
* - Lightweight performance impact
|
|
6672
|
-
* - Works alongside other map layers
|
|
6673
|
-
*
|
|
6674
|
-
* @example
|
|
6675
|
-
* ```typescript
|
|
6676
|
-
* // Show hillshade
|
|
6677
|
-
* const config: HillshadeModuleConfig = {
|
|
6678
|
-
* visible: true
|
|
6679
|
-
* };
|
|
6680
|
-
*
|
|
6681
|
-
* // Hide hillshade initially
|
|
6682
|
-
* const hiddenConfig: HillshadeModuleConfig = {
|
|
6683
|
-
* visible: false
|
|
6684
|
-
* };
|
|
6685
|
-
* ```
|
|
6686
|
-
*
|
|
6687
|
-
* @group Hillshade
|
|
6688
|
-
*/
|
|
6689
|
-
type HillshadeModuleConfig = MapModuleCommonConfig & {
|
|
6690
|
-
/**
|
|
6691
|
-
* Controls the visibility of the hillshade layers.
|
|
6692
|
-
*
|
|
6693
|
-
* @default false
|
|
6694
|
-
*/
|
|
6695
|
-
visible?: boolean;
|
|
6696
|
-
};
|
|
6697
|
-
//#endregion
|
|
6698
6529
|
//#region src/pois/util/poiCategoryMapping.d.ts
|
|
6699
6530
|
/**
|
|
6700
6531
|
* POI category mappings that have a direct equivalent in Map Display POI categories.
|
|
@@ -11197,6 +11028,13 @@ type LayerSelector = {
|
|
|
11197
11028
|
/** The layer id must contain none of these fragments (case-insensitive). */
|
|
11198
11029
|
idExcludes?: string[];
|
|
11199
11030
|
};
|
|
11031
|
+
/**
|
|
11032
|
+
* The style's sources, for selectors that constrain the source type.
|
|
11033
|
+
* @ignore
|
|
11034
|
+
*/
|
|
11035
|
+
type StyleSources = Record<string, {
|
|
11036
|
+
type: string;
|
|
11037
|
+
}>;
|
|
11200
11038
|
//#endregion
|
|
11201
11039
|
//#region src/styling/mapColorCatalogue.d.ts
|
|
11202
11040
|
/**
|
|
@@ -11236,7 +11074,7 @@ type MapColors = Partial<Record<MapColorName, string>>;
|
|
|
11236
11074
|
* `StylingModule` needs the set at runtime to pick MapLibre's paint setter over its layout one.
|
|
11237
11075
|
* @ignore
|
|
11238
11076
|
*/
|
|
11239
|
-
declare const paintColorProperties: readonly ["fill-color", "fill-outline-color", "line-color", "text-color", "text-halo-color", "fill-extrusion-color", "background-color"];
|
|
11077
|
+
declare const paintColorProperties: readonly ["fill-color", "fill-outline-color", "line-color", "text-color", "text-halo-color", "fill-extrusion-color", "background-color", "hillshade-shadow-color", "hillshade-highlight-color", "hillshade-accent-color"];
|
|
11240
11078
|
/** @ignore */
|
|
11241
11079
|
type PaintColorProperty = (typeof paintColorProperties)[number];
|
|
11242
11080
|
/**
|
|
@@ -11309,15 +11147,6 @@ declare const stylingPresets: {
|
|
|
11309
11147
|
readonly 'view.sky': true;
|
|
11310
11148
|
};
|
|
11311
11149
|
};
|
|
11312
|
-
readonly terrain: {
|
|
11313
|
-
readonly name: "Terrain";
|
|
11314
|
-
readonly description: "3D terrain with a sky for tilted views. Needs the hillshade style part and a pitched camera.";
|
|
11315
|
-
readonly settings: {
|
|
11316
|
-
readonly 'view.terrain': true;
|
|
11317
|
-
readonly 'view.terrainExaggeration': 1.2;
|
|
11318
|
-
readonly 'view.sky': true;
|
|
11319
|
-
};
|
|
11320
|
-
};
|
|
11321
11150
|
};
|
|
11322
11151
|
/**
|
|
11323
11152
|
* The id of a styling preset, as accepted by {@link StylingModule.applyPreset}.
|
|
@@ -11406,8 +11235,7 @@ type StylingKnobDescriptor = KnobDescriptor & {
|
|
|
11406
11235
|
/**
|
|
11407
11236
|
* Whether the knob has anything to work on in the loaded style. `false` means setting it would
|
|
11408
11237
|
* do nothing, and the SDK also warns once in the console when that happens. Check this before
|
|
11409
|
-
* offering the knob in a UI or to an agent. Map-level knobs are always available
|
|
11410
|
-
* `view.terrain`, which needs the style to carry an elevation source.
|
|
11238
|
+
* offering the knob in a UI or to an agent. Map-level knobs are always available.
|
|
11411
11239
|
*/
|
|
11412
11240
|
available: boolean;
|
|
11413
11241
|
/** Which styles the knob works on; see {@link stylingKnobAppliesTo}. */
|
|
@@ -11461,7 +11289,15 @@ type StylingSettings = MapModuleCommonConfig & { [K in StylingKnobId]?: StylingK
|
|
|
11461
11289
|
/** @ignore */
|
|
11462
11290
|
type ScalableProperty = 'text-size' | 'icon-size' | 'line-width';
|
|
11463
11291
|
/** @ignore */
|
|
11464
|
-
type ColorProperty = Extract<PaintColorProperty, 'line-color' | 'text-color' | 'text-halo-color'>;
|
|
11292
|
+
type ColorProperty = Extract<PaintColorProperty, 'line-color' | 'text-color' | 'text-halo-color' | 'hillshade-shadow-color' | 'hillshade-highlight-color' | 'hillshade-accent-color'>;
|
|
11293
|
+
/**
|
|
11294
|
+
* Paint properties set as plain literals by the `paintLiteral` mechanism. Listed as values for the
|
|
11295
|
+
* same reason as `paintColorProperties`.
|
|
11296
|
+
* @ignore
|
|
11297
|
+
*/
|
|
11298
|
+
declare const literalPaintProperties: readonly ["hillshade-method", "hillshade-illumination-direction", "hillshade-exaggeration"];
|
|
11299
|
+
/** @ignore */
|
|
11300
|
+
type LiteralProperty = (typeof literalPaintProperties)[number];
|
|
11465
11301
|
/**
|
|
11466
11302
|
* How a knob reaches the style. A knob may use several (e.g. text and icon size together).
|
|
11467
11303
|
* @ignore
|
|
@@ -11493,6 +11329,17 @@ type KnobMechanism =
|
|
|
11493
11329
|
type: 'minZoom';
|
|
11494
11330
|
layers: LayerSelector[];
|
|
11495
11331
|
} |
|
|
11332
|
+
/** Sets the maximum zoom of the matched layers. */
|
|
11333
|
+
{
|
|
11334
|
+
type: 'maxZoom';
|
|
11335
|
+
layers: LayerSelector[];
|
|
11336
|
+
} |
|
|
11337
|
+
/** M2 — sets a paint property to the knob's value as a plain literal on the matched layers. */
|
|
11338
|
+
{
|
|
11339
|
+
type: 'paintLiteral';
|
|
11340
|
+
property: LiteralProperty;
|
|
11341
|
+
layers: LayerSelector[];
|
|
11342
|
+
} |
|
|
11496
11343
|
/** Shifts the `["-", ["zoom"], offset]` density term inside the matched layers' filters. */
|
|
11497
11344
|
{
|
|
11498
11345
|
type: 'zoomOffset';
|
|
@@ -11506,10 +11353,6 @@ type KnobMechanism =
|
|
|
11506
11353
|
{
|
|
11507
11354
|
type: 'sky';
|
|
11508
11355
|
} |
|
|
11509
|
-
/** Map-level: 3D terrain from the style's raster-dem source (exaggeration from the sibling knob). */
|
|
11510
|
-
{
|
|
11511
|
-
type: 'terrain';
|
|
11512
|
-
} |
|
|
11513
11356
|
/** Map-level: the colour behind the map canvas, which a globe leaves visible around the planet. */
|
|
11514
11357
|
{
|
|
11515
11358
|
type: 'space';
|
|
@@ -11543,6 +11386,121 @@ type KnobDefinitionOf<KIND extends StylingKnobKind> = KnobDefinition & {
|
|
|
11543
11386
|
* @ignore
|
|
11544
11387
|
*/
|
|
11545
11388
|
declare const knobDefinitions: {
|
|
11389
|
+
readonly 'hillshade.method': {
|
|
11390
|
+
readonly kind: "enum";
|
|
11391
|
+
readonly description: "How the relief is shaded: standard (one light), basic, igor (softer), combined, or multidirectional (four lights).";
|
|
11392
|
+
readonly options: readonly ["standard", "basic", "igor", "combined", "multidirectional"];
|
|
11393
|
+
readonly appliesTo: "tomtom-styles";
|
|
11394
|
+
readonly mechanisms: [{
|
|
11395
|
+
readonly type: "paintLiteral";
|
|
11396
|
+
readonly property: "hillshade-method";
|
|
11397
|
+
readonly layers: [LayerSelector];
|
|
11398
|
+
}];
|
|
11399
|
+
};
|
|
11400
|
+
readonly 'hillshade.lightDirection': {
|
|
11401
|
+
readonly kind: "number";
|
|
11402
|
+
readonly description: "Direction the light comes from, in degrees clockwise from north (335 is the cartographic default).";
|
|
11403
|
+
readonly range: {
|
|
11404
|
+
readonly min: 0;
|
|
11405
|
+
readonly max: 359;
|
|
11406
|
+
readonly step: 1;
|
|
11407
|
+
};
|
|
11408
|
+
readonly appliesTo: "tomtom-styles";
|
|
11409
|
+
readonly mechanisms: [{
|
|
11410
|
+
readonly type: "paintLiteral";
|
|
11411
|
+
readonly property: "hillshade-illumination-direction";
|
|
11412
|
+
readonly layers: [LayerSelector];
|
|
11413
|
+
}];
|
|
11414
|
+
};
|
|
11415
|
+
readonly 'hillshade.exaggeration': {
|
|
11416
|
+
readonly kind: "number";
|
|
11417
|
+
readonly description: "Strength of the shading (0 = flat). The standard styles ramp it to zero by zoom 13; setting it replaces the ramp with a constant.";
|
|
11418
|
+
readonly range: {
|
|
11419
|
+
readonly min: 0;
|
|
11420
|
+
readonly max: 1;
|
|
11421
|
+
readonly step: 0.05;
|
|
11422
|
+
};
|
|
11423
|
+
readonly appliesTo: "tomtom-styles";
|
|
11424
|
+
readonly mechanisms: [{
|
|
11425
|
+
readonly type: "paintLiteral";
|
|
11426
|
+
readonly property: "hillshade-exaggeration";
|
|
11427
|
+
readonly layers: [LayerSelector];
|
|
11428
|
+
}];
|
|
11429
|
+
};
|
|
11430
|
+
readonly 'hillshade.maxZoom': {
|
|
11431
|
+
readonly kind: "number";
|
|
11432
|
+
readonly description: "Zoom level up to which the shading is drawn (the standard styles stop at 13; 22 keeps it at every zoom).";
|
|
11433
|
+
readonly range: {
|
|
11434
|
+
readonly min: 10;
|
|
11435
|
+
readonly max: 22;
|
|
11436
|
+
readonly step: 1;
|
|
11437
|
+
};
|
|
11438
|
+
readonly appliesTo: "tomtom-styles";
|
|
11439
|
+
readonly mechanisms: [{
|
|
11440
|
+
readonly type: "maxZoom";
|
|
11441
|
+
readonly layers: [LayerSelector];
|
|
11442
|
+
}];
|
|
11443
|
+
};
|
|
11444
|
+
readonly 'hillshade.shadowColor': KnobDefinitionOf<"color">;
|
|
11445
|
+
readonly 'hillshade.highlightColor': KnobDefinitionOf<"color">;
|
|
11446
|
+
readonly 'hillshade.accentColor': KnobDefinitionOf<"color">;
|
|
11447
|
+
readonly 'view.projection': {
|
|
11448
|
+
readonly kind: "enum";
|
|
11449
|
+
readonly description: "How the map is drawn: flat Mercator or a globe. The globe flattens to Mercator between zoom 11 and 12 by design.";
|
|
11450
|
+
readonly options: readonly ["mercator", "globe"];
|
|
11451
|
+
readonly appliesTo: "any-style";
|
|
11452
|
+
readonly mechanisms: [{
|
|
11453
|
+
readonly type: "projection";
|
|
11454
|
+
}];
|
|
11455
|
+
};
|
|
11456
|
+
readonly 'view.sky': {
|
|
11457
|
+
readonly kind: "toggle";
|
|
11458
|
+
readonly description: "A sky with atmosphere behind the globe and above a tilted flat map. Without it MapLibre draws a fully transparent sky, so a globe arrives with no atmosphere.";
|
|
11459
|
+
readonly appliesTo: "any-style";
|
|
11460
|
+
readonly mechanisms: [{
|
|
11461
|
+
readonly type: "sky";
|
|
11462
|
+
}];
|
|
11463
|
+
};
|
|
11464
|
+
readonly 'view.skyColor': {
|
|
11465
|
+
readonly kind: "color";
|
|
11466
|
+
readonly description: "Colour of the sky (and of the atmosphere halo around the globe). Defaults to a daylit blue on a light style and a night blue on a dark one.";
|
|
11467
|
+
readonly appliesTo: "any-style";
|
|
11468
|
+
readonly mechanisms: [{
|
|
11469
|
+
readonly type: "sky";
|
|
11470
|
+
}];
|
|
11471
|
+
};
|
|
11472
|
+
readonly 'view.horizonColor': {
|
|
11473
|
+
readonly kind: "color";
|
|
11474
|
+
readonly description: "Colour of the sky at the horizon. Defaults with the style theme, so a dark map gets a dim horizon rather than a white one.";
|
|
11475
|
+
readonly appliesTo: "any-style";
|
|
11476
|
+
readonly mechanisms: [{
|
|
11477
|
+
readonly type: "sky";
|
|
11478
|
+
}];
|
|
11479
|
+
};
|
|
11480
|
+
readonly 'view.spaceColor': {
|
|
11481
|
+
readonly kind: "color";
|
|
11482
|
+
readonly description: "Colour behind the map, which a globe leaves visible around the planet. The map canvas is transparent, so without this the page background shows through. Defaults with the style theme: white on a light style, near-black on a dark one.";
|
|
11483
|
+
readonly appliesTo: "any-style";
|
|
11484
|
+
readonly mechanisms: [{
|
|
11485
|
+
readonly type: "space";
|
|
11486
|
+
}];
|
|
11487
|
+
};
|
|
11488
|
+
readonly "basemap.land": KnobDefinitionOf<"toggle">;
|
|
11489
|
+
readonly "basemap.water": KnobDefinitionOf<"toggle">;
|
|
11490
|
+
readonly "basemap.roads": KnobDefinitionOf<"toggle">;
|
|
11491
|
+
readonly "basemap.railways": KnobDefinitionOf<"toggle">;
|
|
11492
|
+
readonly "basemap.ferries": KnobDefinitionOf<"toggle">;
|
|
11493
|
+
readonly "basemap.borders": KnobDefinitionOf<"toggle">;
|
|
11494
|
+
readonly "basemap.natureLabels": KnobDefinitionOf<"toggle">;
|
|
11495
|
+
readonly "basemap.roadLabels": KnobDefinitionOf<"toggle">;
|
|
11496
|
+
readonly "basemap.roadShields": KnobDefinitionOf<"toggle">;
|
|
11497
|
+
readonly "basemap.houseNumbers": KnobDefinitionOf<"toggle">;
|
|
11498
|
+
readonly "basemap.smallerTownLabels": KnobDefinitionOf<"toggle">;
|
|
11499
|
+
readonly "basemap.stateLabels": KnobDefinitionOf<"toggle">;
|
|
11500
|
+
readonly "basemap.cityLabels": KnobDefinitionOf<"toggle">;
|
|
11501
|
+
readonly "basemap.allPlaceLabels": KnobDefinitionOf<"toggle">;
|
|
11502
|
+
readonly "basemap.capitalLabels": KnobDefinitionOf<"toggle">;
|
|
11503
|
+
readonly "basemap.countryLabels": KnobDefinitionOf<"toggle">;
|
|
11546
11504
|
readonly 'labels.sizeFactor': KnobDefinitionOf<"factor">;
|
|
11547
11505
|
readonly 'symbols.sizeFactor': KnobDefinitionOf<"factor">;
|
|
11548
11506
|
readonly 'roads.widthFactor': KnobDefinitionOf<"factor">;
|
|
@@ -11614,68 +11572,6 @@ declare const knobDefinitions: {
|
|
|
11614
11572
|
readonly 'colors.roadOutline': KnobDefinitionOf<"color">;
|
|
11615
11573
|
readonly 'colors.label': KnobDefinitionOf<"color">;
|
|
11616
11574
|
readonly 'colors.labelOutline': KnobDefinitionOf<"color">;
|
|
11617
|
-
readonly 'view.projection': {
|
|
11618
|
-
readonly kind: "enum";
|
|
11619
|
-
readonly description: "How the map is drawn: flat Mercator or a globe. The globe flattens to Mercator between zoom 11 and 12 by design.";
|
|
11620
|
-
readonly options: readonly ["mercator", "globe"];
|
|
11621
|
-
readonly appliesTo: "any-style";
|
|
11622
|
-
readonly mechanisms: [{
|
|
11623
|
-
readonly type: "projection";
|
|
11624
|
-
}];
|
|
11625
|
-
};
|
|
11626
|
-
readonly 'view.sky': {
|
|
11627
|
-
readonly kind: "toggle";
|
|
11628
|
-
readonly description: "A sky with atmosphere behind the globe and above a tilted flat map. Without it MapLibre draws a fully transparent sky, so a globe arrives with no atmosphere.";
|
|
11629
|
-
readonly appliesTo: "any-style";
|
|
11630
|
-
readonly mechanisms: [{
|
|
11631
|
-
readonly type: "sky";
|
|
11632
|
-
}];
|
|
11633
|
-
};
|
|
11634
|
-
readonly 'view.skyColor': {
|
|
11635
|
-
readonly kind: "color";
|
|
11636
|
-
readonly description: "Colour of the sky (and of the atmosphere halo around the globe). Defaults to a daylit blue on a light style and a night blue on a dark one.";
|
|
11637
|
-
readonly appliesTo: "any-style";
|
|
11638
|
-
readonly mechanisms: [{
|
|
11639
|
-
readonly type: "sky";
|
|
11640
|
-
}];
|
|
11641
|
-
};
|
|
11642
|
-
readonly 'view.horizonColor': {
|
|
11643
|
-
readonly kind: "color";
|
|
11644
|
-
readonly description: "Colour of the sky at the horizon. Defaults with the style theme, so a dark map gets a dim horizon rather than a white one.";
|
|
11645
|
-
readonly appliesTo: "any-style";
|
|
11646
|
-
readonly mechanisms: [{
|
|
11647
|
-
readonly type: "sky";
|
|
11648
|
-
}];
|
|
11649
|
-
};
|
|
11650
|
-
readonly 'view.spaceColor': {
|
|
11651
|
-
readonly kind: "color";
|
|
11652
|
-
readonly description: "Colour behind the map, which a globe leaves visible around the planet. The map canvas is transparent, so without this the page background shows through. Defaults with the style theme: white on a light style, near-black on a dark one.";
|
|
11653
|
-
readonly appliesTo: "any-style";
|
|
11654
|
-
readonly mechanisms: [{
|
|
11655
|
-
readonly type: "space";
|
|
11656
|
-
}];
|
|
11657
|
-
};
|
|
11658
|
-
readonly 'view.terrain': {
|
|
11659
|
-
readonly kind: "toggle";
|
|
11660
|
-
readonly description: "3D terrain from the style's elevation source (the hillshade style part). Needs a tilted camera to show; MapLibre's terrain fog starts at pitch 60, which is also its default maxPitch.";
|
|
11661
|
-
readonly appliesTo: "any-style";
|
|
11662
|
-
readonly mechanisms: [{
|
|
11663
|
-
readonly type: "terrain";
|
|
11664
|
-
}];
|
|
11665
|
-
};
|
|
11666
|
-
readonly 'view.terrainExaggeration': {
|
|
11667
|
-
readonly kind: "number";
|
|
11668
|
-
readonly description: "Vertical exaggeration of the 3D terrain (1 = true elevation).";
|
|
11669
|
-
readonly range: {
|
|
11670
|
-
readonly min: 0.5;
|
|
11671
|
-
readonly max: 3;
|
|
11672
|
-
readonly step: 0.1;
|
|
11673
|
-
};
|
|
11674
|
-
readonly appliesTo: "any-style";
|
|
11675
|
-
readonly mechanisms: [{
|
|
11676
|
-
readonly type: "terrain";
|
|
11677
|
-
}];
|
|
11678
|
-
};
|
|
11679
11575
|
};
|
|
11680
11576
|
/**
|
|
11681
11577
|
* The id of a styling knob — see {@link StylingModule.describe} for what each one does.
|
|
@@ -11710,6 +11606,112 @@ type ValueOfKind<KIND extends StylingKnobKind> = KIND extends 'toggle' ? boolean
|
|
|
11710
11606
|
*/
|
|
11711
11607
|
type StylingKnobValueOf<ID extends StylingKnobId> = ValueOfKind<(typeof knobDefinitions)[ID]['kind']>;
|
|
11712
11608
|
//#endregion
|
|
11609
|
+
//#region src/styling/layerQuery.d.ts
|
|
11610
|
+
/**
|
|
11611
|
+
* How {@link StylingModule.layers} picks style layers: by the SDK's base-map group taxonomy, layer
|
|
11612
|
+
* type, vector-tile source layer and case-insensitive id fragments. Every constraint given must hold.
|
|
11613
|
+
*
|
|
11614
|
+
* @group Map Styling
|
|
11615
|
+
*/
|
|
11616
|
+
type LayerQuery = {
|
|
11617
|
+
/** A base-map layer group, the same vocabulary as {@link BaseMapModule}. */
|
|
11618
|
+
group?: BaseMapLayerGroupName;
|
|
11619
|
+
/** The style's own `metadata.group` values, for groups the SDK does not name. */
|
|
11620
|
+
metadataGroups?: string[];
|
|
11621
|
+
/** Layer types (`line`, `fill`, `symbol`, …). */
|
|
11622
|
+
layerTypes?: LayerSpecification['type'][];
|
|
11623
|
+
/** Vector-tile source layers (`roads`, `places`, `poi`, …). */
|
|
11624
|
+
sourceLayers?: string[];
|
|
11625
|
+
/** The layer id must contain one of these (case-insensitive). */
|
|
11626
|
+
idIncludes?: string[];
|
|
11627
|
+
/** The layer id must contain none of these (case-insensitive). */
|
|
11628
|
+
idExcludes?: string[];
|
|
11629
|
+
};
|
|
11630
|
+
type PropertyOverride = {
|
|
11631
|
+
kind: 'paint' | 'layout';
|
|
11632
|
+
property: string;
|
|
11633
|
+
value: unknown;
|
|
11634
|
+
};
|
|
11635
|
+
/**
|
|
11636
|
+
* The advanced tier of the styling module: raw MapLibre paint, layout and filter edits over a
|
|
11637
|
+
* query of style layers, re-applied across style switches.
|
|
11638
|
+
*
|
|
11639
|
+
* @remarks
|
|
11640
|
+
* **This is the version-coupled tier.** Layer ids, expressions and even which layers exist belong to
|
|
11641
|
+
* the loaded style version, so an edit may match nothing on the next one: the selection is then empty
|
|
11642
|
+
* and the SDK warns once. Prefer a knob or {@link StylingModule.setMapColors} where one fits.
|
|
11643
|
+
*
|
|
11644
|
+
* Overrides are not part of `getConfig()`: they are edits to this style, not portable settings.
|
|
11645
|
+
*
|
|
11646
|
+
* @example
|
|
11647
|
+
* ```typescript
|
|
11648
|
+
* styling.layers.query({ group: 'roadLabels' }).setPaint({ 'text-color': '#93c5fd' });
|
|
11649
|
+
* styling.layers.query({ metadataGroups: ['water'], layerTypes: ['fill'] }).setPaint({ 'fill-opacity': 0.6 });
|
|
11650
|
+
* styling.layers.query({ idIncludes: ['railway'] }).setVisible(false);
|
|
11651
|
+
* styling.layers.query({ group: 'roadLabels' }).reset();
|
|
11652
|
+
* ```
|
|
11653
|
+
*
|
|
11654
|
+
* @group Map Styling
|
|
11655
|
+
*/
|
|
11656
|
+
export declare class LayerSelection {
|
|
11657
|
+
private readonly registry;
|
|
11658
|
+
readonly query: LayerQuery;
|
|
11659
|
+
/**
|
|
11660
|
+
* @ignore
|
|
11661
|
+
*/
|
|
11662
|
+
constructor(registry: LayerOverrides, query: LayerQuery);
|
|
11663
|
+
/**
|
|
11664
|
+
* The ids of the layers the query matches in the loaded style, in draw order. Empty when the
|
|
11665
|
+
* style has no such layers.
|
|
11666
|
+
*/
|
|
11667
|
+
get layerIds(): string[];
|
|
11668
|
+
/** Sets paint properties on every matched layer. */
|
|
11669
|
+
setPaint(paint: Partial<AllPaintProperties>): this;
|
|
11670
|
+
/** Sets layout properties on every matched layer. */
|
|
11671
|
+
setLayout(layout: Partial<AllLayoutProperties>): this;
|
|
11672
|
+
/**
|
|
11673
|
+
* Replaces the filter the style gave every matched layer. The filters other modules add, such as
|
|
11674
|
+
* POI categories and traffic filters, still narrow it.
|
|
11675
|
+
*/
|
|
11676
|
+
setFilter(filter: FilterSpecification | undefined): this;
|
|
11677
|
+
/** Shows or hides every matched layer. */
|
|
11678
|
+
setVisible(visible: boolean): this;
|
|
11679
|
+
/** Removes every override made through the styling module on the matched layers. */
|
|
11680
|
+
reset(): this;
|
|
11681
|
+
}
|
|
11682
|
+
/**
|
|
11683
|
+
* The styling module's registry of raw layer overrides: resolves queries against the loaded style,
|
|
11684
|
+
* applies overrides, remembers what each property was before, and re-applies after a style switch.
|
|
11685
|
+
* Filters go through the map's {@link LayerFilterComposer}, which holds the style's own filter.
|
|
11686
|
+
* @ignore
|
|
11687
|
+
*/
|
|
11688
|
+
declare class LayerOverrides {
|
|
11689
|
+
private readonly mapLibreMap;
|
|
11690
|
+
private readonly filterComposer;
|
|
11691
|
+
private readonly warn;
|
|
11692
|
+
private layers;
|
|
11693
|
+
private sources;
|
|
11694
|
+
private readonly properties;
|
|
11695
|
+
private readonly filters;
|
|
11696
|
+
constructor(mapLibreMap: Map, filterComposer: LayerFilterComposer, warn: (key: string, message: string) => void);
|
|
11697
|
+
/** Points the registry at a freshly loaded style; overrides are kept and re-applied by {@link reapply}. */
|
|
11698
|
+
index(layers: LayerSpecification[], sources: StyleSources): void;
|
|
11699
|
+
/** Forgets every override (a clean style switch, which also clears the filter composer). */
|
|
11700
|
+
clear(): void;
|
|
11701
|
+
resolve(query: LayerQuery): string[];
|
|
11702
|
+
override(query: LayerQuery, override: PropertyOverride): void;
|
|
11703
|
+
overrideFilter(query: LayerQuery, filter: FilterSpecification | undefined): void;
|
|
11704
|
+
reset(query: LayerQuery): void;
|
|
11705
|
+
/**
|
|
11706
|
+
* Lands every override again on top of the current style. What an override replaces is re-read
|
|
11707
|
+
* only where something else wrote under it since (a new style, or a knob on the same property);
|
|
11708
|
+
* a layer still carrying the override keeps the value it replaced.
|
|
11709
|
+
*/
|
|
11710
|
+
reapply(): void;
|
|
11711
|
+
private read;
|
|
11712
|
+
private write;
|
|
11713
|
+
}
|
|
11714
|
+
//#endregion
|
|
11713
11715
|
//#region src/styling/StylingModule.d.ts
|
|
11714
11716
|
/**
|
|
11715
11717
|
* Event surface of {@link StylingModule}: it owns no map features, so only the lifecycle half is
|
|
@@ -11777,6 +11779,7 @@ export declare class StylingModule extends AbstractStyleOwnedMapModule<Record<st
|
|
|
11777
11779
|
private warned;
|
|
11778
11780
|
private reindexed;
|
|
11779
11781
|
private originalSpaceColor;
|
|
11782
|
+
private layerOverrides;
|
|
11780
11783
|
/**
|
|
11781
11784
|
* Retrieves the styling module of the given map, creating it on first use.
|
|
11782
11785
|
*
|
|
@@ -11808,6 +11811,23 @@ export declare class StylingModule extends AbstractStyleOwnedMapModule<Record<st
|
|
|
11808
11811
|
* @ignore
|
|
11809
11812
|
*/
|
|
11810
11813
|
protected _applyConfig(settings: StylingSettings | undefined): StylingSettings | undefined;
|
|
11814
|
+
/**
|
|
11815
|
+
* @ignore
|
|
11816
|
+
*/
|
|
11817
|
+
protected discardShownData(): void;
|
|
11818
|
+
/**
|
|
11819
|
+
* The advanced tier: raw MapLibre paint, layout and filter edits over a query of style layers,
|
|
11820
|
+
* re-applied across style switches. Version-coupled by nature — see {@link LayerSelection} for
|
|
11821
|
+
* the terms — so prefer a knob or {@link setMapColors} wherever one covers the intent.
|
|
11822
|
+
*
|
|
11823
|
+
* @example
|
|
11824
|
+
* ```typescript
|
|
11825
|
+
* styling.layers.query({ group: 'roadLabels' }).setPaint({ 'text-color': '#93c5fd' });
|
|
11826
|
+
* ```
|
|
11827
|
+
*/
|
|
11828
|
+
get layers(): {
|
|
11829
|
+
query: (query: LayerQuery) => LayerSelection;
|
|
11830
|
+
};
|
|
11811
11831
|
/**
|
|
11812
11832
|
* The styling catalogue for the loaded style: every knob with its kind, range, default, current
|
|
11813
11833
|
* value and how many layers it reaches.
|
|
@@ -11825,7 +11845,7 @@ export declare class StylingModule extends AbstractStyleOwnedMapModule<Record<st
|
|
|
11825
11845
|
describe(): StylingCatalogue;
|
|
11826
11846
|
/**
|
|
11827
11847
|
* Applies a preset: a named bundle of knob settings the SDK ships for a common intent
|
|
11828
|
-
* (`data-viz`, `night-driving`, `minimal`, `globe
|
|
11848
|
+
* (`data-viz`, `night-driving`, `minimal`, `globe`). See `describe().presets` for
|
|
11829
11849
|
* what each one sets.
|
|
11830
11850
|
*
|
|
11831
11851
|
* @param id - The preset to apply.
|
|
@@ -11934,17 +11954,17 @@ export declare class StylingModule extends AbstractStyleOwnedMapModule<Record<st
|
|
|
11934
11954
|
private capture;
|
|
11935
11955
|
private originalValueOf;
|
|
11936
11956
|
private resolveMapColor;
|
|
11937
|
-
private demSourceId;
|
|
11938
11957
|
private refreshKnob;
|
|
11939
11958
|
private refreshMechanism;
|
|
11959
|
+
private refreshLayer;
|
|
11940
11960
|
private refreshSpace;
|
|
11941
11961
|
private defaultSpaceColor;
|
|
11942
11962
|
private refreshMapColorProperty;
|
|
11943
11963
|
private refreshProjection;
|
|
11944
11964
|
private refreshSky;
|
|
11945
|
-
private refreshTerrain;
|
|
11946
11965
|
private refreshVisibility;
|
|
11947
|
-
private
|
|
11966
|
+
private refreshZoomBound;
|
|
11967
|
+
private styleZoomBound;
|
|
11948
11968
|
private refreshZoomOffset;
|
|
11949
11969
|
private refreshScaledProperty;
|
|
11950
11970
|
private refreshColor;
|
|
@@ -11957,6 +11977,143 @@ export declare class StylingModule extends AbstractStyleOwnedMapModule<Record<st
|
|
|
11957
11977
|
private warnOnce;
|
|
11958
11978
|
}
|
|
11959
11979
|
//#endregion
|
|
11980
|
+
//#region src/terrain/types/terrainModuleConfig.d.ts
|
|
11981
|
+
/**
|
|
11982
|
+
* Configuration of the {@link TerrainModule}: the two ways it draws the relief of the style's
|
|
11983
|
+
* elevation data.
|
|
11984
|
+
*
|
|
11985
|
+
* @remarks
|
|
11986
|
+
* Unset, the hillshade is hidden like the other style parts the SDK adds (traffic flow and
|
|
11987
|
+
* incidents), and the surface is left as the map draws it: flat on TomTom styles. So
|
|
11988
|
+
* `resetConfig()` returns a TomTom style to flat and unshaded.
|
|
11989
|
+
*
|
|
11990
|
+
* @example
|
|
11991
|
+
* ```typescript
|
|
11992
|
+
* const config: TerrainModuleConfig = { hillshade: true, elevation: true, elevationExaggeration: 1.5 };
|
|
11993
|
+
* ```
|
|
11994
|
+
*
|
|
11995
|
+
* @group Terrain
|
|
11996
|
+
*/
|
|
11997
|
+
type TerrainModuleConfig = MapModuleCommonConfig & {
|
|
11998
|
+
/**
|
|
11999
|
+
* Shows the hillshade: light and shadow on the map surface that reveal hills, valleys and
|
|
12000
|
+
* mountains, at any camera pitch. Its look is set by the `hillshade.*` knobs of {@link StylingModule}.
|
|
12001
|
+
*
|
|
12002
|
+
* @default false
|
|
12003
|
+
*/
|
|
12004
|
+
hillshade?: boolean;
|
|
12005
|
+
/**
|
|
12006
|
+
* Raises the map surface to the elevation data in 3D, or flattens it. Shows best with a
|
|
12007
|
+
* pitched camera.
|
|
12008
|
+
*
|
|
12009
|
+
* @default The map's own terrain, if its style or MapLibre code raised one; none on TomTom styles.
|
|
12010
|
+
*/
|
|
12011
|
+
elevation?: boolean;
|
|
12012
|
+
/**
|
|
12013
|
+
* Vertical scaling of the 3D surface: `1` is true elevation, higher values emphasise the
|
|
12014
|
+
* relief. Kept while `elevation` is off, so turning it back on restores it.
|
|
12015
|
+
*
|
|
12016
|
+
* @default 1
|
|
12017
|
+
*/
|
|
12018
|
+
elevationExaggeration?: number;
|
|
12019
|
+
};
|
|
12020
|
+
//#endregion
|
|
12021
|
+
//#region src/terrain/TerrainModule.d.ts
|
|
12022
|
+
/**
|
|
12023
|
+
* The style source this module draws from: the raster-dem elevation source of the hillshade
|
|
12024
|
+
* style part, with its hillshade layers.
|
|
12025
|
+
*/
|
|
12026
|
+
type TerrainSourcesWithLayers = {
|
|
12027
|
+
hillshade: StyleSourceWithLayers;
|
|
12028
|
+
};
|
|
12029
|
+
/**
|
|
12030
|
+
* Map module for the terrain relief: hillshade shading and the 3D surface, both drawn from the
|
|
12031
|
+
* elevation data of the map style.
|
|
12032
|
+
*
|
|
12033
|
+
* @remarks
|
|
12034
|
+
* - **Hillshade** shades slopes on the flat map, so the relief reads at any pitch.
|
|
12035
|
+
* - **Elevation** raises the map surface in 3D, which a pitched camera shows. Combined with the
|
|
12036
|
+
* hillshade, a slope stays readable where the camera flattens it.
|
|
12037
|
+
*
|
|
12038
|
+
* `get()` adds the elevation style part when the style lacks it, and the module restores both
|
|
12039
|
+
* after every style change. The 3D surface reads its own copy of the elevation source,
|
|
12040
|
+
* {@link TERRAIN_SOURCE_ID}.
|
|
12041
|
+
*
|
|
12042
|
+
* @example
|
|
12043
|
+
* ```typescript
|
|
12044
|
+
* const terrain = await TerrainModule.get(map, { hillshade: true, elevation: true, elevationExaggeration: 1.3 });
|
|
12045
|
+
* terrain.setElevationExaggeration(2);
|
|
12046
|
+
* terrain.setElevationEnabled(false); // flat again, still shaded
|
|
12047
|
+
* ```
|
|
12048
|
+
*
|
|
12049
|
+
* @see [Terrain Guide](https://docs.tomtom.com/maps-sdk-js/guides/map/terrain)
|
|
12050
|
+
*
|
|
12051
|
+
* @group Terrain
|
|
12052
|
+
*/
|
|
12053
|
+
export declare class TerrainModule extends AbstractStyleOwnedMapModule<TerrainSourcesWithLayers, TerrainModuleConfig> {
|
|
12054
|
+
private mapTerrain;
|
|
12055
|
+
private overridesMapTerrain;
|
|
12056
|
+
/**
|
|
12057
|
+
* Retrieves the terrain module of the given map, adding the elevation style part first when
|
|
12058
|
+
* the style lacks it.
|
|
12059
|
+
*
|
|
12060
|
+
* @param config - Without it the hillshade is hidden, and the surface stays as the map draws it.
|
|
12061
|
+
*
|
|
12062
|
+
* @remarks
|
|
12063
|
+
* **Instances:** one per map — a second `get()` returns the same instance, with the given config
|
|
12064
|
+
* applied to it.
|
|
12065
|
+
*
|
|
12066
|
+
* @throws Error if the elevation source cannot be added to the style.
|
|
12067
|
+
*/
|
|
12068
|
+
static get(map: TomTomMap, config?: TerrainModuleConfig): Promise<TerrainModule>;
|
|
12069
|
+
private constructor();
|
|
12070
|
+
/**
|
|
12071
|
+
* @ignore
|
|
12072
|
+
*/
|
|
12073
|
+
protected _initSourcesWithLayers(): {
|
|
12074
|
+
hillshade: StyleSourceWithLayers<import("maplibre-gl").SourceSpecification, import("maplibre-gl").Source>;
|
|
12075
|
+
};
|
|
12076
|
+
/**
|
|
12077
|
+
* @ignore
|
|
12078
|
+
*/
|
|
12079
|
+
protected _applyConfig(config: TerrainModuleConfig | undefined): TerrainModuleConfig | undefined;
|
|
12080
|
+
/**
|
|
12081
|
+
* Shows or hides the hillshade shading.
|
|
12082
|
+
*/
|
|
12083
|
+
setHillshadeVisible(visible: boolean): void;
|
|
12084
|
+
/**
|
|
12085
|
+
* Whether the hillshade shading is shown.
|
|
12086
|
+
*/
|
|
12087
|
+
isHillshadeVisible(): boolean;
|
|
12088
|
+
/**
|
|
12089
|
+
* Raises the map surface in 3D, or flattens it, keeping the configured exaggeration.
|
|
12090
|
+
*/
|
|
12091
|
+
setElevationEnabled(enabled: boolean): void;
|
|
12092
|
+
/**
|
|
12093
|
+
* Whether the map surface is raised in 3D.
|
|
12094
|
+
*/
|
|
12095
|
+
isElevationEnabled(): boolean;
|
|
12096
|
+
/**
|
|
12097
|
+
* Sets the vertical {@link TerrainModuleConfig.elevationExaggeration | exaggeration} of the 3D
|
|
12098
|
+
* surface, kept for when elevation is enabled later.
|
|
12099
|
+
*/
|
|
12100
|
+
setElevationExaggeration(elevationExaggeration: number): void;
|
|
12101
|
+
/**
|
|
12102
|
+
* Lifecycle events of this module. The hillshade is a raster layer with no features to
|
|
12103
|
+
* interact with, so there are no user interaction events; `config-change` fires after every
|
|
12104
|
+
* change.
|
|
12105
|
+
*
|
|
12106
|
+
* @example
|
|
12107
|
+
* ```typescript
|
|
12108
|
+
* const unsubscribe = terrain.events.on('config-change', (config) => console.log(config));
|
|
12109
|
+
* ```
|
|
12110
|
+
*/
|
|
12111
|
+
get events(): ModuleEvents<TerrainModuleConfig>;
|
|
12112
|
+
private showHillshade;
|
|
12113
|
+
private showElevation;
|
|
12114
|
+
private storeConfig;
|
|
12115
|
+
}
|
|
12116
|
+
//#endregion
|
|
11960
12117
|
//#region src/traffic/types/trafficAreaAnalyticsConfig.d.ts
|
|
11961
12118
|
/**
|
|
11962
12119
|
* A single stop in an analytics color ramp.
|
|
@@ -12569,6 +12726,7 @@ export declare class TrafficAreaAnalyticsModule extends AbstractDataOwnedMapModu
|
|
|
12569
12726
|
protected _initSourcesWithLayers(config?: TrafficAreaAnalyticsConfig, _restore?: boolean): AreaAnalyticsSourcesWithLayers;
|
|
12570
12727
|
/** @ignore */
|
|
12571
12728
|
protected _applyConfig(config: TrafficAreaAnalyticsConfig | undefined): TrafficAreaAnalyticsConfig | undefined;
|
|
12729
|
+
private moveLayersToSpecPositions;
|
|
12572
12730
|
/** @ignore */
|
|
12573
12731
|
protected discardShownData(): void;
|
|
12574
12732
|
/** @ignore */
|
|
@@ -14170,4 +14328,4 @@ export declare const calculatePaddedCenter: (options: CalculateMapCenterOptions)
|
|
|
14170
14328
|
*/
|
|
14171
14329
|
export declare const calculateFittingBBox: (options: CalculateFittingBBoxOptions) => BBox | null;
|
|
14172
14330
|
//#endregion
|
|
14173
|
-
export type { AREA_ANALYTICS_DEFAULTS, AreaAnalyticsBeforeLayerConfig, AreaAnalyticsColorStop, AreaAnalyticsColorStopsConfig, AreaAnalyticsColorTheme, AreaAnalyticsDisplayMode, AreaAnalyticsHeightConfig, AreaAnalyticsMetricConfig, AreaAnalyticsMetricFilter, AreaAnalyticsRegionPolygonConfig, AreaAnalyticsValueType, AvailabilityLevel, BeforeLayerConfig, BespokeSectionType, ByIdOrIndex, CSSCursor, ChargingSpeedIconMapping, ChargingStopIconConfig, ChargingStopIconMapping, ChargingStopTextConfig, ChargingStopsConfig, CleanEventStateOptions, CleanEventStatesOptions, ClickEventType, CountryCrossingAlignment, CountryCrossingConfig, CountryCrossingFeature, CustomImage, DefaultPlaceIconConfig, DisplayCountryCrossing, DisplayCountryCrossingProps, DisplayCountryCrossings, DisplayRouteProps, DisplayRouteRelatedProps, DisplayRouteSummaries, DisplayRouteSummary, DisplayRouteSummaryProps, DrawnSectionType, EVAvailabilityConfig, EventHandlerConfig, EventHandlerCursorConfig, EventType, ExtraFeatureProp, FeaturePropValue, FilterShowMode, FilterablePOICategory, GeneratedSectionType, GeoJSONSourcesWithLayers, HasAdditionalLayersConfig, HasBeforeID,
|
|
14331
|
+
export type { AREA_ANALYTICS_DEFAULTS, AreaAnalyticsBeforeLayerConfig, AreaAnalyticsColorStop, AreaAnalyticsColorStopsConfig, AreaAnalyticsColorTheme, AreaAnalyticsDisplayMode, AreaAnalyticsHeightConfig, AreaAnalyticsMetricConfig, AreaAnalyticsMetricFilter, AreaAnalyticsRegionPolygonConfig, AreaAnalyticsValueType, AvailabilityLevel, BeforeLayerConfig, BespokeSectionType, ByIdOrIndex, CSSCursor, ChargingSpeedIconMapping, ChargingStopIconConfig, ChargingStopIconMapping, ChargingStopTextConfig, ChargingStopsConfig, CleanEventStateOptions, CleanEventStatesOptions, ClickEventType, CountryCrossingAlignment, CountryCrossingConfig, CountryCrossingFeature, CustomImage, DefaultPlaceIconConfig, DisplayCountryCrossing, DisplayCountryCrossingProps, DisplayCountryCrossings, DisplayRouteProps, DisplayRouteRelatedProps, DisplayRouteSummaries, DisplayRouteSummary, DisplayRouteSummaryProps, DrawnSectionType, EVAvailabilityConfig, EventHandlerConfig, EventHandlerCursorConfig, EventType, ExtraFeatureProp, FeaturePropValue, FilterShowMode, FilterablePOICategory, GeneratedSectionType, GeoJSONSourcesWithLayers, HasAdditionalLayersConfig, HasBeforeID, HoverEventType, IncidentFocusStyle, LayerQuery, LayerSpecFilter, LayerSpecTemplate, LayerSpecWithSource, LightDark, MapColorName, MapColors, MapEventsConfig, MapFont, MapModuleCommonConfig, MapStyleLayerID, POIsModuleConfig, POIsModuleFeature, PlaceConnectionDisplay, PlaceConnectionLayerName, PlaceConnectionsConfig, PlaceConnectionsLayersConfig, PlaceIconConfig, PlaceLayerName, PlaceLayersConfig, PlaceTextConfig, PlacesModuleConfig, PlacesTheme, PlanningWaypoint, PutEventStateOptions, RGBAColor, RouteLayersConfig, RouteStateProps, RouteTheme, RouteWaypointSize, RouteWidth, RoutingModuleConfig, SVGIconStyleOptions, SectionDisplayConfig, SectionDrawStyle, SectionIconConfig, SectionKnobName, SectionKnobOf, SectionLineLayerName, SectionLinePattern, SectionSignConfig, SectionSignLayerName, SectionSignPlacement, SectionSignPriority, SectionSignUnit, SectionSourceKey, SectionSymbolLayerName, SectionsDisplayConfig, SourceWithLayerIDs, SourceWithLayers, SourcesWithLayers, StyleSourcesWithLayers, StylingCatalogue, StylingColorKnobId, StylingKnobAppliesTo, StylingKnobDescriptor, StylingKnobId, StylingKnobKind, StylingKnobRange, StylingKnobValue, StylingKnobValueOf, StylingPresetDescriptor, StylingPresetId, StylingSettings, SupportsEvents, SymbolLayerSpecWithoutSource, TRAFFIC_LIGHT_COLORS, TerrainModuleConfig, ToBeAddedLayerSpec, ToBeAddedLayerSpecTemplate, ToBeAddedLayerSpecWithoutSource, TrafficAreaAnalyticsConfig, TrafficIncidentOverlayConfig, UserEventHandler, ValuesFilter, WaypointsConfig };
|