map-gl-offline 0.5.6 → 0.6.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/README.md +89 -444
- package/dist/index.d.ts +17 -8
- package/dist/index.esm.js +2600 -2646
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2604 -2645
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +2604 -2645
- package/dist/index.umd.js.map +1 -1
- package/dist/managers/offlineMapManager/index.d.ts +3 -57
- package/dist/managers/offlineMapManager/regionManagement.d.ts +3 -2
- package/dist/managers/offlineMapManager/resourceManagement.d.ts +4 -4
- package/dist/services/regionService.d.ts +30 -2
- package/dist/services/resourceService.d.ts +4 -4
- package/dist/storage/indexedDbManager.d.ts +18 -15
- package/dist/style.css +1 -1
- package/dist/types/region.d.ts +49 -0
- package/dist/types/tile.d.ts +15 -0
- package/dist/ui/managers/downloadManager.d.ts +0 -5
- package/dist/ui/offlineManagerControl.d.ts +0 -11
- package/dist/utils/constants.d.ts +1 -1
- package/dist/utils/styleUtils.d.ts +8 -0
- package/package.json +1 -1
|
@@ -172,11 +172,6 @@ export declare class DownloadManager {
|
|
|
172
172
|
* @internal
|
|
173
173
|
*/
|
|
174
174
|
private updateUIForDownloadStart;
|
|
175
|
-
/**
|
|
176
|
-
* Normalize the style's sprite property into a uniform array of {id, url} sources.
|
|
177
|
-
* Handles string format, array format, and filters out already-patched idb:// URLs.
|
|
178
|
-
*/
|
|
179
|
-
private normalizeSpriteProperty;
|
|
180
175
|
/**
|
|
181
176
|
* Handle successful completion of a region download.
|
|
182
177
|
* Removes from tracking, resets UI if needed, and notifies listeners.
|
|
@@ -232,10 +232,6 @@ export declare class OfflineManagerControl implements IControl {
|
|
|
232
232
|
* ```
|
|
233
233
|
*/
|
|
234
234
|
loadOfflineStyle(styleId: string): Promise<void>;
|
|
235
|
-
/**
|
|
236
|
-
* Load styles from IndexedDB and apply to map
|
|
237
|
-
*/
|
|
238
|
-
private loadStylesFromIDB;
|
|
239
235
|
/**
|
|
240
236
|
* Show modal to select which style to load
|
|
241
237
|
*/
|
|
@@ -253,13 +249,6 @@ export declare class OfflineManagerControl implements IControl {
|
|
|
253
249
|
* ```
|
|
254
250
|
*/
|
|
255
251
|
loadOfflineStyles(): Promise<void>;
|
|
256
|
-
/**
|
|
257
|
-
* Load a specific offline style by its ID.
|
|
258
|
-
* Alias for `loadOfflineStyle()` for API clarity.
|
|
259
|
-
*
|
|
260
|
-
* @param styleId - The unique identifier of the stored style
|
|
261
|
-
*/
|
|
262
|
-
loadSpecificOfflineStyle(styleId: string): Promise<void>;
|
|
263
252
|
/**
|
|
264
253
|
* Update the style URL used for new region downloads.
|
|
265
254
|
*
|
|
@@ -27,7 +27,7 @@ export declare const TILE_CONFIG: {
|
|
|
27
27
|
export declare const GLYPH_CONFIG: {
|
|
28
28
|
readonly DEFAULT_URL: "https://tiles.openfreemap.org/fonts/{fontstack}/{range}.pbf";
|
|
29
29
|
readonly DEFAULT_RANGES: readonly ["0-255"];
|
|
30
|
-
readonly COMPREHENSIVE_RANGES: readonly ["0-255", "256-511", "512-767", "768-1023", "1024-1279", "1280-1535", "1536-1791", "1792-2047", "2048-2303", "2304-2559", "2560-2815", "2816-3071", "3072-3327", "3328-3583", "3584-3839", "3840-4095", "4096-4351", "4352-4607", "4608-4863", "11904-12031", "12032-12255", "12288-12543", "12544-12799", "19968-20223", "20224-20479", "40960-42127", "44032-55203", "63744-64255", "65280-65535"];
|
|
30
|
+
readonly COMPREHENSIVE_RANGES: readonly ["0-255", "256-511", "512-767", "768-1023", "1024-1279", "1280-1535", "1536-1791", "1792-2047", "2048-2303", "2304-2559", "2560-2815", "2816-3071", "3072-3327", "3328-3583", "3584-3839", "3840-4095", "4096-4351", "4352-4607", "4608-4863", "7680-7935", "8192-8447", "8448-8703", "11904-12031", "12032-12255", "12288-12543", "12544-12799", "19968-20223", "20224-20479", "40960-42127", "44032-55203", "63744-64255", "64256-64511", "65024-65279", "65280-65535"];
|
|
31
31
|
};
|
|
32
32
|
export declare const STYLE_CONFIG: {
|
|
33
33
|
readonly OPENFREEMAP_BASE: "https://tiles.openfreemap.org/styles";
|
|
@@ -17,6 +17,14 @@ export declare function patchStyleForOffline(style: MapboxStyle, downloadId: str
|
|
|
17
17
|
* syntax (e.g. `["step", ["zoom"], ["literal", ["Font A"]], 10, ["literal", ["Font B"]]]`).
|
|
18
18
|
*/
|
|
19
19
|
export declare function extractFontNamesFromTextField(textFont: unknown): string[];
|
|
20
|
+
/**
|
|
21
|
+
* Normalize a style's `sprite` property into a uniform array of {id, url} sources.
|
|
22
|
+
* Handles string format, array format, and filters out already-patched idb:// URLs.
|
|
23
|
+
*/
|
|
24
|
+
export declare function normalizeSpriteProperty(sprite: unknown): Array<{
|
|
25
|
+
id: string;
|
|
26
|
+
url: string;
|
|
27
|
+
}>;
|
|
20
28
|
/**
|
|
21
29
|
* Collect all unique font names referenced in a style's layers.
|
|
22
30
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "map-gl-offline",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
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",
|