@xweather/mapsgl 1.9.1-beta.1 → 1.9.1

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/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2023, AerisWeather
1
+ Copyright (c) 2026, AerisWeather
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without
package/dist/mapsgl.css CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * @xweather/mapsgl - 1.9.1-beta.1
3
+ * @xweather/mapsgl - 1.9.1
4
4
  * (c) 2026 Vaisala Xweather
5
5
  * License: BSD
6
6
  * https://www.xweather.com
package/dist/mapsgl.d.ts CHANGED
@@ -2443,6 +2443,12 @@ export declare interface EncodedSourceSpecification<Dataset extends EncodedRaste
2443
2443
  * to snowfall). The original `datasets` are still used for tile requests.
2444
2444
  */
2445
2445
  effectiveDatasets?: Array<Partial<Dataset>>;
2446
+ /**
2447
+ * ID of a registered tile data transformer to run in the worker thread after tile data is loaded.
2448
+ * Preferred over `transformTileData` because it avoids serializing a function across threads.
2449
+ * @see TransformerId
2450
+ */
2451
+ transformerId?: string;
2446
2452
  /**
2447
2453
  * Optional function to transform tile data after it has been loaded. This allows for custom processing or
2448
2454
  * modification of the tile data before it is used for rendering, such as converting it to other values
@@ -2451,6 +2457,7 @@ export declare interface EncodedSourceSpecification<Dataset extends EncodedRaste
2451
2457
  * @param datasets - An array of dataset objects associated with this source, which contains information about the
2452
2458
  * original encoded data and its value ranges. This array can be modified in-place to update dataMin/dataMax
2453
2459
  * values for transformed data.
2460
+ * @deprecated Use `transformerId` instead to reference a registered transformer by ID.
2454
2461
  */
2455
2462
  transformTileData?: (data: RGBAImage, datasets: Array<Dataset>) => void;
2456
2463
  }
