map-gl-offline 0.8.5 → 0.8.7
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 +61 -0
- package/dist/index.esm.js +12 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +12 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/managers/offlineMapManager/analyticsManagement.d.ts +1 -1
- package/dist/managers/offlineMapManager/base.d.ts +5 -5
- package/dist/managers/offlineMapManager/cleanupManagement.d.ts +1 -1
- package/dist/managers/offlineMapManager/importExportManagement.d.ts +1 -1
- package/dist/managers/offlineMapManager/maintenanceManagement.d.ts +1 -1
- package/dist/managers/offlineMapManager/regionManagement.d.ts +1 -1
- package/dist/managers/offlineMapManager/resourceManagement.d.ts +1 -1
- package/dist/managers/offlineMapManager/styleManagement.d.ts +3 -3
- package/dist/services/analyticsService.d.ts +1 -1
- package/dist/services/cleanupService.d.ts +1 -1
- package/dist/services/fontService.d.ts +1 -1
- package/dist/services/glyphService.d.ts +1 -1
- package/dist/services/importExportService.d.ts +1 -1
- package/dist/services/maintenanceService.d.ts +2 -2
- package/dist/services/modelService.d.ts +1 -1
- package/dist/services/regionService.d.ts +1 -1
- package/dist/services/resourceService.d.ts +2 -2
- package/dist/services/spriteService.d.ts +1 -1
- package/dist/services/styleService.d.ts +2 -2
- package/dist/services/tileService.d.ts +1 -1
- package/dist/storage/indexedDbManager.d.ts +1 -1
- package/dist/types/maintenance.d.ts +1 -1
- package/dist/types/region.d.ts +21 -3
- package/dist/types/style.d.ts +6 -2
- package/dist/ui/components/PanelActions.d.ts +1 -1
- package/dist/ui/components/PanelHeader.d.ts +1 -1
- package/dist/ui/components/RegionList.d.ts +1 -1
- package/dist/ui/components/shared/LanguageSelector.d.ts +1 -1
- package/dist/ui/components/shared/MapControlButton.d.ts +1 -1
- package/dist/ui/components/shared/PanelContent.d.ts +3 -3
- package/dist/ui/components/shared/RegionDrawingTool.d.ts +2 -2
- package/dist/ui/controls/polygonControl.d.ts +1 -1
- package/dist/ui/controls/regionControl.d.ts +4 -4
- package/dist/ui/managers/ControlButtonManager.d.ts +1 -1
- package/dist/ui/managers/PanelManager.d.ts +3 -3
- package/dist/ui/managers/downloadManager.d.ts +2 -2
- package/dist/ui/modals/mbtilesModal.d.ts +1 -1
- package/dist/ui/modals/regionDetailsModal.d.ts +1 -1
- package/dist/ui/modals/regionFormModal.d.ts +3 -3
- package/dist/ui/offlineManagerControl.d.ts +6 -3
- package/dist/utils/convertStyleForSW.d.ts +1 -1
- package/dist/utils/download.d.ts +1 -1
- package/dist/utils/importResolver.d.ts +1 -1
- package/dist/utils/styleProviderUtils.d.ts +1 -1
- package/dist/utils/styleUtils.d.ts +1 -1
- package/dist/utils/validation.d.ts +1 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -11388,7 +11388,7 @@ class PanelRenderer extends BaseComponent {
|
|
|
11388
11388
|
try {
|
|
11389
11389
|
const { loadStyleById } = await Promise.resolve().then(function () { return styleService; });
|
|
11390
11390
|
const styleEntry = await loadStyleById(region.styleId);
|
|
11391
|
-
accessToken = styleEntry?.accessToken;
|
|
11391
|
+
accessToken = styleEntry?.accessToken ?? undefined;
|
|
11392
11392
|
}
|
|
11393
11393
|
catch {
|
|
11394
11394
|
panelLogger.warn('Could not retrieve access token from stored style');
|
|
@@ -12835,7 +12835,17 @@ class RegionControl {
|
|
|
12835
12835
|
const styleUrl = this.options.styleUrl;
|
|
12836
12836
|
if (!styleUrl)
|
|
12837
12837
|
return new Set();
|
|
12838
|
-
|
|
12838
|
+
// Resolve mapbox:// style URLs — fetch() cannot load the mapbox: scheme
|
|
12839
|
+
// and throws "URL scheme \"mapbox\" is not supported" otherwise.
|
|
12840
|
+
let fetchUrl = styleUrl;
|
|
12841
|
+
if (isMapboxProtocol(styleUrl)) {
|
|
12842
|
+
if (!this.options.accessToken) {
|
|
12843
|
+
regionLogger.warn('Cannot resolve mapbox:// style URL for source filtering without an access token');
|
|
12844
|
+
return new Set();
|
|
12845
|
+
}
|
|
12846
|
+
fetchUrl = resolveMapboxUrl(styleUrl, this.options.accessToken);
|
|
12847
|
+
}
|
|
12848
|
+
const response = await fetch(fetchUrl);
|
|
12839
12849
|
if (!response.ok)
|
|
12840
12850
|
return new Set();
|
|
12841
12851
|
const styleJson = (await response.json());
|