map-gl-offline 0.8.4 → 0.8.5
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/index.d.ts +1 -1
- package/dist/index.esm.js +5 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +5 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/ui/offlineManagerControl.d.ts +15 -4
- package/package.json +1 -1
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
*
|
|
35
35
|
* @module offlineManagerControl
|
|
36
36
|
*/
|
|
37
|
-
import type { IControl
|
|
37
|
+
import type { IControl } from 'maplibre-gl';
|
|
38
38
|
import { OfflineMapManager } from '@/managers/offlineMapManager';
|
|
39
39
|
/**
|
|
40
40
|
* Request shape MapLibre passes to a protocol handler. `type` indicates how
|
|
@@ -63,6 +63,17 @@ export interface MapLibProtocol {
|
|
|
63
63
|
addProtocol: (protocol: string, handler: (params: MapLibProtocolRequest) => Promise<MapLibProtocolResponse>) => void;
|
|
64
64
|
removeProtocol: (protocol: string) => void;
|
|
65
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Minimal structural type for the host map `OfflineManagerControl` is added to.
|
|
68
|
+
*
|
|
69
|
+
* The control works with both MapLibre GL JS and Mapbox GL JS. Typing the
|
|
70
|
+
* `onAdd` parameter structurally — rather than as a specific renderer's `Map`
|
|
71
|
+
* — lets the control satisfy *either* library's `IControl`, so it can be added
|
|
72
|
+
* via `map.addControl()` on either renderer without a cast. See issue #39.
|
|
73
|
+
*/
|
|
74
|
+
export interface ControlMap {
|
|
75
|
+
getContainer(): HTMLElement;
|
|
76
|
+
}
|
|
66
77
|
/**
|
|
67
78
|
* Configuration options for the OfflineManagerControl.
|
|
68
79
|
*
|
|
@@ -94,7 +105,7 @@ export interface OfflineManagerControlOptions {
|
|
|
94
105
|
/**
|
|
95
106
|
* MapLibre GL JS control for managing offline map regions.
|
|
96
107
|
*
|
|
97
|
-
* Implements the IControl interface to integrate with MapLibre GL maps.
|
|
108
|
+
* Implements the IControl interface to integrate with MapLibre GL and Mapbox GL maps.
|
|
98
109
|
* Provides a complete UI for downloading, managing, and loading offline map data.
|
|
99
110
|
*
|
|
100
111
|
* The control automatically intercepts fetch requests to serve offline resources
|
|
@@ -153,10 +164,10 @@ export declare class OfflineManagerControl implements IControl {
|
|
|
153
164
|
* Called when the control is added to a map.
|
|
154
165
|
* Implements the IControl.onAdd interface method.
|
|
155
166
|
*
|
|
156
|
-
* @param map - The MapLibre GL map instance
|
|
167
|
+
* @param map - The MapLibre GL or Mapbox GL map instance
|
|
157
168
|
* @returns The control's container element
|
|
158
169
|
*/
|
|
159
|
-
onAdd(map:
|
|
170
|
+
onAdd(map: ControlMap): HTMLElement;
|
|
160
171
|
/**
|
|
161
172
|
* Called when the control is removed from a map.
|
|
162
173
|
* Implements the IControl.onRemove interface method.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "map-gl-offline",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.5",
|
|
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",
|