@xweather/mapsgl 1.8.5 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mapsgl.css +2 -2
- package/dist/mapsgl.d.ts +537 -156
- package/dist/mapsgl.js +4 -4
- package/package.json +1 -1
package/dist/mapsgl.d.ts
CHANGED
|
@@ -546,6 +546,8 @@ declare const enum ShaderType {
|
|
|
546
546
|
FRAGMENT = "fragment"
|
|
547
547
|
}
|
|
548
548
|
|
|
549
|
+
export declare const sharedFPSMeter: FPSMeter;
|
|
550
|
+
|
|
549
551
|
export declare type Size = {
|
|
550
552
|
width: number;
|
|
551
553
|
height: number;
|
|
@@ -1064,7 +1066,7 @@ export declare class Animation extends EventDispatcher {
|
|
|
1064
1066
|
/**
|
|
1065
1067
|
* Stops the animation and resets it to its original starting position.
|
|
1066
1068
|
*/
|
|
1067
|
-
stop(): void;
|
|
1069
|
+
stop(advanceToStopPosition?: boolean): void;
|
|
1068
1070
|
/**
|
|
1069
1071
|
* Restarts the animation from the beginning if it is currently playing.
|
|
1070
1072
|
*/
|
|
@@ -1207,6 +1209,8 @@ export declare type AnimationState = ObjectValue<typeof AnimationState>;
|
|
|
1207
1209
|
export declare type AnyAuthenticator = Authenticator<any>;
|
|
1208
1210
|
|
|
1209
1211
|
export declare type AnyMapController = MapController<any>;
|
|
1212
|
+
|
|
1213
|
+
export declare type AnyTileCache = TileCache<any>;
|
|
1210
1214
|
|
|
1211
1215
|
/**
|
|
1212
1216
|
* An enumerated value representing an API endpoint action.
|
|
@@ -1851,6 +1855,10 @@ export declare interface ColorScaleOptions {
|
|
|
1851
1855
|
*/
|
|
1852
1856
|
masks?: Array<ColorMaskOptions>;
|
|
1853
1857
|
}
|
|
1858
|
+
|
|
1859
|
+
export declare class ConstantStyleValue<T> extends StyleValue_2<T> {
|
|
1860
|
+
constructor(value: T | any[] | StyleEvaulatorFunction<T>);
|
|
1861
|
+
}
|
|
1854
1862
|
|
|
1855
1863
|
/**
|
|
1856
1864
|
* Contour style properties control how contoured data gets rendered on a map. Contour layers are rendered by sampling
|
|
@@ -1867,7 +1875,13 @@ export declare interface ContourStyleSpec {
|
|
|
1867
1875
|
* major contour lines will not be rendered. This value must be in the same units as the data source.
|
|
1868
1876
|
*/
|
|
1869
1877
|
majorInterval: StyleValue<number>;
|
|
1878
|
+
/**
|
|
1879
|
+
* The width of the contour lines in pixels.
|
|
1880
|
+
*/
|
|
1870
1881
|
width: StyleValue<number>;
|
|
1882
|
+
/**
|
|
1883
|
+
* The width of the major contour lines in pixels.
|
|
1884
|
+
*/
|
|
1871
1885
|
majorWidth: StyleValue<number>;
|
|
1872
1886
|
scale: StyleValue<number>;
|
|
1873
1887
|
offset: StyleValue<number>;
|
|
@@ -1881,7 +1895,9 @@ export declare interface ControlStore {
|
|
|
1881
1895
|
dataInspector: DataInspectorControl;
|
|
1882
1896
|
}
|
|
1883
1897
|
|
|
1884
|
-
declare
|
|
1898
|
+
export declare type ConversionMeasurement = Measurement | 'temperature-change';
|
|
1899
|
+
|
|
1900
|
+
declare const convert: (type: ConversionMeasurement | string, value: number, from: string, to: string) => number;
|
|
1885
1901
|
|
|
1886
1902
|
export declare type Coordinate = {
|
|
1887
1903
|
lat: number;
|
|
@@ -1904,6 +1920,9 @@ declare const CtoF: (c: number) => number;
|
|
|
1904
1920
|
|
|
1905
1921
|
declare const CtoFUnit: (c: number) => number;
|
|
1906
1922
|
|
|
1923
|
+
export declare class DataDrivenStyleValue<T> extends StyleValue_2<T> {
|
|
1924
|
+
}
|
|
1925
|
+
|
|
1907
1926
|
export declare interface DataEvaluator {
|
|
1908
1927
|
title: string | ((data: FeatureQueryResult) => string);
|
|
1909
1928
|
alwaysShow?: boolean;
|
|
@@ -1947,6 +1966,7 @@ export declare class DataInspectorControl {
|
|
|
1947
1966
|
export declare interface DataInspectorControlOptions {
|
|
1948
1967
|
event: 'click' | 'move';
|
|
1949
1968
|
stream: boolean;
|
|
1969
|
+
showCoordinates: boolean;
|
|
1950
1970
|
tooltip: any;
|
|
1951
1971
|
}
|
|
1952
1972
|
|
|
@@ -2092,6 +2112,7 @@ export declare interface Disposable {
|
|
|
2092
2112
|
* @template Task - The download task type that extends DownloadTask
|
|
2093
2113
|
*/
|
|
2094
2114
|
export declare class DownloadManager<Task extends DownloadTask<any>> extends EventDispatcher {
|
|
2115
|
+
id: string;
|
|
2095
2116
|
|
|
2096
2117
|
/**
|
|
2097
2118
|
* Gets the progress tracker for download operations.
|
|
@@ -2108,7 +2129,7 @@ export declare class DownloadManager<Task extends DownloadTask<any>> extends Eve
|
|
|
2108
2129
|
* @param options.defaultConcurrency - Default maximum concurrent downloads. Defaults to 16.
|
|
2109
2130
|
* @param options.perHostConcurrency - Per-host concurrency limits, keyed by host name.
|
|
2110
2131
|
*/
|
|
2111
|
-
constructor(options?: Partial<DownloadManagerOptions<
|
|
2132
|
+
constructor(options?: Partial<DownloadManagerOptions<Task>>);
|
|
2112
2133
|
/**
|
|
2113
2134
|
* Checks if a task result exists in the cache.
|
|
2114
2135
|
* @param key - The unique identifier for the task.
|
|
@@ -2438,11 +2459,16 @@ export declare class EncodedTileSource<Source extends EncodedSourceSpecification
|
|
|
2438
2459
|
shouldUseTimesFromMetadata: boolean;
|
|
2439
2460
|
maxTextureSize: number;
|
|
2440
2461
|
private _worker;
|
|
2462
|
+
private _aggregateProgress;
|
|
2441
2463
|
|
|
2442
2464
|
get type(): string;
|
|
2465
|
+
get operation(): TimeSeriesOperationType;
|
|
2443
2466
|
constructor(id: string, spec: Partial<Source>);
|
|
2444
|
-
|
|
2445
|
-
|
|
2467
|
+
|
|
2468
|
+
shouldRequestTile(tile: Tile<EncodedTileData>, reload?: boolean, intervals?: Array<Date>): boolean;
|
|
2469
|
+
abortTileByCoord(coord: TileCoord): void;
|
|
2470
|
+
|
|
2471
|
+
/**
|
|
2446
2472
|
* Returns the metadata for the specified band, if available.
|
|
2447
2473
|
* @param band - The band to get metadata for.
|
|
2448
2474
|
* @returns
|
|
@@ -2456,6 +2482,7 @@ export declare class EncodedTileSource<Source extends EncodedSourceSpecification
|
|
|
2456
2482
|
*/
|
|
2457
2483
|
getDataRange(band: SampleChannel): ValueRange;
|
|
2458
2484
|
|
|
2485
|
+
protected onLoadProgress(e: any): void;
|
|
2459
2486
|
}
|
|
2460
2487
|
|
|
2461
2488
|
/**
|
|
@@ -2466,24 +2493,17 @@ export declare class EncodedTileSource<Source extends EncodedSourceSpecification
|
|
|
2466
2493
|
*/
|
|
2467
2494
|
declare const equalUnits: (units1: MapUnits, units2: MapUnits) => boolean;
|
|
2468
2495
|
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
'
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
'at',
|
|
2481
|
-
number,
|
|
2482
|
-
Array<any>
|
|
2483
|
-
] | [
|
|
2484
|
-
'length',
|
|
2485
|
-
string | number | Array<any>
|
|
2486
|
-
];
|
|
2496
|
+
/**
|
|
2497
|
+
* Mapbox-style expression: operator name followed by arguments.
|
|
2498
|
+
* Arguments may be literals or nested expressions (recursive).
|
|
2499
|
+
*/
|
|
2500
|
+
export declare type Expression = [ExpressionOperator, ...ExpressionValue[]];
|
|
2501
|
+
|
|
2502
|
+
/**
|
|
2503
|
+
* Mapbox-style expression array, e.g. ['get', 'opacity'] or ['*', ['get', 'x'], 2].
|
|
2504
|
+
* Allowed in style config; converted to DataDrivenStyleValue in the PaintStyle constructor.
|
|
2505
|
+
*/
|
|
2506
|
+
export declare type ExpressionArray = any[];
|
|
2487
2507
|
|
|
2488
2508
|
/**
|
|
2489
2509
|
* Defines a custom expression operation to calculate the result of a custom expression function. The custom expression
|
|
@@ -2527,44 +2547,82 @@ export declare interface ExpressionOperation {
|
|
|
2527
2547
|
chunk: string;
|
|
2528
2548
|
}
|
|
2529
2549
|
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2550
|
+
/**
|
|
2551
|
+
* Supported expression operator names (first element of an expression array).
|
|
2552
|
+
* @see evaluateExpression
|
|
2553
|
+
*/
|
|
2554
|
+
declare const ExpressionOperator: {
|
|
2555
|
+
readonly literal: "literal";
|
|
2556
|
+
readonly get: "get";
|
|
2557
|
+
readonly has: "has";
|
|
2558
|
+
readonly var: "var";
|
|
2559
|
+
readonly properties: "properties";
|
|
2560
|
+
readonly zoom: "zoom";
|
|
2561
|
+
readonly coalesce: "coalesce";
|
|
2562
|
+
readonly eq: "==";
|
|
2563
|
+
readonly neq: "!=";
|
|
2564
|
+
readonly lt: "<";
|
|
2565
|
+
readonly lte: "<=";
|
|
2566
|
+
readonly gt: ">";
|
|
2567
|
+
readonly gte: ">=";
|
|
2568
|
+
readonly not: "!";
|
|
2569
|
+
readonly all: "all";
|
|
2570
|
+
readonly any: "any";
|
|
2571
|
+
readonly toNumber: "to-number";
|
|
2572
|
+
readonly toString: "to-string";
|
|
2573
|
+
readonly toLocaleString: "to-locale-string";
|
|
2574
|
+
readonly toUnit: "to-unit";
|
|
2575
|
+
readonly toBoolean: "to-boolean";
|
|
2576
|
+
readonly typeOf: "typeof";
|
|
2577
|
+
readonly number: "number";
|
|
2578
|
+
readonly string: "string";
|
|
2579
|
+
readonly boolean: "boolean";
|
|
2580
|
+
readonly object: "object";
|
|
2581
|
+
readonly add: "+";
|
|
2582
|
+
readonly subtract: "-";
|
|
2583
|
+
readonly mod: "%";
|
|
2584
|
+
readonly pow: "^";
|
|
2585
|
+
readonly multiply: "*";
|
|
2586
|
+
readonly divide: "/";
|
|
2587
|
+
readonly abs: "abs";
|
|
2588
|
+
readonly ceil: "ceil";
|
|
2589
|
+
readonly floor: "floor";
|
|
2590
|
+
readonly round: "round";
|
|
2591
|
+
readonly min: "min";
|
|
2592
|
+
readonly max: "max";
|
|
2593
|
+
readonly sqrt: "sqrt";
|
|
2594
|
+
readonly ln: "ln";
|
|
2595
|
+
readonly ln2: "ln2";
|
|
2596
|
+
readonly log2: "log2";
|
|
2597
|
+
readonly log10: "log10";
|
|
2598
|
+
readonly sin: "sin";
|
|
2599
|
+
readonly cos: "cos";
|
|
2600
|
+
readonly tan: "tan";
|
|
2601
|
+
readonly asin: "asin";
|
|
2602
|
+
readonly acos: "acos";
|
|
2603
|
+
readonly atan: "atan";
|
|
2604
|
+
readonly e: "e";
|
|
2605
|
+
readonly pi: "pi";
|
|
2606
|
+
readonly at: "at";
|
|
2607
|
+
readonly in: "in";
|
|
2608
|
+
readonly regex: "regex";
|
|
2609
|
+
readonly indexOf: "index-of";
|
|
2610
|
+
readonly length: "length";
|
|
2611
|
+
readonly slice: "slice";
|
|
2612
|
+
readonly concat: "concat";
|
|
2613
|
+
readonly downcase: "downcase";
|
|
2614
|
+
readonly upcase: "upcase";
|
|
2615
|
+
readonly step: "step";
|
|
2616
|
+
readonly interpolate: "interpolate";
|
|
2617
|
+
readonly case: "case";
|
|
2618
|
+
readonly match: "match";
|
|
2619
|
+
readonly let: "let";
|
|
2620
|
+
};
|
|
2621
|
+
|
|
2622
|
+
export declare type ExpressionOperator = ObjectValue<typeof ExpressionOperator>;
|
|
2623
|
+
|
|
2624
|
+
/** Value that can appear as an expression or as an argument (literal or nested expression). */
|
|
2625
|
+
export declare type ExpressionValue = string | number | boolean | null | object | Expression;
|
|
2568
2626
|
|
|
2569
2627
|
export declare type FeatureQueryResult = {
|
|
2570
2628
|
value: number;
|
|
@@ -2592,7 +2650,7 @@ export declare interface FillStyleSpec {
|
|
|
2592
2650
|
/**
|
|
2593
2651
|
* Color of the fill.
|
|
2594
2652
|
*/
|
|
2595
|
-
color: StyleValue<string | Color
|
|
2653
|
+
color: StyleValue<string | Color>;
|
|
2596
2654
|
/**
|
|
2597
2655
|
* The image to use for the fill pattern. Can be an image identifier string or a {@link RemoteSymbolImage}.
|
|
2598
2656
|
* @remarks
|
|
@@ -2613,6 +2671,14 @@ export declare interface FillStyleSpec {
|
|
|
2613
2671
|
*/
|
|
2614
2672
|
sort: string | SortProperty;
|
|
2615
2673
|
}
|
|
2674
|
+
|
|
2675
|
+
/**
|
|
2676
|
+
* Mapbox-style filter expression array. Evaluates to boolean (feature included when truthy).
|
|
2677
|
+
* Use with StyleExpression for evaluation. Supports decision expressions (==, !=, <, <=, >, >=,
|
|
2678
|
+
* all, any, !, in, regex, case, match, etc.) and property lookups (get, has).
|
|
2679
|
+
* @see StyleExpression
|
|
2680
|
+
*/
|
|
2681
|
+
export declare type FilterExpression = ExpressionValue;
|
|
2616
2682
|
|
|
2617
2683
|
declare const FtoC: (f: number) => number;
|
|
2618
2684
|
|
|
@@ -2769,8 +2835,14 @@ export declare type GeoJsonProperties = {
|
|
|
2769
2835
|
|
|
2770
2836
|
/**
|
|
2771
2837
|
* A subclass of {@link VectorTileSource} that is used to represent GeoJSON data.
|
|
2838
|
+
*
|
|
2839
|
+
* This source tracks a single in-flight data update (`pendingDataUpdate`) to make update
|
|
2840
|
+
* lifecycle events deterministic when remote loads and `setData()` calls overlap. The revision-
|
|
2841
|
+
* based update state prevents duplicate or out-of-order `DATA_UPDATE_*` events, avoids stale
|
|
2842
|
+
* async completions mutating newer state, and reduces no-op update churn during rapid updates.
|
|
2772
2843
|
*/
|
|
2773
2844
|
export declare class GeoJSONSource extends VectorTileSource {
|
|
2845
|
+
private static readonly DATA_UPDATE_ERROR_MESSAGE;
|
|
2774
2846
|
/**
|
|
2775
2847
|
* Whether the GeoJSON data is dynamic, meaning it will be updated frequently. Default is `false`.
|
|
2776
2848
|
*/
|
|
@@ -2787,9 +2859,15 @@ export declare class GeoJSONSource extends VectorTileSource {
|
|
|
2787
2859
|
* The GeoJSON data associated with the source, either provided statically or from a remote source.
|
|
2788
2860
|
*/
|
|
2789
2861
|
get data(): GeoJSONFeatureCollection;
|
|
2790
|
-
private pendingLoad;
|
|
2791
2862
|
private needsUpdate;
|
|
2863
|
+
/**
|
|
2864
|
+
* The revision number of the data.
|
|
2865
|
+
*/
|
|
2792
2866
|
private dataRevision;
|
|
2867
|
+
/**
|
|
2868
|
+
* The pending data update being processed.
|
|
2869
|
+
*/
|
|
2870
|
+
private pendingDataUpdate;
|
|
2793
2871
|
constructor(id: string, spec: Partial<GeoJSONSourceSpecification>);
|
|
2794
2872
|
/**
|
|
2795
2873
|
* Sets the URL of the GeoJSON data.
|
|
@@ -2811,6 +2889,10 @@ export declare class GeoJSONSource extends VectorTileSource {
|
|
|
2811
2889
|
reload(): void;
|
|
2812
2890
|
private updateWorkerData;
|
|
2813
2891
|
private processWorkerUpdate;
|
|
2892
|
+
private beginDataUpdate;
|
|
2893
|
+
private flushQueuedDataUpdate;
|
|
2894
|
+
private completeDataUpdate;
|
|
2895
|
+
private failDataUpdate;
|
|
2814
2896
|
}
|
|
2815
2897
|
|
|
2816
2898
|
/**
|
|
@@ -2850,7 +2932,7 @@ export declare type GeoJSONTypes = GeoJSON['type'];
|
|
|
2850
2932
|
* @param system - The system to get the default unit for.
|
|
2851
2933
|
* @returns The default unit for the given measurement and system.
|
|
2852
2934
|
*/
|
|
2853
|
-
declare const getDefaultUnit: (type:
|
|
2935
|
+
declare const getDefaultUnit: (type: ConversionMeasurement, system: UnitSystem) => string;
|
|
2854
2936
|
|
|
2855
2937
|
/**
|
|
2856
2938
|
* Returns the default units for the given system.
|
|
@@ -2868,6 +2950,8 @@ declare const getMeasurementType: (str: string) => Measurement | undefined;
|
|
|
2868
2950
|
* @returns The system for the given units.
|
|
2869
2951
|
*/
|
|
2870
2952
|
declare const getSystemForUnits: (units: MapUnits) => UnitSystem;
|
|
2953
|
+
|
|
2954
|
+
declare const getUnitPrecision: (unit: string) => number;
|
|
2871
2955
|
|
|
2872
2956
|
export declare type GoogleMap = google.maps.Map;
|
|
2873
2957
|
|
|
@@ -2927,7 +3011,7 @@ export declare interface HeatmapStyleSpec {
|
|
|
2927
3011
|
* Defines the normalized (`0` to `1`) color scale used to color pixels based on its density value, where `0`
|
|
2928
3012
|
* is none and `1` being the highest density.
|
|
2929
3013
|
*/
|
|
2930
|
-
color: Array<number | string
|
|
3014
|
+
color: StyleValue<Array<number | string>>;
|
|
2931
3015
|
/**
|
|
2932
3016
|
* Radius of influence of each data point in screen points.
|
|
2933
3017
|
*/
|
|
@@ -3262,7 +3346,7 @@ export declare type LayerMetadata = {
|
|
|
3262
3346
|
sourceLayerId: string;
|
|
3263
3347
|
sourceLayerType: string;
|
|
3264
3348
|
type: string;
|
|
3265
|
-
filter:
|
|
3349
|
+
filter: FilterExpression;
|
|
3266
3350
|
paint: PaintStyle;
|
|
3267
3351
|
options?: Record<string, unknown>;
|
|
3268
3352
|
};
|
|
@@ -3343,13 +3427,15 @@ export declare interface LayerRenderer {
|
|
|
3343
3427
|
* Called before the primary render method to perform any setup or rendering that needs to be done before
|
|
3344
3428
|
* rendering, such as rendering to a framebuffer or updating compute passes.
|
|
3345
3429
|
* @param elapsedTime - The render loop's elapsed time.
|
|
3430
|
+
* @param frameContext - Map and layer state for this frame; the renderer must use this instead of reading from the layer or map.
|
|
3346
3431
|
*/
|
|
3347
|
-
prerender(elapsedTime: number): void;
|
|
3432
|
+
prerender(elapsedTime: number, frameContext: RenderFrameContext): void;
|
|
3348
3433
|
/**
|
|
3349
3434
|
* Render the layer's data.
|
|
3350
3435
|
* @param elapsedTime - The render loop's elapsed time.
|
|
3436
|
+
* @param frameContext - Map and layer state for this frame; the renderer must use this instead of reading from the layer or map.
|
|
3351
3437
|
*/
|
|
3352
|
-
draw(elapsedTime: number): void;
|
|
3438
|
+
draw(elapsedTime: number, frameContext: RenderFrameContext): void;
|
|
3353
3439
|
/**
|
|
3354
3440
|
* Performs any necessary set up to prepare the renderer for offscreen rendering, such as setting up a framebuffer.
|
|
3355
3441
|
*/
|
|
@@ -3410,15 +3496,21 @@ export declare interface LayerSpecification {
|
|
|
3410
3496
|
*/
|
|
3411
3497
|
mask?: LayerMaskSpecification;
|
|
3412
3498
|
/**
|
|
3413
|
-
* Filter expression
|
|
3414
|
-
*
|
|
3415
|
-
* @see ExpressionSpecification
|
|
3499
|
+
* Filter expression for vector tile layers. Evaluated with StyleExpression.
|
|
3500
|
+
* @see FilterExpression
|
|
3416
3501
|
*/
|
|
3417
|
-
filter?:
|
|
3502
|
+
filter?: FilterExpression;
|
|
3418
3503
|
/**
|
|
3419
3504
|
* Time series configuration for the layer when time-based.
|
|
3420
3505
|
*/
|
|
3421
3506
|
timeSeries?: Partial<LayerTiming>;
|
|
3507
|
+
/**
|
|
3508
|
+
* Optional measurement metadata associated with this layer's values.
|
|
3509
|
+
*/
|
|
3510
|
+
measurement?: {
|
|
3511
|
+
type: ConversionMeasurement;
|
|
3512
|
+
units: string;
|
|
3513
|
+
};
|
|
3422
3514
|
/**
|
|
3423
3515
|
* Data resolution to use, which controls which data zoom level is requested for a specific map zoom level.
|
|
3424
3516
|
* @remarks
|
|
@@ -4737,6 +4829,10 @@ declare const Operator: {
|
|
|
4737
4829
|
|
|
4738
4830
|
export declare type Operator = ObjectValue<typeof Operator>;
|
|
4739
4831
|
|
|
4832
|
+
export declare interface Opts {
|
|
4833
|
+
capacity: number;
|
|
4834
|
+
}
|
|
4835
|
+
|
|
4740
4836
|
/**
|
|
4741
4837
|
* The mode for handling symbol overlap.
|
|
4742
4838
|
*/
|
|
@@ -4826,7 +4922,7 @@ export declare class PaintStyle {
|
|
|
4826
4922
|
iconAnimated(data?: StylableData): boolean;
|
|
4827
4923
|
iconFactor(data?: StylableData): number;
|
|
4828
4924
|
iconAtlas(data?: StylableData): SymbolIconAtlas;
|
|
4829
|
-
textValue(data?: StylableData, line?: number): string
|
|
4925
|
+
textValue(data?: StylableData, line?: number): string;
|
|
4830
4926
|
textTransform(data?: StylableData, line?: number): string;
|
|
4831
4927
|
textFont(data?: StylableData, line?: number): string;
|
|
4832
4928
|
textSize(data?: StylableData, line?: number): number;
|
|
@@ -5097,32 +5193,6 @@ declare const ProjectionType: {
|
|
|
5097
5193
|
|
|
5098
5194
|
export declare type ProjectionType = ObjectValue<typeof ProjectionType>;
|
|
5099
5195
|
|
|
5100
|
-
/**
|
|
5101
|
-
* Defines a property value that is based on a property name or an array of property names from a JSON object. The
|
|
5102
|
-
* property value can also be transformed using a custom function to format the value before rendering.
|
|
5103
|
-
*/
|
|
5104
|
-
export declare interface PropertyValue {
|
|
5105
|
-
/**
|
|
5106
|
-
* Property key path or an array of property key paths from a JSON object. If an array is provided, then the first
|
|
5107
|
-
* property that is not undefined will be used.
|
|
5108
|
-
*/
|
|
5109
|
-
property: string | Array<string>;
|
|
5110
|
-
/**
|
|
5111
|
-
* Optional measurement type the value represents. This is used to select the proper units to convert the value to
|
|
5112
|
-
* before rendering. If not provided, then the value will be rendered as is.
|
|
5113
|
-
*/
|
|
5114
|
-
measurement?: {
|
|
5115
|
-
type: string;
|
|
5116
|
-
units: string;
|
|
5117
|
-
};
|
|
5118
|
-
/**
|
|
5119
|
-
* Custom function to transform the property value before rendering. This is useful for formatting the value before
|
|
5120
|
-
* rendering, such as converting units, rounding, or applying other transformations.
|
|
5121
|
-
* @param value - The property value to transform.
|
|
5122
|
-
*/
|
|
5123
|
-
transform?: (value: string | number, units?: string) => string | number;
|
|
5124
|
-
}
|
|
5125
|
-
|
|
5126
5196
|
/**
|
|
5127
5197
|
* A `Query` object is a convenience wrapper for setting up and configuring a query string used
|
|
5128
5198
|
* for API queries.
|
|
@@ -5270,7 +5340,92 @@ export declare interface RemoteSymbolImage {
|
|
|
5270
5340
|
/** Indicates if the image is a pattern image. */
|
|
5271
5341
|
pattern?: boolean;
|
|
5272
5342
|
}
|
|
5343
|
+
|
|
5344
|
+
/**
|
|
5345
|
+
* Context built by the layer each frame and passed to prerender() and draw().
|
|
5346
|
+
* Contains all map and layer state needed for the render path so the renderer
|
|
5347
|
+
* does not access the parent layer or the layer's map.
|
|
5348
|
+
*/
|
|
5349
|
+
export declare interface RenderFrameContext {
|
|
5350
|
+
/** Elapsed time since the start of the render loop. Used by the renderer to animate the layer. */
|
|
5351
|
+
elapsedTime: number;
|
|
5352
|
+
/** Latest calculated FPS of the context. */
|
|
5353
|
+
fps: number;
|
|
5354
|
+
/** Map state snapshot. */
|
|
5355
|
+
map: RenderFrameContextMap;
|
|
5356
|
+
/** Layer id. */
|
|
5357
|
+
layerId: string;
|
|
5358
|
+
/** Scene to render into. */
|
|
5359
|
+
scene: MapScene;
|
|
5360
|
+
/** Whether this layer is used as a mask (stencil). */
|
|
5361
|
+
isLayerMask: boolean;
|
|
5362
|
+
/** Layer mask config if any. */
|
|
5363
|
+
mask?: LayerMask;
|
|
5364
|
+
/** Whether the layer is visible. */
|
|
5365
|
+
visible: boolean;
|
|
5366
|
+
/** Request a redraw on the next frame. */
|
|
5367
|
+
setNeedsUpdate(): void;
|
|
5368
|
+
/** Tile-layer-specific state; set when the layer is a tile layer. */
|
|
5369
|
+
tileLayer?: RenderFrameContextTileLayer;
|
|
5370
|
+
/** Tile cache from the layer's source; set when the layer has a tile source. Used by renderers instead of accessing layer.source.tiles. */
|
|
5371
|
+
tileCache?: AnyTileCache;
|
|
5372
|
+
/** Tile dimensions from the layer's source; set when the layer has a tile source. Used for texture array setup. */
|
|
5373
|
+
tileSize?: {
|
|
5374
|
+
width: number;
|
|
5375
|
+
height: number;
|
|
5376
|
+
};
|
|
5377
|
+
/** Layer paint style (from layer.paint). Set by the layer when building context. */
|
|
5378
|
+
paint?: PaintStyle;
|
|
5379
|
+
/** Map style (map.style). Used by vector/grid passes for fonts, image atlas, etc. */
|
|
5380
|
+
mapStyle?: MapStyle;
|
|
5381
|
+
}
|
|
5382
|
+
|
|
5383
|
+
/**
|
|
5384
|
+
* Snapshot of map transform state passed into the render path so the renderer
|
|
5385
|
+
* does not read from the map or layer during prerender/draw.
|
|
5386
|
+
*/
|
|
5387
|
+
export declare interface RenderFrameContextMap {
|
|
5388
|
+
center: Coordinate;
|
|
5389
|
+
zoom: number;
|
|
5390
|
+
bounds: CoordinateBounds;
|
|
5391
|
+
bearing: number;
|
|
5392
|
+
pitch: number;
|
|
5393
|
+
tileSize: number;
|
|
5394
|
+
projection: {
|
|
5395
|
+
type: ProjectionType;
|
|
5396
|
+
subdivisionGranularity: SubdivisionGranularitySetting;
|
|
5397
|
+
};
|
|
5398
|
+
transform: MapTransform;
|
|
5399
|
+
placement: SymbolPlacement;
|
|
5400
|
+
globiness: number;
|
|
5401
|
+
isGlobe: boolean;
|
|
5402
|
+
camera: {
|
|
5403
|
+
position: Vector3;
|
|
5404
|
+
};
|
|
5405
|
+
clippingPlane: Vector4;
|
|
5406
|
+
globeMatrix: Matrix4;
|
|
5407
|
+
mercatorMatrix: Matrix4;
|
|
5408
|
+
projGlobeMatrix: Matrix4;
|
|
5409
|
+
zoomTransition: number;
|
|
5410
|
+
cutoffParams: [number, number, number, number];
|
|
5411
|
+
farZ: number;
|
|
5412
|
+
pixelsPerMercatorPixelRatio: number;
|
|
5413
|
+
}
|
|
5414
|
+
|
|
5415
|
+
/**
|
|
5416
|
+
* Optional tile-layer-specific state for resolution and LOD. Present when the
|
|
5417
|
+
* layer is a tile layer.
|
|
5418
|
+
*/
|
|
5419
|
+
export declare interface RenderFrameContextTileLayer {
|
|
5420
|
+
viewport: Viewport;
|
|
5421
|
+
pyramid: TilePyramid<any>;
|
|
5422
|
+
getDataZoom(): number;
|
|
5423
|
+
getVisibleTileCoords(zoom: number): TileCoord[];
|
|
5424
|
+
getCurrentInterval?(): TimeInterval | undefined;
|
|
5425
|
+
}
|
|
5273
5426
|
|
|
5427
|
+
declare const resolveMeasurementForUnits: (type: ConversionMeasurement) => Measurement;
|
|
5428
|
+
|
|
5274
5429
|
/**
|
|
5275
5430
|
* RGBAImage represents a 2D grid of image data. Them image data should NOT be premultipled since ImageData is not.
|
|
5276
5431
|
* Therefore, UNPACK_PREMULTIPLY_ALPHA_WEBGL must be used when uploading the image data to the GPU via a texture.
|
|
@@ -5463,10 +5618,10 @@ export declare class SourceMetadata extends EventDispatcher {
|
|
|
5463
5618
|
*/
|
|
5464
5619
|
get hasLoaded(): boolean;
|
|
5465
5620
|
/**
|
|
5466
|
-
* Whether the
|
|
5621
|
+
* Whether the data source is a time-series data source.
|
|
5467
5622
|
* @readonly
|
|
5468
5623
|
*/
|
|
5469
|
-
get
|
|
5624
|
+
get isTimeSeries(): boolean;
|
|
5470
5625
|
get validTimeRange(): TimeRange;
|
|
5471
5626
|
getAllValidTimes(): Array<Date>;
|
|
5472
5627
|
/**
|
|
@@ -5649,6 +5804,12 @@ export declare class State<T> extends EventDispatcher {
|
|
|
5649
5804
|
};
|
|
5650
5805
|
}
|
|
5651
5806
|
|
|
5807
|
+
/**
|
|
5808
|
+
* Legacy style value: a static value or a function (data) => value.
|
|
5809
|
+
* Supported for backwards compatibility.
|
|
5810
|
+
*/
|
|
5811
|
+
export declare type StaticOrFunctionStyleValue<T> = T | ((data: StylableData) => T);
|
|
5812
|
+
|
|
5652
5813
|
/**
|
|
5653
5814
|
* Stroke style properties control how one or more polylines get rendered on a map. These properties also control
|
|
5654
5815
|
* strokes around circles and other vector shapes.
|
|
@@ -5657,7 +5818,7 @@ export declare interface StrokeStyleSpec {
|
|
|
5657
5818
|
/**
|
|
5658
5819
|
* Color of the stroke.
|
|
5659
5820
|
*/
|
|
5660
|
-
color: StyleValue<string | Color
|
|
5821
|
+
color: StyleValue<string | Color>;
|
|
5661
5822
|
/**
|
|
5662
5823
|
* Opacity of the stroke. Opacity can also be specified by including an alpha channel in the `color` value.
|
|
5663
5824
|
*/
|
|
@@ -5761,6 +5922,8 @@ export declare interface StyledImageRenderer {
|
|
|
5761
5922
|
dispose?: () => void;
|
|
5762
5923
|
}
|
|
5763
5924
|
|
|
5925
|
+
export declare type StyleEvaulatorFunction<T> = (properties: Record<string, any>) => T;
|
|
5926
|
+
|
|
5764
5927
|
export declare interface StyleExpression {
|
|
5765
5928
|
property: string;
|
|
5766
5929
|
type?: 'identity' | 'expression';
|
|
@@ -5810,10 +5973,35 @@ export declare const styles: {
|
|
|
5810
5973
|
};
|
|
5811
5974
|
|
|
5812
5975
|
/**
|
|
5813
|
-
*
|
|
5814
|
-
*
|
|
5976
|
+
* Style value accepted by paint specs. Can be:
|
|
5977
|
+
* - A constant (number, string, boolean, object, etc.)
|
|
5978
|
+
* - A function (data) => value
|
|
5979
|
+
* - An expression array (Mapbox-style, e.g. ['get', 'opacity'])
|
|
5980
|
+
* - A {@link ConstantStyleValue} or {@link DataDrivenStyleValue} instance (used as-is)
|
|
5981
|
+
*
|
|
5982
|
+
* Constants, functions, and expression arrays are converted to StyleValue instances in the PaintStyle constructor.
|
|
5815
5983
|
*/
|
|
5816
|
-
export declare type StyleValue<T> = T |
|
|
5984
|
+
export declare type StyleValue<T> = StaticOrFunctionStyleValue<T> | ExpressionArray | DataDrivenStyleValue<T> | ConstantStyleValue<T>;
|
|
5985
|
+
|
|
5986
|
+
declare abstract class StyleValue_2<T> {
|
|
5987
|
+
private constant;
|
|
5988
|
+
private expression;
|
|
5989
|
+
private fn;
|
|
5990
|
+
constructor(value: T | any[] | StyleEvaulatorFunction<T>);
|
|
5991
|
+
/**
|
|
5992
|
+
* Returns whether this value is an expression.
|
|
5993
|
+
*/
|
|
5994
|
+
isExpression(): boolean;
|
|
5995
|
+
/**
|
|
5996
|
+
* Resolves the final value based on input properties.
|
|
5997
|
+
* If it's a constant, returns it directly.
|
|
5998
|
+
*/
|
|
5999
|
+
resolve(properties?: Record<string, any>): T;
|
|
6000
|
+
/**
|
|
6001
|
+
* Returns the raw constant or expression for debugging or serialization.
|
|
6002
|
+
*/
|
|
6003
|
+
getRaw(): T | any[] | StyleEvaulatorFunction<T> | null;
|
|
6004
|
+
}
|
|
5817
6005
|
|
|
5818
6006
|
/**
|
|
5819
6007
|
* Supported color bands.
|
|
@@ -6002,10 +6190,9 @@ export declare interface TaskRunnerConfig<Task extends DownloadTask<any>> {
|
|
|
6002
6190
|
*/
|
|
6003
6191
|
export declare interface TextStyleSpec {
|
|
6004
6192
|
/**
|
|
6005
|
-
* Text to render. This can be a static string or
|
|
6006
|
-
* property names from a JSON object.
|
|
6193
|
+
* Text to render. This can be a static string or an expression that evaluates to a string.
|
|
6007
6194
|
*/
|
|
6008
|
-
value: StyleValue<string
|
|
6195
|
+
value: StyleValue<string>;
|
|
6009
6196
|
/**
|
|
6010
6197
|
* The size of the text in pixels.
|
|
6011
6198
|
*/
|
|
@@ -6084,6 +6271,11 @@ export declare class Tile<Data> implements Disposable {
|
|
|
6084
6271
|
private _span;
|
|
6085
6272
|
private _bounds;
|
|
6086
6273
|
private _state;
|
|
6274
|
+
/**
|
|
6275
|
+
* Monotonically increasing identifier for the most recent request that started loading this tile.
|
|
6276
|
+
* Used by `TileSource` to guard against out-of-order async responses overwriting newer data.
|
|
6277
|
+
*/
|
|
6278
|
+
requestId: number;
|
|
6087
6279
|
private _data;
|
|
6088
6280
|
/**
|
|
6089
6281
|
* The tile coordinate of the tile as `x`, `y`, and `z`.
|
|
@@ -6166,6 +6358,13 @@ export declare class TileBounds {
|
|
|
6166
6358
|
get center(): Point;
|
|
6167
6359
|
get info(): Rect_2;
|
|
6168
6360
|
constructor(left: number, right: number, top: number, bottom: number);
|
|
6361
|
+
/**
|
|
6362
|
+
* Expands the bounds by the specified offsets.
|
|
6363
|
+
* @param xOffset - The offset to expand the bounds horizontally.
|
|
6364
|
+
* @param yOffset - The offset to expand the bounds vertically.
|
|
6365
|
+
* @returns The expanded bounds.
|
|
6366
|
+
*/
|
|
6367
|
+
expand(xOffset: number, yOffset: number): TileBounds;
|
|
6169
6368
|
/**
|
|
6170
6369
|
* Returns whether the bounds equals the specified bounds.
|
|
6171
6370
|
* @param bounds -
|
|
@@ -6312,6 +6511,116 @@ export declare interface TileInfo {
|
|
|
6312
6511
|
z: number;
|
|
6313
6512
|
}
|
|
6314
6513
|
|
|
6514
|
+
/**
|
|
6515
|
+
* Represents a layer that renders data from a tile-based data source. This is the base class for all tile-based layers
|
|
6516
|
+
* and is not intended to be used directly.
|
|
6517
|
+
* @template Data Type of data stored in the layer's tiles.
|
|
6518
|
+
*/
|
|
6519
|
+
declare abstract class TileLayer<Data> extends WebGLLayer<TileSource> {
|
|
6520
|
+
/**
|
|
6521
|
+
* Tile pyramid used to calculating and requesting tiles for the layer from the data source.
|
|
6522
|
+
*/
|
|
6523
|
+
readonly pyramid: TilePyramid<Data>;
|
|
6524
|
+
readonly zoomOffset: number;
|
|
6525
|
+
private tileBounds;
|
|
6526
|
+
private dataQuality;
|
|
6527
|
+
private upgradeDataQuality;
|
|
6528
|
+
private lastHiddenTime;
|
|
6529
|
+
private tileLoadProgress;
|
|
6530
|
+
/**
|
|
6531
|
+
* Returns the layer's data render quality.
|
|
6532
|
+
* @see DataQuality
|
|
6533
|
+
*/
|
|
6534
|
+
get quality(): DataQuality;
|
|
6535
|
+
/**
|
|
6536
|
+
* Sets the layer's data render quality.
|
|
6537
|
+
* @see DataQuality
|
|
6538
|
+
*/
|
|
6539
|
+
set quality(value: DataQuality);
|
|
6540
|
+
/**
|
|
6541
|
+
* Creates an instance of TileLayer.
|
|
6542
|
+
* @param id - Unique identifier of the layer.
|
|
6543
|
+
* @param config - Config options for the layer.
|
|
6544
|
+
*/
|
|
6545
|
+
constructor(id: string, { quality, ...config }: Partial<TileLayerConfig>);
|
|
6546
|
+
refresh(clear?: boolean): void;
|
|
6547
|
+
/**
|
|
6548
|
+
* Returns the layer's tile cache so renderers can use it via RenderFrameContext instead of accessing layer.source.tiles.
|
|
6549
|
+
*/
|
|
6550
|
+
getTileCache(): AnyTileCache;
|
|
6551
|
+
/**
|
|
6552
|
+
* Returns the layer's tile dimensions for texture array setup.
|
|
6553
|
+
*/
|
|
6554
|
+
getTileSize(): {
|
|
6555
|
+
width: number;
|
|
6556
|
+
height: number;
|
|
6557
|
+
};
|
|
6558
|
+
/**
|
|
6559
|
+
* Returns the data zoom level used for the specified map zoom level based on the configured `quality` level.
|
|
6560
|
+
* @param zoom - Map zoom level to get the data zoom level for.
|
|
6561
|
+
* @param reduceDataQuality - Whether to reduce the data quality by 1 level.
|
|
6562
|
+
* @returns Data zoom level.
|
|
6563
|
+
*/
|
|
6564
|
+
getDataZoom(zoom?: number, reduceDataQuality?: boolean): number;
|
|
6565
|
+
preloadWorldTile(): void;
|
|
6566
|
+
/**
|
|
6567
|
+
* Returns the tile at the specified geographic coordinate.
|
|
6568
|
+
* @param coord - Geographic coordinate to get the tile for.
|
|
6569
|
+
* @param allowPartials - Whether to allow returning a tile that only partially contains the queried coordinate.
|
|
6570
|
+
* @returns Tile and position within the tile for the specified coordinate.
|
|
6571
|
+
*/
|
|
6572
|
+
protected getTile(coord: Coordinate, zoom?: number, allowPartials?: boolean): {
|
|
6573
|
+
tile: Tile<Data>;
|
|
6574
|
+
position: Point;
|
|
6575
|
+
} | undefined;
|
|
6576
|
+
/**
|
|
6577
|
+
* Returns the visible tile coordinates based on the map's current viewport.
|
|
6578
|
+
* @returns Array of visible tile coordinates.
|
|
6579
|
+
*/
|
|
6580
|
+
getVisibleTileCoords(): Array<TileCoord>;
|
|
6581
|
+
/**
|
|
6582
|
+
* Requests visible tiles from the tile pyramid.
|
|
6583
|
+
* @param reload - Whether to reload tiles that have already been requested.
|
|
6584
|
+
* @returns Promise that resolves when the tiles have been requested.
|
|
6585
|
+
*/
|
|
6586
|
+
private requestVisibleTiles;
|
|
6587
|
+
protected requestTiles(coords: Array<TileCoord>, reload?: boolean): Promise<void>;
|
|
6588
|
+
protected shouldReloadTile(coord: TileCoord): boolean;
|
|
6589
|
+
onAdd(context: Context): void;
|
|
6590
|
+
onMove(): void;
|
|
6591
|
+
onVisible(): void;
|
|
6592
|
+
onHidden(): void;
|
|
6593
|
+
private onDataStale;
|
|
6594
|
+
private onDataChange;
|
|
6595
|
+
private onTileLoad;
|
|
6596
|
+
private onTileError;
|
|
6597
|
+
private onLoadProgress;
|
|
6598
|
+
private onLoadStart;
|
|
6599
|
+
private onLoadComplete;
|
|
6600
|
+
protected onTimeSeriesDataChange(): void;
|
|
6601
|
+
protected onMaskLayerChange(): void;
|
|
6602
|
+
protected onMaskStateChange(): void;
|
|
6603
|
+
}
|
|
6604
|
+
|
|
6605
|
+
/**
|
|
6606
|
+
* Configuration options for a tile-based layer.
|
|
6607
|
+
*/
|
|
6608
|
+
export declare interface TileLayerConfig extends WebGLLayerConfig {
|
|
6609
|
+
/**
|
|
6610
|
+
* Quality to use when rendering data.
|
|
6611
|
+
*/
|
|
6612
|
+
quality: DataQuality;
|
|
6613
|
+
/**
|
|
6614
|
+
* Range of values to use when rendering data.
|
|
6615
|
+
*/
|
|
6616
|
+
dataRange: ValueRange;
|
|
6617
|
+
/**
|
|
6618
|
+
* Offset to apply to the map's zoom level when requesting data from the data source. This is useful to render data
|
|
6619
|
+
* at a different zoom level than the map's zoom level.
|
|
6620
|
+
*/
|
|
6621
|
+
zoomOffset: number;
|
|
6622
|
+
}
|
|
6623
|
+
|
|
6315
6624
|
export declare type TileQuadrant = 'tl' | 'tc' | 'tr' | 'ml' | 'mc' | 'mr' | 'bl' | 'bc' | 'br';
|
|
6316
6625
|
|
|
6317
6626
|
/**
|
|
@@ -6350,10 +6659,6 @@ export declare type TileRequestOptions = {
|
|
|
6350
6659
|
* Whether to reload the tile if it has already been loaded.
|
|
6351
6660
|
*/
|
|
6352
6661
|
reload: boolean;
|
|
6353
|
-
/**
|
|
6354
|
-
* Whether to check if the tile is already pending before loading.
|
|
6355
|
-
*/
|
|
6356
|
-
checkPending: boolean;
|
|
6357
6662
|
/**
|
|
6358
6663
|
* The time intervals to load for the tile.
|
|
6359
6664
|
*/
|
|
@@ -6364,10 +6669,42 @@ export declare type TileRequestOptions = {
|
|
|
6364
6669
|
* `TileSource` is an abstract class that provides the primary implementation of a tile-based data source object that
|
|
6365
6670
|
* loads tiles from a remote source. This class is not intended to be used directly, but rather extended by a concrete
|
|
6366
6671
|
* implementation of a tile-based data source.
|
|
6672
|
+
*
|
|
6673
|
+
* @remarks
|
|
6674
|
+
* **Tile loading: two complementary mechanisms**
|
|
6675
|
+
*
|
|
6676
|
+
* Network fetches are orchestrated by {@link TileSource.downloadManager} (`DownloadManager`). `requestTile` may run
|
|
6677
|
+
* decode/parse work after bytes arrive. Understanding these two behaviors avoids duplicate work and stale tiles:
|
|
6678
|
+
*
|
|
6679
|
+
* 1. **Download deduplication** — For a given `TileDownloadTask` key (tile coordinate plus optional interval key from
|
|
6680
|
+
* {@link makeTileKey} / {@link makeTileArrayKey}), the manager ensures at most one in-flight or pending fetch. If
|
|
6681
|
+
* `requestTile` is called again while that task is still pending or in-flight, callers await the **same** promise
|
|
6682
|
+
* instead of starting a second HTTP request. This reduces redundant bandwidth and coordinates multiple callers
|
|
6683
|
+
* (e.g. layers or rapid map updates) that share the exact same request identity.
|
|
6684
|
+
*
|
|
6685
|
+
* 2. **Load generation guard (`tile.requestId` / `task.loadRequestId`)** — Deduping only merges identical
|
|
6686
|
+
* **keys**. It does **not** decide which result is "current" when the logical request for a tile slot changes:
|
|
6687
|
+
* different URL parameters (time, style, reload), a new fetch after a previous task finished, or a slow
|
|
6688
|
+
* {@link parseTile} finishing after a newer `requestTile` has already started. For non-interval loads, each **new**
|
|
6689
|
+
* enqueued download task gets a monotonically increasing id; callers that shared that task share the same id.
|
|
6690
|
+
* After `parseTile` resolves, the result is applied only if that id still matches `tile.requestId` (see
|
|
6691
|
+
* `requestTile` and `loadTile`). Stale completions are dropped so an older response cannot overwrite newer data for
|
|
6692
|
+
* the same tile instance.
|
|
6693
|
+
*
|
|
6694
|
+
* **Interval-based loads** (time-series tiles with multiple intervals on one tile) intentionally skip this per-tile
|
|
6695
|
+
* id guard so a single tile can accumulate multiple interval results; ordering for those paths is handled elsewhere
|
|
6696
|
+
* in the data model.
|
|
6697
|
+
*
|
|
6367
6698
|
* @template Data The type of data stored in a tile.
|
|
6368
6699
|
* @template Source The type of the source specification.
|
|
6369
6700
|
*/
|
|
6370
6701
|
declare abstract class TileSource<Data = any, Source extends TileSourceSpecification = TileSourceSpecification> extends DataSource<Source> {
|
|
6702
|
+
/**
|
|
6703
|
+
* Monotonic counter used when assigning {@link TileDownloadTask.loadRequestId} for non-interval loads. Each new
|
|
6704
|
+
* enqueued download task gets the next id; waiters sharing the same task reuse that id. See class-level docs on
|
|
6705
|
+
* deduplication vs. load-generation guard.
|
|
6706
|
+
*/
|
|
6707
|
+
private _tileLoadRequestId;
|
|
6371
6708
|
/**
|
|
6372
6709
|
* The minimum zoom level for the source. Defaults to `0`.
|
|
6373
6710
|
*/
|
|
@@ -6431,35 +6768,39 @@ constructor(id: string, spec: Partial<Source>);
|
|
|
6431
6768
|
* @returns The URL for the tile.
|
|
6432
6769
|
*/
|
|
6433
6770
|
getTileUrl(coord: TileCoord, params?: Record<string, any>): string;
|
|
6434
|
-
/**
|
|
6435
|
-
* Returns whether or not the source has a tile for the given tile coordinate.
|
|
6436
|
-
* @param coord - The tile coordinate.
|
|
6437
|
-
* @param layerId -
|
|
6438
|
-
* @returns Whether or not the source has a tile for the given tile coordinate.
|
|
6439
|
-
*/
|
|
6440
|
-
hasTile(coord: TileCoord, layerId?: string): boolean;
|
|
6441
6771
|
/**
|
|
6442
6772
|
* Checks if tile data exists for the given coordinate.
|
|
6773
|
+
* For time-series sources, pass `intervals` to require data for those intervals; otherwise
|
|
6774
|
+
* only the coord is checked and a single cached tile counts as "has data".
|
|
6443
6775
|
* @param coord - The tile coordinate.
|
|
6444
|
-
* @param layerId - Optional layer ID for per-layer data (unused but retained for API compatibility).
|
|
6776
|
+
* @param layerId - Optional layer ID for per-layer data (unused but retained for API compatibility). If provided,
|
|
6777
|
+
* the tile data must have data for the given layer ID. This is only used for vector tile sources.
|
|
6445
6778
|
* @param allowExpired - If true, allows expired tiles to be considered as having data.
|
|
6446
|
-
* @
|
|
6779
|
+
* @param intervals - Optional time intervals (e.g. from request options). When provided, the tile must have
|
|
6780
|
+
* data for all of these intervals (used for time-series / multi-interval requests). The base implementation
|
|
6781
|
+
* only checks for data for the given intervals if the tile data is a time series data object.
|
|
6782
|
+
* @returns Whether tile data exists (optionally including expired/stale and/or for the given intervals).
|
|
6447
6783
|
*/
|
|
6448
|
-
hasTileData(coord: TileCoord, layerId?: string, allowExpired?: boolean): boolean;
|
|
6784
|
+
hasTileData(coord: TileCoord, layerId?: string, allowExpired?: boolean, intervals?: Array<Date>): boolean;
|
|
6449
6785
|
/**
|
|
6450
|
-
* Returns
|
|
6786
|
+
* Returns whether there is already a pending or in-flight request for the given coordinate
|
|
6787
|
+
* (and optionally for the given intervals). Used to avoid duplicate requests when the
|
|
6788
|
+
* same tile+intervals are requested multiple times.
|
|
6451
6789
|
* @param coord - The tile coordinate.
|
|
6452
|
-
* @
|
|
6790
|
+
* @param intervals - Optional time intervals. When provided, only a task for the same coord and
|
|
6791
|
+
* these intervals is considered; when omitted, any task for this coord is considered.
|
|
6792
|
+
* @returns True if a matching request is pending or in-flight.
|
|
6453
6793
|
*/
|
|
6454
|
-
|
|
6794
|
+
isPending(coord: TileCoord, intervals?: Array<Date>): boolean;
|
|
6455
6795
|
getTileDataSize(data?: Data): Size;
|
|
6456
6796
|
/**
|
|
6457
|
-
* Returns whether
|
|
6797
|
+
* Returns whether the source should request a tile.
|
|
6458
6798
|
* @param tile - The tile to check.
|
|
6459
|
-
* @param
|
|
6460
|
-
*
|
|
6799
|
+
* @param options - Optional request options (reload, intervals for time-series, etc.). Subclasses may use
|
|
6800
|
+
* this to request a tile when cached data does not satisfy the request (e.g. missing interval).
|
|
6801
|
+
* @returns Whether the source should request a tile.
|
|
6461
6802
|
*/
|
|
6462
|
-
shouldRequestTile(tile: Tile<Data>, reload?: boolean): boolean;
|
|
6803
|
+
shouldRequestTile(tile: Tile<Data>, reload?: boolean, intervals?: Array<Date>): boolean;
|
|
6463
6804
|
/**
|
|
6464
6805
|
* Reloads all cached tiles.
|
|
6465
6806
|
*/
|
|
@@ -6471,16 +6812,11 @@ constructor(id: string, spec: Partial<Source>);
|
|
|
6471
6812
|
* @returns A promise that resolves with the tile data.
|
|
6472
6813
|
*/
|
|
6473
6814
|
requestTile(coord: TileCoord, options?: Partial<TileRequestOptions>): Promise<Data | null>;
|
|
6474
|
-
|
|
6475
|
-
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
|
|
6479
|
-
*/
|
|
6480
|
-
protected getOrCreateTile(coord: TileCoord): Tile<Data>;
|
|
6481
|
-
protected loadTile(tile: Tile<Data>, options?: Partial<TileRequestOptions>): Promise<{
|
|
6482
|
-
data: Blob;
|
|
6483
|
-
headers: Headers;
|
|
6815
|
+
protected loadTile(tile: Tile<Data>, options?: Partial<TileRequestOptions>, loadRequestCtx?: {
|
|
6816
|
+
loadRequestId: number;
|
|
6817
|
+
}): Promise<{
|
|
6818
|
+
data: Blob | null;
|
|
6819
|
+
headers: Headers | null;
|
|
6484
6820
|
}>;
|
|
6485
6821
|
getMetadata(options?: Partial<UrlRequestOptions>): Promise<unknown>;
|
|
6486
6822
|
removeConsumer(consumer: DataSourceConsumer): void;
|
|
@@ -6489,8 +6825,14 @@ constructor(id: string, spec: Partial<Source>);
|
|
|
6489
6825
|
* @param tile - The tile to abort.
|
|
6490
6826
|
*/
|
|
6491
6827
|
protected abortTile(tile: Tile<Data>): void;
|
|
6492
|
-
|
|
6493
|
-
|
|
6828
|
+
/**
|
|
6829
|
+
* Aborts in-worker requests for a tile by coordinate (e.g. when tile is no longer visible).
|
|
6830
|
+
* Override in subclasses that run work in a worker (e.g. encoded operation layers).
|
|
6831
|
+
* @param coord - The tile coordinate to abort.
|
|
6832
|
+
*/
|
|
6833
|
+
abortTileByCoord(_coord: TileCoord): void;
|
|
6834
|
+
|
|
6835
|
+
/**
|
|
6494
6836
|
* Cancels all active tile requests.
|
|
6495
6837
|
*/
|
|
6496
6838
|
cancelAllRequests(): void;
|
|
@@ -6633,6 +6975,7 @@ export declare class TimeAnimation extends Animation {
|
|
|
6633
6975
|
private _endDate;
|
|
6634
6976
|
private _endOffset;
|
|
6635
6977
|
private _now;
|
|
6978
|
+
private _rangeChangeAnchorDate?;
|
|
6636
6979
|
constructor({ start, end, alwaysStopAtStart, ...animationOpts }: Partial<TimeAnimationOptions>);
|
|
6637
6980
|
/**
|
|
6638
6981
|
* Sets the start date of the animation using an offset from a reference date.
|
|
@@ -6685,6 +7028,14 @@ export declare class TimeAnimation extends Animation {
|
|
|
6685
7028
|
protected eventPayload(): Record<string, any>;
|
|
6686
7029
|
protected advanceToStopPosition(): void;
|
|
6687
7030
|
private _debouncedRangeChangeEvent;
|
|
7031
|
+
/**
|
|
7032
|
+
* Captures the current date as an anchor date for the range change event.
|
|
7033
|
+
*/
|
|
7034
|
+
private _captureRangeChangeAnchorDate;
|
|
7035
|
+
/**
|
|
7036
|
+
* Restores the anchor date for the range change event.
|
|
7037
|
+
*/
|
|
7038
|
+
private _restoreRangeChangeAnchorDate;
|
|
6688
7039
|
}
|
|
6689
7040
|
|
|
6690
7041
|
export declare type TimeAnimationInfo = {
|
|
@@ -7023,11 +7374,12 @@ export declare const units: {
|
|
|
7023
7374
|
readonly percent: "%";
|
|
7024
7375
|
};
|
|
7025
7376
|
};
|
|
7377
|
+
resolveMeasurementForUnits: (type: _units.ConversionMeasurement) => _units.Measurement;
|
|
7026
7378
|
defaultUnits: Record<"metric" | "imperial", MapUnits>;
|
|
7027
|
-
getDefaultUnit: (type: _units.
|
|
7028
|
-
getDefaultUnitsForSystem: (system: "
|
|
7379
|
+
getDefaultUnit: (type: _units.ConversionMeasurement, system: "metric" | "imperial" | "custom") => string;
|
|
7380
|
+
getDefaultUnitsForSystem: (system: "metric" | "imperial" | "custom") => MapUnits;
|
|
7029
7381
|
equalUnits: (units1: MapUnits, units2: MapUnits) => boolean;
|
|
7030
|
-
getSystemForUnits: (units: MapUnits) => "
|
|
7382
|
+
getSystemForUnits: (units: MapUnits) => "metric" | "imperial" | "custom";
|
|
7031
7383
|
FtoC: (f: number) => number;
|
|
7032
7384
|
CtoF: (c: number) => number;
|
|
7033
7385
|
mphToKph: (mph: number) => number;
|
|
@@ -7059,6 +7411,7 @@ export declare const units: {
|
|
|
7059
7411
|
msToMphUnit: (ms: number) => number;
|
|
7060
7412
|
dbzToMMRate: (dbz: number, perSecond?: boolean) => number;
|
|
7061
7413
|
degToDir: (d: number) => string;
|
|
7414
|
+
getUnitPrecision: (unit: string) => number;
|
|
7062
7415
|
convert: (type: string, value: number, from: string, to: string) => number;
|
|
7063
7416
|
getMeasurementType: (str: string) => _units.Measurement;
|
|
7064
7417
|
};
|
|
@@ -7068,6 +7421,8 @@ declare namespace _units {
|
|
|
7068
7421
|
UnitSystem,
|
|
7069
7422
|
Units,
|
|
7070
7423
|
Measurement,
|
|
7424
|
+
ConversionMeasurement,
|
|
7425
|
+
resolveMeasurementForUnits,
|
|
7071
7426
|
defaultUnits,
|
|
7072
7427
|
getDefaultUnit,
|
|
7073
7428
|
getDefaultUnitsForSystem,
|
|
@@ -7104,6 +7459,7 @@ declare namespace _units {
|
|
|
7104
7459
|
msToMphUnit,
|
|
7105
7460
|
dbzToMMRate,
|
|
7106
7461
|
degToDir,
|
|
7462
|
+
getUnitPrecision,
|
|
7107
7463
|
convert,
|
|
7108
7464
|
getMeasurementType
|
|
7109
7465
|
}
|
|
@@ -7161,6 +7517,9 @@ export declare const VectorSourceType: {
|
|
|
7161
7517
|
|
|
7162
7518
|
export declare type VectorSourceType = ObjectValue<typeof VectorSourceType>;
|
|
7163
7519
|
|
|
7520
|
+
/** Static vector tile data or time-series container for animated vector tiles. */
|
|
7521
|
+
export declare type VectorTileData = VectorData | VectorTimeSeriesData;
|
|
7522
|
+
|
|
7164
7523
|
/**
|
|
7165
7524
|
* A {@link TileSource} for vector tile data.
|
|
7166
7525
|
* Vector tiles are a compact representation of geographic data. They are typically used to render map data in a vector
|
|
@@ -7168,25 +7527,32 @@ export declare type VectorSourceType = ObjectValue<typeof VectorSourceType>;
|
|
|
7168
7527
|
* Vector tiles are typically served as a compressed binary format, such as
|
|
7169
7528
|
* Mapbox's [MVT](https://docs.mapbox.com/vector-tiles/reference/mapbox-vector-tile-spec/).
|
|
7170
7529
|
*/
|
|
7171
|
-
export declare class VectorTileSource extends TileSource<
|
|
7530
|
+
export declare class VectorTileSource extends TileSource<VectorTileData, VectorSourceSpecification> {
|
|
7172
7531
|
|
|
7532
|
+
/**
|
|
7533
|
+
* Tracks deferred tile refresh requests while a tile is still loading.
|
|
7534
|
+
* Map key: tile coord hash.
|
|
7535
|
+
* Map value: layer ids to refresh once parsing completes (`*` means refresh all consumers).
|
|
7536
|
+
*/
|
|
7537
|
+
private readonly _pendingRefreshByTile;
|
|
7173
7538
|
get type(): string;
|
|
7174
7539
|
|
|
7175
7540
|
constructor(id: string, spec: Partial<VectorSourceSpecification>);
|
|
7176
|
-
|
|
7177
|
-
hasTileData(coord: TileCoord, layerId?: string, allowExpired?: boolean): boolean;
|
|
7541
|
+
hasTileData(coord: TileCoord, layerId?: string, allowExpired?: boolean, _intervals?: Array<Date>): boolean;
|
|
7178
7542
|
expireAllTiles(): void;
|
|
7179
|
-
expireTile(tile: Tile<
|
|
7543
|
+
expireTile(tile: Tile<VectorTileData>): void;
|
|
7544
|
+
addConsumer(consumer: DataSourceConsumer): void;
|
|
7180
7545
|
/**
|
|
7181
7546
|
* Refreshes the data for all tiles in the source.
|
|
7547
|
+
* @param layerId - The layer ID to refresh. If not provided, all layers will be refreshed.
|
|
7182
7548
|
*/
|
|
7183
7549
|
refreshAllTileData(layerId?: string): void;
|
|
7184
7550
|
/**
|
|
7185
|
-
* Refreshes the data for a single tile in the source by re-parsing the existing data. This is useful when
|
|
7186
|
-
* filter expression has changed for a consuming layer.
|
|
7551
|
+
* Refreshes the data for a single tile in the source by re-parsing the existing data. This is useful when a new
|
|
7552
|
+
* consumer is added or the filter expression has changed for a consuming layer.
|
|
7187
7553
|
* @param tile - The tile to refresh.
|
|
7188
7554
|
*/
|
|
7189
|
-
refreshTileData(tile: Tile<
|
|
7555
|
+
refreshTileData(tile: Tile<VectorTileData>, layerId?: string): Promise<void>;
|
|
7190
7556
|
|
|
7191
7557
|
}
|
|
7192
7558
|
|
|
@@ -7364,10 +7730,9 @@ export declare type WeatherLayerOptions = {
|
|
|
7364
7730
|
*/
|
|
7365
7731
|
timing: Partial<Omit<LayerTiming, 'mode'>>;
|
|
7366
7732
|
/**
|
|
7367
|
-
* Filter expression
|
|
7368
|
-
* sources whose tiles are in the Mapbox Vector Tile (MVT) format.
|
|
7733
|
+
* Filter expression for vector tile layers. Evaluated with StyleExpression.
|
|
7369
7734
|
*/
|
|
7370
|
-
filter:
|
|
7735
|
+
filter: FilterExpression;
|
|
7371
7736
|
/**
|
|
7372
7737
|
* Paint style overrides for the layer.
|
|
7373
7738
|
*/
|
|
@@ -7513,7 +7878,14 @@ get mask(): LayerMask;
|
|
|
7513
7878
|
* @readonly
|
|
7514
7879
|
*/
|
|
7515
7880
|
get isDirty(): boolean;
|
|
7516
|
-
|
|
7881
|
+
/**
|
|
7882
|
+
* Optional measurement metadata associated with this layer's values.
|
|
7883
|
+
*/
|
|
7884
|
+
measurement: {
|
|
7885
|
+
type: ConversionMeasurement;
|
|
7886
|
+
units: string;
|
|
7887
|
+
} | undefined;
|
|
7888
|
+
constructor(id: string, { source, renderer, measurement }: Partial<WebGLLayerConfig>);
|
|
7517
7889
|
/**
|
|
7518
7890
|
* Shows the layer if it is hidden.
|
|
7519
7891
|
*/
|
|
@@ -7542,9 +7914,11 @@ get mask(): LayerMask;
|
|
|
7542
7914
|
* GeoJSON layer style will return the model properties associated with the feature at that location.
|
|
7543
7915
|
* @param coord - Geographic coordinate to query for features.
|
|
7544
7916
|
* @param zoom - Zoom level to query for features. If not provided, the map's current zoom level will be used.
|
|
7917
|
+
* @param allowPartials - Whether to use partial data (ancestor or descendant) if the exact tile is not loaded.
|
|
7918
|
+
* @param requestIfMissing - Whether to request the tile if it is missing.
|
|
7545
7919
|
* @returns The features found at the specified coordinate and zoom level.
|
|
7546
7920
|
*/
|
|
7547
|
-
queryFeatures(coord: Coordinate, zoom: number, allowPartials: boolean): FeatureQueryResult;
|
|
7921
|
+
queryFeatures(coord: Coordinate, zoom: number, allowPartials: boolean, requestIfMissing?: boolean): FeatureQueryResult;
|
|
7548
7922
|
/**
|
|
7549
7923
|
* Returns a Promise that will query the layer for all features at the specified coordinate and zoom level
|
|
7550
7924
|
* (optional). If a value for `zoom` is not provided, then the map's current zoom level will be used.
|
|
@@ -7605,5 +7979,12 @@ export declare interface WebGLLayerConfig {
|
|
|
7605
7979
|
* Animation instance that controls the animation of this layer if time-based.
|
|
7606
7980
|
*/
|
|
7607
7981
|
animation: Animation;
|
|
7982
|
+
/**
|
|
7983
|
+
* Optional measurement metadata associated with this layer's values.
|
|
7984
|
+
*/
|
|
7985
|
+
measurement: {
|
|
7986
|
+
type: ConversionMeasurement;
|
|
7987
|
+
units: string;
|
|
7988
|
+
};
|
|
7608
7989
|
}
|
|
7609
7990
|
|