map-gl-offline 0.8.7 → 0.8.8

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.
@@ -1,4 +1,13 @@
1
1
  import type { TileDownloadOptions, TileDownloadResult, TileStats, OfflineRegionOptions, MapboxStyle } from '../types';
2
+ /**
3
+ * Match a tile-URL template against the known-sparse Mapbox Standard
4
+ * sub-tilesets. Catches:
5
+ * - `mapbox://<tileset>` — original style source URL.
6
+ * - `.../v4/<tileset>.json...` — resolved TileJSON URL produced when the
7
+ * library resolves a `mapbox://` source URL into an HTTPS one.
8
+ * - `.../v4/<tileset>/{z}/{x}/{y}...` — resolved tile-template URL.
9
+ */
10
+ export declare function urlReferencesKnownSparseTileset(template: string): boolean;
2
11
  /**
3
12
  * Service for managing offline map tiles
4
13
  * Handles downloading, storing, and retrieving map tiles from IndexedDB
@@ -80,6 +80,20 @@ export interface TileDownloadOptions {
80
80
  * (old behavior — noisier, but guaranteed-complete).
81
81
  */
82
82
  probeSourcesBeforeDownload?: boolean;
83
+ /**
84
+ * Pre-skip a small allowlist of Mapbox Standard sub-tilesets that are
85
+ * sparse-by-design across the whole planet — `mapbox.indoor-v3`,
86
+ * `mapbox.landmark-pois-v1`, `mapbox.procedural-buildings-v1`. These
87
+ * have tiles only where indoor venues / landmark POIs / 3D buildings
88
+ * actually exist; for typical regions they return 404 for nearly every
89
+ * coordinate. Pre-skipping means we never issue probe or download
90
+ * requests for them, eliminating the 404 noise in devtools.
91
+ *
92
+ * Default: `true`. Set `false` to attempt these sources anyway — the
93
+ * downstream `probeSourcesBeforeDownload` pass will still skip them
94
+ * for most regions, but you'll see the probe 404s in the network log.
95
+ */
96
+ skipKnownSparseSources?: boolean;
83
97
  }
84
98
  /**
85
99
  * Result of a tile download operation
@@ -81,6 +81,19 @@ export declare const MAPBOX_API: {
81
81
  readonly MODELS_PATH: "/models/v1";
82
82
  readonly PROTOCOL: "mapbox://";
83
83
  };
84
+ /**
85
+ * Mapbox Standard sub-tilesets that are sparse-by-design across the planet.
86
+ * These only have tiles where the underlying feature (indoor venues, landmark
87
+ * POIs, 3D procedural buildings) actually exists, and return 404 for nearly
88
+ * every other coordinate. The tile downloader pre-skips any source whose tile
89
+ * URL templates reference one of these tileset IDs, so we never issue probe
90
+ * or download requests for them — eliminating the 404 noise in devtools.
91
+ *
92
+ * Matching is done against the tileset segment of the tile URL template
93
+ * (e.g. `https://api.mapbox.com/v4/mapbox.indoor-v3/{z}/{x}/{y}.vector.pbf`
94
+ * or `mapbox://mapbox.indoor-v3`).
95
+ */
96
+ export declare const MAPBOX_STANDARD_SPARSE_TILESETS: readonly ["mapbox.indoor-v3", "mapbox.landmark-pois-v1", "mapbox.procedural-buildings-v1"];
84
97
  export declare const MAP_PROVIDERS: {
85
98
  readonly AUTO: "auto";
86
99
  readonly MAPBOX: "mapbox";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "map-gl-offline",
3
- "version": "0.8.7",
3
+ "version": "0.8.8",
4
4
  "description": "A TypeScript-compatible npm package for MapLibre GL JS that enables comprehensive offline storage and usage of vector/raster tiles, sprites, styles, fonts (glyphs), and entire map regions with advanced analytics, import/export capabilities, and intelligent cleanup.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",