@@ -2577,6 +2584,7 @@ declare const ExpressionOperator: {
2577
2584
  readonly any: "any";
2578
2585
  readonly toNumber: "to-number";
2579
2586
  readonly toString: "to-string";
2587
+ readonly toDate: "to-date";
2580
2588
  readonly toLocaleString: "to-locale-string";
2581
2589
  readonly toUnit: "to-unit";
2582
2590
  readonly toBoolean: "to-boolean";
@@ -2624,7 +2632,15 @@ declare const ExpressionOperator: {
2624
2632
  readonly case: "case";
2625
2633
  readonly match: "match";
2626
2634
  readonly let: "let";
2635
+ /**
2636
+ * Active map timeline position as **Unix seconds** (from the map controller), not wall clock — use `now` for that.
2637
+ */
2638
+ readonly mapTime: "map-time";
2639
+ /**
2640
+ * @deprecated Prefer `map-time` — same semantics.
2641
+ */
2627
2642
  readonly time: "time";
2643
+ readonly now: "now";
2628
2644
  };
2629
2645
 
2630
2646
  export declare type ExpressionOperator = ObjectValue<typeof ExpressionOperator>;
@@ -3535,6 +3551,12 @@ export declare interface LayerSpecification {
3535
3551
  * zoom level than the current map zoom level.
3536
3552
  */
3537
3553
  zoomOffset?: number;
3554
+ /**
3555
+ * Whether to preload low-quality tiles when the layer is added or the time range changes,
3556
+ * ensuring fallback data is available immediately when panning or zooming beyond currently
3557
+ * loaded tile bounds. Default is `false`.
3558
+ */
3559
+ preloadLowQuality?: boolean;
3538
3560
  /**
3539
3561
  * Render style configuration.
3540
3562
  * @see PaintStyleSpec
@@ -5456,6 +5478,7 @@ export declare interface RenderFrameContextTileLayer {
5456
5478
  getDataZoom(): number;
5457
5479
  getVisibleTileCoords(zoom: number): TileCoord[];
5458
5480
  getCurrentInterval?(): TimeInterval | undefined;
5481
+ allowExpiredTilesForRender?: boolean;
5459
5482
  }
5460
5483
 
5461
5484
  declare const resolveMeasurementForUnits: (type: ConversionMeasurement) => Measurement;
@@ -6563,6 +6586,7 @@ declare abstract class TileLayer<Data> extends WebGLLayer<TileSource> {
6563
6586
  private upgradeDataQuality;
6564
6587
  private lastHiddenTime;
6565
6588
  private tileLoadProgress;
6589
+ private _preloadLowQuality;
6566
6590
  /**
6567
6591
  * Returns the layer's data render quality.
6568
6592
  * @see DataQuality
@@ -6578,7 +6602,12 @@ declare abstract class TileLayer<Data> extends WebGLLayer<TileSource> {
6578
6602
  * @param id - Unique identifier of the layer.
6579
6603
  * @param config - Config options for the layer.
6580
6604
  */
6581
- constructor(id: string, { quality, ...config }: Partial<TileLayerConfig>);
6605
+ constructor(id: string, { quality, preloadLowQuality, ...config }: Partial<TileLayerConfig>);
6606
+ /**
6607
+ * Returns whether expired tiles can still be used for rendering/LOD fallback.
6608
+ * Default is disabled so stale tiles are not rendered after data refreshes.
6609
+ */
6610
+ shouldRenderExpiredTiles(): boolean;
6582
6611
  refresh(clear?: boolean): void;
6583
6612
  /**
6584
6613
  * Returns the layer's tile cache so renderers can use it via RenderFrameContext instead of accessing layer.source.tiles.
@@ -6594,11 +6623,21 @@ declare abstract class TileLayer<Data> extends WebGLLayer<TileSource> {
6594
6623
  /**
6595
6624
  * Returns the data zoom level used for the specified map zoom level based on the configured `quality` level.
6596
6625
  * @param zoom - Map zoom level to get the data zoom level for.
6597
- * @param reduceDataQuality - Whether to reduce the data quality by 1 level.
6598
- * @returns Data zoom level.
6626
+ * @param scale - Scale to apply to the data quality.
6627
+ * @remarks
6628
+ * The scale parameter is used to reduce the data quality by a factor of the specified scale. For example, if the
6629
+ * scale is 0.5, the data quality will be reduced by half. If the scale is 0.25, the data quality will be reduced
6630
+ * by one-quarter.
6631
+ * @returns Data zoom level, optionally adjusted by the data quality scale and clamped to the source's min/max zoom
6632
+ * levels.
6599
6633
  */
6600
- getDataZoom(zoom?: number, reduceDataQuality?: boolean): number;
6601
- preloadWorldTile(): void;
6634
+ getDataZoom(zoom?: number, scale?: number): number;
6635
+ /**
6636
+ * Preloads low-quality tiles for the layer at the specified zoom level. This is used to ensure we can render data
6637
+ * anywhere quickly when zooming in our out beyond partial bounds for tiles not yet loaded.
6638
+ * @param zoom : Zoom level to preload low-quality tiles for.
6639
+ */
6640
+ preloadLowQualityTiles(zoom?: number): void;
6602
6641
  /**
6603
6642
  * Returns the tile at the specified geographic coordinate.
6604
6643
  * @param coord - Geographic coordinate to get the tile for.
@@ -6614,6 +6653,7 @@ declare abstract class TileLayer<Data> extends WebGLLayer<TileSource> {
6614
6653
  * @returns Array of visible tile coordinates.
6615
6654
  */
6616
6655
  getVisibleTileCoords(): Array<TileCoord>;
6656
+ private _alreadyPreloadedLowQualityTiles;
6617
6657
  /**
6618
6658
  * Requests visible tiles from the tile pyramid.
6619
6659
  * @param reload - Whether to reload tiles that have already been requested.
@@ -6633,6 +6673,8 @@ declare abstract class TileLayer<Data> extends WebGLLayer<TileSource> {
6633
6673
  private onLoadProgress;
6634
6674
  private onLoadStart;
6635
6675
  private onLoadComplete;
6676
+ private _shouldRequestTiles;
6677
+ onTimelineRangeChange(e: any): void;
6636
6678
  protected onTimeSeriesDataChange(): void;
6637
6679
  protected onMaskLayerChange(): void;
6638
6680
  protected onMaskStateChange(): void;
@@ -6655,6 +6697,12 @@ export declare interface TileLayerConfig extends WebGLLayerConfig {
6655
6697
  * at a different zoom level than the map's zoom level.
6656
6698
  */
6657
6699
  zoomOffset: number;
6700
+ /**
6701
+ * Whether to preload low-quality tiles when the layer is added or the time range changes,
6702
+ * ensuring fallback data is available immediately when panning or zooming beyond currently
6703
+ * loaded tile bounds. Default is `false`.
6704
+ */
6705
+ preloadLowQuality: boolean;
6658
6706
  }
6659
6707
 
6660
6708
  export declare type TilePositionData = {
@@ -7770,6 +7818,12 @@ export declare type WeatherLayerOptions = {
7770
7818
  * value is `true`.
7771
7819
  */
7772
7820
  cities: boolean;
7821
+ /**
7822
+ * Whether to preload low-quality tiles when the layer is added or the time range changes,
7823
+ * ensuring fallback data is available immediately when panning or zooming beyond currently
7824
+ * loaded tile bounds. Default is `false`.
7825
+ */
7826
+ preloadLowQuality: boolean;
7773
7827
  }>;
7774
7828
  /**
7775
7829
  * Options for configuring the layer's timing behavior, for time-based data only.
@@ -7905,6 +7959,21 @@ get mask(): LayerMask;
7905
7959
  * @readonly
7906
7960
  */
7907
7961
  get visible(): boolean;
7962
+ /**
7963
+ * Registers another layer as depending on this layer (for example it reads this layer via `queryFeatures`
7964
+ * while this layer may be hidden). When the registry is non-empty, time-series data providers may load tiles even
7965
+ * if this layer is not visible.
7966
+ */
7967
+ registerDependentLayer(layer: WebGLLayer): void;
7968
+ /**
7969
+ * Removes a layer from this layer's dependent registry.
7970
+ */
7971
+ unregisterDependentLayer(layer: WebGLLayer): void;
7972
+ /**
7973
+ * Whether any layer has registered as a dependent via
7974
+ * {@link WebGLLayer.registerDependentLayer}.
7975
+ */
7976
+ hasDependentLayers(): boolean;
7908
7977
  /**
7909
7978
  * Returns whether this layer is enabled or not.
7910
7979
  */