Skip to content

Commit 8693345

Browse files
FIX relative path style file (#23)
1 parent 76f936a commit 8693345

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+476
-433
lines changed

demos/maptiler-sdk.umd.js

Lines changed: 14 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/maptiler-sdk.min.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dist/maptiler-sdk.mjs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,11 @@ function styleToStyle(style) {
220220
return MapStyle[mapStylePresetList[0].referenceStyleID].getDefaultVariant().getExpandedStyleURL();
221221
}
222222
if (typeof style === "string" || style instanceof String) {
223-
return expandMapStyle(style);
223+
if (!style.startsWith("http") && style.toLowerCase().includes(".json")) {
224+
return style;
225+
} else {
226+
return expandMapStyle(style);
227+
}
224228
}
225229
if (style instanceof MapStyleVariant) {
226230
return style.getExpandedStyleURL();
@@ -357,13 +361,11 @@ class CustomGeolocateControl extends GeolocateControl$1 {
357361
const options = __spreadValues$1({
358362
bearing
359363
}, this.options.fitBoundsOptions);
360-
console.log("moving camera");
361364
this._map.fitBounds(center.toBounds(radius), options, {
362365
geolocateSource: true
363366
});
364367
let hasFittingBeenDisrupted = false;
365368
const flagFittingDisruption = () => {
366-
console.log("DISRUPTED FITTING!");
367369
hasFittingBeenDisrupted = true;
368370
};
369371
this._map.once("click", flagFittingDisruption);
@@ -373,7 +375,6 @@ class CustomGeolocateControl extends GeolocateControl$1 {
373375
this._map.once("touchstart", flagFittingDisruption);
374376
this._map.once("wheel", flagFittingDisruption);
375377
this._map.once("moveend", () => {
376-
console.log("done moving, with disruption:", hasFittingBeenDisrupted);
377378
this._map.off("click", flagFittingDisruption);
378379
this._map.off("dblclick", flagFittingDisruption);
379380
this._map.off("dragstart", flagFittingDisruption);
@@ -529,7 +530,6 @@ class Map extends maplibregl__default.Map {
529530
constructor(options) {
530531
var _a;
531532
const style = styleToStyle(options.style);
532-
console.log(style);
533533
const hashPreConstructor = location.hash;
534534
if (!config.apiKey) {
535535
console.warn(
@@ -540,7 +540,15 @@ class Map extends maplibregl__default.Map {
540540
style,
541541
maplibreLogo: false,
542542
transformRequest: (url) => {
543-
const reqUrl = new URL(url);
543+
let reqUrl = null;
544+
try {
545+
reqUrl = new URL(url);
546+
} catch (e) {
547+
return {
548+
url,
549+
headers: {}
550+
};
551+
}
544552
if (reqUrl.host === defaults.maptilerApiHost) {
545553
if (!reqUrl.searchParams.has("key")) {
546554
reqUrl.searchParams.append("key", config.apiKey);

dist/maptiler-sdk.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/maptiler-sdk.umd.js

Lines changed: 14 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/maptiler-sdk.umd.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/maptiler-sdk.umd.min.js

Lines changed: 34 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)