Skip to content

Commit 46910ff

Browse files
author
Les Moffat
committed
RD-902 Fixes MapLibre direct import due to CJS issues
1 parent 7c59f89 commit 46910ff

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/caching.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { GetResourceResponse, RequestParameters, ResourceType } from "mapli
22

33
import { config } from "./config";
44

5-
import { addProtocol } from "maplibre-gl";
5+
import maplibregl from "maplibre-gl";
66

77
import { defaults } from "./constants/defaults";
88

@@ -14,6 +14,8 @@ const CACHE_LIMIT_ITEMS = 1000;
1414
const CACHE_LIMIT_CHECK_INTERVAL = 100;
1515
export const CACHE_API_AVAILABLE = typeof caches !== "undefined";
1616

17+
const { addProtocol } = maplibregl;
18+
1719
export function localCacheTransformRequest(reqUrl: URL, resourceType?: ResourceType): string {
1820
if (CACHE_API_AVAILABLE && config.caching && config.session && reqUrl.host === defaults.maptilerApiHost) {
1921
if (resourceType === "Source" && reqUrl.href.includes("tiles.json")) {

0 commit comments

Comments
 (0)