@mapcreator/sdk 3.1.0 → 3.1.2
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/Video.d.ts +0 -7
- package/dist/i18n.d.ts +1 -0
- package/dist/locales/en_GB/strings.json.d.ts +2 -1
- package/dist/mapcreator-sdk.bundler.mjs +347 -328
- package/dist/mapcreator-sdk.mjs +32 -32
- package/package.json +1 -1
|
@@ -2892,27 +2892,28 @@ function Tn(e, t) {
|
|
|
2892
2892
|
//#endregion
|
|
2893
2893
|
//#region src/images/search.svg?raw
|
|
2894
2894
|
var En = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"currentColor\"><path d=\"M5.374.952a4.546 4.546 0 0 1 4.656 4.175 4.55 4.55 0 0 1-.958 3.184l1.824 1.81a.55.55 0 0 1 0 .765.55.55 0 0 1-.602.121.6.6 0 0 1-.179-.12l-1.807-1.81A4.544 4.544 0 0 1 .953 5.376 4.553 4.553 0 0 1 5.374.952m1.454 1.37a3.447 3.447 0 0 0-4.505 4.51 3.45 3.45 0 0 0 3.186 2.13A3.45 3.45 0 0 0 8.957 5.51a3.455 3.455 0 0 0-2.129-3.187\"/></svg>\n", Dn = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"currentColor\"><path d=\"m7.038 5.96 3.03 3.03L13.1 5.958l1.01 1.01L11.078 10l3.031 3.032-1.01 1.01-3.031-3.031-3.03 3.028-1.01-1.01L9.059 10l-3.03-3.03z\"/></svg>\n", On = {
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2895
|
+
search: "Search",
|
|
2896
|
+
videoAlert: "The video will only work when you publish the map",
|
|
2897
|
+
mobileHelpText: "Use two fingers to move the map",
|
|
2898
|
+
windowsHelpText: "Use Ctrl + scroll to zoom the map",
|
|
2899
|
+
macHelpText: "Use ⌘ + scroll to zoom the map"
|
|
2900
|
+
}, kn = {
|
|
2901
|
+
search: "Suche",
|
|
2902
|
+
videoAlert: "Das Video ist in der veröffentlichten Karte sichtbar.",
|
|
2903
|
+
mobileHelpText: "Verwenden Sie zwei Finger um die Karte zu bewegen",
|
|
2904
|
+
windowsHelpText: "Verwenden Sie Strg + Scroll um in der Karte zu zoomen",
|
|
2905
|
+
macHelpText: "Verwenden Sie ⌘ + Scroll um in der Karte zu zoomen"
|
|
2906
|
+
}, An = {
|
|
2907
|
+
search: "Search",
|
|
2908
|
+
videoAlert: "The video will only work when you publish the map",
|
|
2909
|
+
mobileHelpText: "Use two fingers to move the map",
|
|
2910
|
+
windowsHelpText: "Use Ctrl + scroll to zoom the map",
|
|
2911
|
+
macHelpText: "Use ⌘ + scroll to zoom the map",
|
|
2912
|
+
loadingMap: "Loading map"
|
|
2913
|
+
}, jn = {
|
|
2914
|
+
da_DK: On,
|
|
2915
|
+
de_DE: kn,
|
|
2916
|
+
en_GB: An,
|
|
2916
2917
|
es_ES: {
|
|
2917
2918
|
search: "Buscar",
|
|
2918
2919
|
videoAlert: "The video will only work when you publish the map",
|
|
@@ -2942,17 +2943,17 @@ var En = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" v
|
|
|
2942
2943
|
macHelpText: "Gebruik ⌘ + Scroll om de kaart te zoomen"
|
|
2943
2944
|
}
|
|
2944
2945
|
};
|
|
2945
|
-
function
|
|
2946
|
-
let e = navigator.language.replace("-", "_"), t = Object.keys(
|
|
2946
|
+
function Mn() {
|
|
2947
|
+
let e = navigator.language.replace("-", "_"), t = Object.keys(jn);
|
|
2947
2948
|
return t.find((t) => t === e) ?? t.find((t) => t.split("_")[0] === e.split("_")[0]) ?? "en_GB";
|
|
2948
2949
|
}
|
|
2949
|
-
var
|
|
2950
|
-
function
|
|
2951
|
-
return
|
|
2950
|
+
var Nn = Mn();
|
|
2951
|
+
function Pn(e) {
|
|
2952
|
+
return jn[Nn][e] ?? An[e] ?? e;
|
|
2952
2953
|
}
|
|
2953
2954
|
//#endregion
|
|
2954
2955
|
//#region src/utils/graphhopper.ts
|
|
2955
|
-
var
|
|
2956
|
+
var Fn = class {
|
|
2956
2957
|
async getLocationInBounds(e, t, n = 10) {
|
|
2957
2958
|
try {
|
|
2958
2959
|
let r = await this._callGraphHopper({
|
|
@@ -2967,7 +2968,7 @@ var Mn = class {
|
|
|
2967
2968
|
}
|
|
2968
2969
|
async _callGraphHopper(e) {
|
|
2969
2970
|
let t = new URLSearchParams(e);
|
|
2970
|
-
t.append("key", "c5c40ac9-ed73-4e20-aed6-cfe495604ca8"), t.append("locale",
|
|
2971
|
+
t.append("key", "c5c40ac9-ed73-4e20-aed6-cfe495604ca8"), t.append("locale", Nn.slice(0, 2));
|
|
2971
2972
|
let n = { headers: { Accept: "application/json" } }, r = `https://graphhopper.com/api/1/geocode?${t}`;
|
|
2972
2973
|
return await (await fetch(r, n)).json();
|
|
2973
2974
|
}
|
|
@@ -2994,7 +2995,7 @@ var Mn = class {
|
|
|
2994
2995
|
].filter(Boolean).join(", ")
|
|
2995
2996
|
}));
|
|
2996
2997
|
}
|
|
2997
|
-
},
|
|
2998
|
+
}, In = class {
|
|
2998
2999
|
map;
|
|
2999
3000
|
mapContainer;
|
|
3000
3001
|
container;
|
|
@@ -3004,7 +3005,7 @@ var Mn = class {
|
|
|
3004
3005
|
inputWrapper;
|
|
3005
3006
|
button;
|
|
3006
3007
|
isOpen = !1;
|
|
3007
|
-
geocoder = new
|
|
3008
|
+
geocoder = new Fn();
|
|
3008
3009
|
suggestions = [];
|
|
3009
3010
|
items = [];
|
|
3010
3011
|
index = 0;
|
|
@@ -3013,7 +3014,7 @@ var Mn = class {
|
|
|
3013
3014
|
this.map = e, this.container = document.createElement("div"), this.control = document.createElement("div"), this.input = document.createElement("input"), this.dropdown = document.createElement("div"), this.inputWrapper = document.createElement("div"), this.button = document.createElement("button"), this.mapContainer = this.map.getContainer();
|
|
3014
3015
|
}
|
|
3015
3016
|
init() {
|
|
3016
|
-
this.container.className = "geocoder-container", this.control.className = "geocoder-control", this.input.className = "geocoder-input", this.dropdown.className = "geocoder-dropdown", this.inputWrapper.className = "geocoder-input-wrapper", this.button.className = "control-button", this.input.type = "text", this.input.placeholder =
|
|
3017
|
+
this.container.className = "geocoder-container", this.control.className = "geocoder-control", this.input.className = "geocoder-input", this.dropdown.className = "geocoder-dropdown", this.inputWrapper.className = "geocoder-input-wrapper", this.button.className = "control-button", this.input.type = "text", this.input.placeholder = Pn("search"), this.button.innerHTML = En;
|
|
3017
3018
|
let e = document.createElement("button");
|
|
3018
3019
|
e.className = "geocoder-clear", e.innerHTML = Dn;
|
|
3019
3020
|
let t = document.createElement("div");
|
|
@@ -3098,29 +3099,29 @@ var Mn = class {
|
|
|
3098
3099
|
};
|
|
3099
3100
|
//#endregion
|
|
3100
3101
|
//#region src/utils/browser.ts
|
|
3101
|
-
function
|
|
3102
|
+
function Ln() {
|
|
3102
3103
|
return navigator.userAgent.toLowerCase().indexOf("mobile") >= 0;
|
|
3103
3104
|
}
|
|
3104
3105
|
//#endregion
|
|
3105
3106
|
//#region src/controls/webControls.ts
|
|
3106
|
-
function
|
|
3107
|
+
function Rn(e, t, n, r, i) {
|
|
3107
3108
|
let a = document.createElement("div");
|
|
3108
|
-
return a.classList.add("web-control", "adornment"),
|
|
3109
|
+
return a.classList.add("web-control", "adornment"), zn(e, i).forEach((e) => {
|
|
3109
3110
|
let i;
|
|
3110
3111
|
if (e === "zoomIn") i = on(t);
|
|
3111
3112
|
else if (e === "zoomOut") i = sn(t);
|
|
3112
3113
|
else if (e === "fullscreen") i = Cn(t);
|
|
3113
3114
|
else if (e === "geolocation") i = gn(t, n);
|
|
3114
3115
|
else if (e === "refresh") i = Tn(t, r);
|
|
3115
|
-
else if (e === "search") i = new
|
|
3116
|
+
else if (e === "search") i = new In(t).init();
|
|
3116
3117
|
else if (e === "toggleAdornments") i = nn(t, t.getContainer());
|
|
3117
3118
|
else return;
|
|
3118
3119
|
a.appendChild(i);
|
|
3119
3120
|
}), a;
|
|
3120
3121
|
}
|
|
3121
|
-
function
|
|
3122
|
+
function zn(e, t) {
|
|
3122
3123
|
let n = e.buttons.flatMap((e) => e === "zoom" ? ["zoomIn", "zoomOut"] : e);
|
|
3123
|
-
if (
|
|
3124
|
+
if (Ln()) {
|
|
3124
3125
|
let e = n.filter((e) => e !== "zoomIn" && e !== "zoomOut");
|
|
3125
3126
|
if (t) {
|
|
3126
3127
|
let t = e[0] === "search" ? 1 : 0;
|
|
@@ -3132,7 +3133,7 @@ function In(e, t) {
|
|
|
3132
3133
|
}
|
|
3133
3134
|
//#endregion
|
|
3134
3135
|
//#region src/adornments/copyright.ts
|
|
3135
|
-
var
|
|
3136
|
+
var Bn = {
|
|
3136
3137
|
here: {
|
|
3137
3138
|
href: "https://www.here.com/",
|
|
3138
3139
|
label: "© HERE 2025"
|
|
@@ -3146,19 +3147,19 @@ var Ln = {
|
|
|
3146
3147
|
label: "© OpenStreetMap"
|
|
3147
3148
|
}
|
|
3148
3149
|
};
|
|
3149
|
-
function
|
|
3150
|
+
function Vn(e, t, n) {
|
|
3150
3151
|
let r = document.createElement("div");
|
|
3151
3152
|
r.className = "adornment";
|
|
3152
3153
|
let i = () => {
|
|
3153
|
-
r.innerHTML =
|
|
3154
|
+
r.innerHTML = Wn(t, e, t.getScale(), n);
|
|
3154
3155
|
}, a = n.loadReference(e.font ?? "Arial, sans-serif").then(i);
|
|
3155
3156
|
return t.on("attributionchange", i), t.on("zoomend", i), t.on("resize", i), {
|
|
3156
3157
|
element: r,
|
|
3157
3158
|
ready: a
|
|
3158
3159
|
};
|
|
3159
3160
|
}
|
|
3160
|
-
function
|
|
3161
|
-
let t = Object.values(e.style.tileManagers), n = [
|
|
3161
|
+
function Hn(e) {
|
|
3162
|
+
let t = Object.values(e.style.tileManagers), n = [Bn.mapcreator], r = {
|
|
3162
3163
|
osm: !1,
|
|
3163
3164
|
here: !1
|
|
3164
3165
|
};
|
|
@@ -3169,16 +3170,16 @@ function zn(e) {
|
|
|
3169
3170
|
"attribution" in e && typeof e.attribution == "string" && (e.attribution.includes("OpenStreetMap") && (r.osm = !0), e.attribution.includes("HERE") && (r.here = !0));
|
|
3170
3171
|
}
|
|
3171
3172
|
}
|
|
3172
|
-
return r.osm && n.push(
|
|
3173
|
+
return r.osm && n.push(Bn.openStreetMap), r.here && n.push(Bn.here), n;
|
|
3173
3174
|
}
|
|
3174
|
-
function
|
|
3175
|
+
function Un(e, t, n) {
|
|
3175
3176
|
let r = document.createElement("span");
|
|
3176
3177
|
r.style.fontFamily = t.cssFamily, r.style.fontWeight = t.weight, r.style.fontStyle = t.style, r.style.fontSize = `${n}px`, r.style.position = "absolute", r.style.visibility = "hidden", r.innerText = e, document.body.appendChild(r);
|
|
3177
3178
|
let i = Math.max(r.offsetWidth, 1);
|
|
3178
3179
|
return r.remove(), i;
|
|
3179
3180
|
}
|
|
3180
|
-
function
|
|
3181
|
-
let { color: i = "#000000", font: a = "Arial, sans-serif", fontSize: o = 10, orientation: s = "horizontal", position: c } = t, l = r.resolve(a), u =
|
|
3181
|
+
function Wn(e, t, n, r) {
|
|
3182
|
+
let { color: i = "#000000", font: a = "Arial, sans-serif", fontSize: o = 10, orientation: s = "horizontal", position: c } = t, l = r.resolve(a), u = Hn(e), d = Un(u.map(({ label: e }) => e).join(" "), l, o), f = o * 1.2, p = s === "vertical", m = ["top_left", "bottom_left"].includes(c), h = p ? f : d, g = p ? d : f, _ = p ? m ? -90 : 90 : 0, v = p ? m ? .38 * o : .3 * o : .38 * o, y = u.map((e) => `<a href="${e.href}" target="_blank">${e.label}</a>`).join(" ");
|
|
3182
3183
|
return `
|
|
3183
3184
|
<svg
|
|
3184
3185
|
class="adornment-svg"
|
|
@@ -3204,7 +3205,7 @@ function Vn(e, t, n, r) {
|
|
|
3204
3205
|
}
|
|
3205
3206
|
//#endregion
|
|
3206
3207
|
//#region node_modules/@turf/meta/dist/esm/index.js
|
|
3207
|
-
function
|
|
3208
|
+
function Gn(e, t, n) {
|
|
3208
3209
|
if (e !== null) for (var r, i, a, o, s, c, l, u = 0, d = 0, f, p = e.type, m = p === "FeatureCollection", h = p === "Feature", g = m ? e.features.length : 1, _ = 0; _ < g; _++) {
|
|
3209
3210
|
l = m ? e.features[_].geometry : h ? e.geometry : e, f = l ? l.type === "GeometryCollection" : !1, s = f ? l.geometries.length : 1;
|
|
3210
3211
|
for (var v = 0; v < s; v++) {
|
|
@@ -3250,7 +3251,7 @@ function Hn(e, t, n) {
|
|
|
3250
3251
|
}
|
|
3251
3252
|
break;
|
|
3252
3253
|
case "GeometryCollection":
|
|
3253
|
-
for (r = 0; r < o.geometries.length; r++) if (
|
|
3254
|
+
for (r = 0; r < o.geometries.length; r++) if (Gn(o.geometries[r], t, n) === !1) return !1;
|
|
3254
3255
|
break;
|
|
3255
3256
|
default: throw Error("Unknown Geometry Type");
|
|
3256
3257
|
}
|
|
@@ -3260,8 +3261,8 @@ function Hn(e, t, n) {
|
|
|
3260
3261
|
}
|
|
3261
3262
|
//#endregion
|
|
3262
3263
|
//#region src/adornments/insetMap.ts
|
|
3263
|
-
var
|
|
3264
|
-
function
|
|
3264
|
+
var Kn = 100;
|
|
3265
|
+
function qn(e, t, n, r) {
|
|
3265
3266
|
let i = document.createElement("div");
|
|
3266
3267
|
i.className = "adornment";
|
|
3267
3268
|
let a = e.scale ?? 1;
|
|
@@ -3299,33 +3300,33 @@ function Wn(e, t, n, r) {
|
|
|
3299
3300
|
});
|
|
3300
3301
|
s.push(e);
|
|
3301
3302
|
}
|
|
3302
|
-
|
|
3303
|
-
let c = Promise.all(s).then(() =>
|
|
3303
|
+
Jn(o), r !== "interactive" && t.on("resize", () => Jn(o));
|
|
3304
|
+
let c = Promise.all(s).then(() => Jn(o)).catch(() => {});
|
|
3304
3305
|
return t.on("moveend", () => {
|
|
3305
|
-
o.moveEndPosition = t.getCenter(), (o.isGlobe || o.globeFallbackActive) &&
|
|
3306
|
+
o.moveEndPosition = t.getCenter(), (o.isGlobe || o.globeFallbackActive) && Jn(o);
|
|
3306
3307
|
}), t.on("move", () => {
|
|
3307
3308
|
if (!o.isGlobe) {
|
|
3308
|
-
let [e, n, r, i] = o.boundingBox, a =
|
|
3309
|
+
let [e, n, r, i] = o.boundingBox, a = Zn(t), s = T(yt([a, _t([[
|
|
3309
3310
|
[e, n],
|
|
3310
3311
|
[e, i],
|
|
3311
3312
|
[r, i],
|
|
3312
3313
|
[r, n],
|
|
3313
3314
|
[e, n]
|
|
3314
3315
|
]])])), c = C(a), l = (s ? C(s) : 0) < c * .75;
|
|
3315
|
-
o.globeFallbackActive !== l && (o.globeFallbackActive = l, o.moveEndPosition = t.getCenter(),
|
|
3316
|
+
o.globeFallbackActive !== l && (o.globeFallbackActive = l, o.moveEndPosition = t.getCenter(), Jn(o));
|
|
3316
3317
|
}
|
|
3317
|
-
|
|
3318
|
+
Xn(o);
|
|
3318
3319
|
}), {
|
|
3319
3320
|
element: i,
|
|
3320
3321
|
ready: c
|
|
3321
3322
|
};
|
|
3322
3323
|
}
|
|
3323
|
-
function
|
|
3324
|
-
let { id: t, map: n, container: r, scale: i, backgroundColor: a, globeBackgroundColor: o, secondaryFillColor: s, secondaryStrokeColor: c, primaryFillColor: l, primaryStrokeColor: u, graticuleColor: d, borderColor: f, frameColor: p, frameOutlineColor: m, dotColor: h, dotOutlineColor: g } = e, _ =
|
|
3324
|
+
function Jn(e) {
|
|
3325
|
+
let { id: t, map: n, container: r, scale: i, backgroundColor: a, globeBackgroundColor: o, secondaryFillColor: s, secondaryStrokeColor: c, primaryFillColor: l, primaryStrokeColor: u, graticuleColor: d, borderColor: f, frameColor: p, frameOutlineColor: m, dotColor: h, dotOutlineColor: g } = e, _ = Kn * i, v = n.getScale();
|
|
3325
3326
|
r.style.width = `${_ * v}px`, r.style.height = `${_ * v}px`;
|
|
3326
3327
|
let y = e.globeFallbackActive && e.globeGeoJson !== void 0, b = y ? e.globeGeoJson : e.geoJson, x = y || e.isGlobe;
|
|
3327
3328
|
if (b === void 0) return;
|
|
3328
|
-
let S = _ / 2, C = .1 * i, w = [x ? `<circle cx="${S}" cy="${S}" r="${S}" ${J(o)}></circle>` : `<rect x="0" y="0" width="${_}" height="${_}" ${J(a)}></rect>`], { path: T } =
|
|
3329
|
+
let S = _ / 2, C = .1 * i, w = [x ? `<circle cx="${S}" cy="${S}" r="${S}" ${J(o)}></circle>` : `<rect x="0" y="0" width="${_}" height="${_}" ${J(a)}></rect>`], { path: T } = Yn(e), D = T({
|
|
3329
3330
|
...b,
|
|
3330
3331
|
features: b.features.filter((e) => e.properties?.class !== "P1")
|
|
3331
3332
|
});
|
|
@@ -3402,10 +3403,10 @@ function Gn(e) {
|
|
|
3402
3403
|
>
|
|
3403
3404
|
${w.join("")}
|
|
3404
3405
|
</svg>
|
|
3405
|
-
`,
|
|
3406
|
+
`, Xn(e);
|
|
3406
3407
|
}
|
|
3407
|
-
function
|
|
3408
|
-
let { scale: t, boundingBox: n, moveEndPosition: r } = e, i = e.globeFallbackActive && e.globeGeoJson !== void 0 || e.isGlobe, a =
|
|
3408
|
+
function Yn(e) {
|
|
3409
|
+
let { scale: t, boundingBox: n, moveEndPosition: r } = e, i = e.globeFallbackActive && e.globeGeoJson !== void 0 || e.isGlobe, a = Kn * t, o = k(), s;
|
|
3409
3410
|
if (i) {
|
|
3410
3411
|
let { lng: e, lat: t } = r;
|
|
3411
3412
|
s = O().scale(a / 2).translate([a / 2, a / 2]).rotate([-e, -t]).clipAngle(90);
|
|
@@ -3419,11 +3420,11 @@ function Kn(e) {
|
|
|
3419
3420
|
projection: s
|
|
3420
3421
|
};
|
|
3421
3422
|
}
|
|
3422
|
-
function
|
|
3423
|
+
function Xn(e) {
|
|
3423
3424
|
let { id: t, map: n, container: r, scale: i } = e, a = r.querySelector(`#frame-${t}`), o = r.querySelector(`#frame-outline-${t}`), s = r.querySelector(`#dot-${t}`);
|
|
3424
3425
|
if (!a || !o || !s) return;
|
|
3425
|
-
let c =
|
|
3426
|
-
|
|
3426
|
+
let c = Zn(n), { path: l, projection: u } = Yn(e), d = Infinity, f = -Infinity, p = Infinity, m = -Infinity, h = Infinity, g = -Infinity;
|
|
3427
|
+
Gn(c, (e) => {
|
|
3427
3428
|
let t = u(e);
|
|
3428
3429
|
d = Math.min(d, e[0]), f = Math.max(f, e[0]), p = Math.min(p, t[0]), m = Math.max(m, t[0]), h = Math.min(h, t[1]), g = Math.max(g, t[1]);
|
|
3429
3430
|
});
|
|
@@ -3438,7 +3439,7 @@ function qn(e) {
|
|
|
3438
3439
|
a.setAttribute("d", e), o.setAttribute("d", e);
|
|
3439
3440
|
} else a.style.display = "none", o.style.display = "none", s.style.display = "none";
|
|
3440
3441
|
}
|
|
3441
|
-
function
|
|
3442
|
+
function Zn(e) {
|
|
3442
3443
|
let { clientWidth: t, clientHeight: n } = e.getCanvas(), r = [];
|
|
3443
3444
|
for (let n = 0; n < 64; n++) {
|
|
3444
3445
|
let { lng: i, lat: a } = e.unprojectWithScaleCorrection([H(0, t, n / 64), 0]);
|
|
@@ -3468,14 +3469,14 @@ function Jn(e) {
|
|
|
3468
3469
|
}
|
|
3469
3470
|
//#endregion
|
|
3470
3471
|
//#region src/utils/scalebar.ts
|
|
3471
|
-
var
|
|
3472
|
+
var Qn = [
|
|
3472
3473
|
10,
|
|
3473
3474
|
5,
|
|
3474
3475
|
3,
|
|
3475
3476
|
2,
|
|
3476
3477
|
1
|
|
3477
3478
|
];
|
|
3478
|
-
function
|
|
3479
|
+
function $n(e, t = 1e-6) {
|
|
3479
3480
|
let n = Math.floor(e);
|
|
3480
3481
|
if (e -= n, e < t) return [n, 1];
|
|
3481
3482
|
if (1 - t < e) return [n + 1, 1];
|
|
@@ -3487,25 +3488,25 @@ function Xn(e, t = 1e-6) {
|
|
|
3487
3488
|
else return [n * c + s, c];
|
|
3488
3489
|
}
|
|
3489
3490
|
}
|
|
3490
|
-
function
|
|
3491
|
+
function er(e) {
|
|
3491
3492
|
let t = 10 ** Math.floor(Math.log10(e)), n = e / t;
|
|
3492
|
-
for (let e of
|
|
3493
|
-
return
|
|
3493
|
+
for (let e of Qn) if (n >= e) return e * t;
|
|
3494
|
+
return tr(n) * t;
|
|
3494
3495
|
}
|
|
3495
|
-
function
|
|
3496
|
+
function tr(e) {
|
|
3496
3497
|
let t = 10 ** Math.ceil(-Math.log(e) / Math.LN10);
|
|
3497
3498
|
return Math.round(e * t) / t;
|
|
3498
3499
|
}
|
|
3499
3500
|
//#endregion
|
|
3500
3501
|
//#region src/adornments/scalebar.ts
|
|
3501
|
-
var
|
|
3502
|
+
var nr = {
|
|
3502
3503
|
kilometer: "km",
|
|
3503
3504
|
meter: "m",
|
|
3504
3505
|
mile: "mi",
|
|
3505
3506
|
foot: "ft",
|
|
3506
3507
|
nauticalMile: "nm"
|
|
3507
3508
|
};
|
|
3508
|
-
function
|
|
3509
|
+
function rr(e, t, n, r) {
|
|
3509
3510
|
let i = document.createElement("div");
|
|
3510
3511
|
i.className = "adornment";
|
|
3511
3512
|
let a = "Arial, sans-serif";
|
|
@@ -3513,19 +3514,19 @@ function er(e, t, n, r) {
|
|
|
3513
3514
|
element: i,
|
|
3514
3515
|
ready: n.loadReference(e.font ?? a, "700").then(() => {
|
|
3515
3516
|
let o = () => {
|
|
3516
|
-
i.innerHTML =
|
|
3517
|
+
i.innerHTML = ir(t, e, t.getScale(), a, n);
|
|
3517
3518
|
};
|
|
3518
3519
|
o(), t.on("move", o), r !== "interactive" && t.on("resize", o);
|
|
3519
3520
|
})
|
|
3520
3521
|
};
|
|
3521
3522
|
}
|
|
3522
|
-
function
|
|
3523
|
-
let { maxWidth: a = 100, fontSize: o = 8, color: s = "#000000", unit: c = "metric_and_imperial" } = t, l = i.resolve(t.font ?? r, "700"), u = e.getCenter(), d = e.project(u), f = B(u, e.unproject([d.x + a, d.y])), p = Object.fromEntries(Object.entries(
|
|
3524
|
-
let n = oe("meter", e, f), r =
|
|
3523
|
+
function ir(e, t, n, r, i) {
|
|
3524
|
+
let { maxWidth: a = 100, fontSize: o = 8, color: s = "#000000", unit: c = "metric_and_imperial" } = t, l = i.resolve(t.font ?? r, "700"), u = e.getCenter(), d = e.project(u), f = B(u, e.unproject([d.x + a, d.y])), p = Object.fromEntries(Object.entries(nr).map(([e, t]) => {
|
|
3525
|
+
let n = oe("meter", e, f), r = er(n) || 0;
|
|
3525
3526
|
return [e, {
|
|
3526
3527
|
value: n,
|
|
3527
3528
|
ratio: n ? r / n : 0,
|
|
3528
|
-
humanized: r < 1 ? `${
|
|
3529
|
+
humanized: r < 1 ? `${$n(r).join("/")} ${t}` : `${r} ${t}`
|
|
3529
3530
|
}];
|
|
3530
3531
|
})), m = p.meter.value > 1e3 ? p.kilometer : p.meter, h = p.foot.value > 5280 ? p.mile : p.foot, g = {
|
|
3531
3532
|
imperial: h,
|
|
@@ -3665,7 +3666,7 @@ function tr(e, t, n, r, i) {
|
|
|
3665
3666
|
}
|
|
3666
3667
|
//#endregion
|
|
3667
3668
|
//#region src/adornments/heading.ts
|
|
3668
|
-
function
|
|
3669
|
+
function ar(e, t, n, r) {
|
|
3669
3670
|
let i = document.createElement("div");
|
|
3670
3671
|
i.className = "adornment";
|
|
3671
3672
|
let a = "ArialMT", o = Array.from(new Set([e.titleFont ?? a, e.subtitleFont ?? a]));
|
|
@@ -3673,13 +3674,13 @@ function nr(e, t, n, r) {
|
|
|
3673
3674
|
element: i,
|
|
3674
3675
|
ready: Promise.all(o.map((e) => n.loadReference(e))).then(() => {
|
|
3675
3676
|
let o = () => {
|
|
3676
|
-
i.innerHTML =
|
|
3677
|
+
i.innerHTML = or(e, a, t.getScale(), n);
|
|
3677
3678
|
};
|
|
3678
3679
|
o(), r !== "interactive" && t.on("resize", o);
|
|
3679
3680
|
})
|
|
3680
3681
|
};
|
|
3681
3682
|
}
|
|
3682
|
-
function
|
|
3683
|
+
function or(e, t, n, r) {
|
|
3683
3684
|
let { title: i, titleColor: a = "#000000", titleFontSize: o = 20, titleJustify: s = "center", subtitle: c, subtitleColor: l = "#000000", subtitleFontSize: u = 12, subtitleJustify: d = "center", background: f = "#ffffff", showBackground: p = !1 } = e, m = r.resolve(e.titleFont ?? t), h = r.resolve(e.subtitleFont ?? t), g = 0, _ = 0, v = 0, y = 0, b = 0, x = i.trim().length > 0 ? it([i], m, o) : null, S = c.trim().length > 0 ? it([c], h, u) : null;
|
|
3684
3685
|
if (g = Math.max(x?.width ?? 0, S?.width ?? 0), x) {
|
|
3685
3686
|
let { ascent: e, descent: t } = x;
|
|
@@ -3698,7 +3699,7 @@ function rr(e, t, n, r) {
|
|
|
3698
3699
|
}
|
|
3699
3700
|
//#endregion
|
|
3700
3701
|
//#region src/constants/index.ts
|
|
3701
|
-
var
|
|
3702
|
+
var sr = {
|
|
3702
3703
|
"sky-color": "#6babff",
|
|
3703
3704
|
"sky-horizon-blend": 1,
|
|
3704
3705
|
"horizon-color": [
|
|
@@ -3716,7 +3717,7 @@ var ir = {
|
|
|
3716
3717
|
"fog-color": "#edf7fc",
|
|
3717
3718
|
"fog-ground-blend": .5,
|
|
3718
3719
|
"atmosphere-blend": 1
|
|
3719
|
-
},
|
|
3720
|
+
}, cr = {
|
|
3720
3721
|
top_left: {
|
|
3721
3722
|
x: 5,
|
|
3722
3723
|
y: 5,
|
|
@@ -3757,7 +3758,7 @@ var ir = {
|
|
|
3757
3758
|
y: 0,
|
|
3758
3759
|
unit: "px"
|
|
3759
3760
|
}
|
|
3760
|
-
},
|
|
3761
|
+
}, lr = {
|
|
3761
3762
|
top_left: {
|
|
3762
3763
|
x: "left",
|
|
3763
3764
|
y: "top"
|
|
@@ -3790,7 +3791,7 @@ var ir = {
|
|
|
3790
3791
|
x: "left",
|
|
3791
3792
|
y: "center"
|
|
3792
3793
|
}
|
|
3793
|
-
},
|
|
3794
|
+
}, ur = {
|
|
3794
3795
|
fill: {
|
|
3795
3796
|
props: ["fill-opacity"],
|
|
3796
3797
|
defaultValue: 1
|
|
@@ -3835,17 +3836,17 @@ var ir = {
|
|
|
3835
3836
|
props: [],
|
|
3836
3837
|
defaultValue: 1
|
|
3837
3838
|
}
|
|
3838
|
-
},
|
|
3839
|
+
}, dr = [
|
|
3839
3840
|
"beforeWaters",
|
|
3840
3841
|
"beforeBoundaries",
|
|
3841
3842
|
"beforeNames",
|
|
3842
3843
|
"beforeNone"
|
|
3843
|
-
],
|
|
3844
|
+
], fr = {
|
|
3844
3845
|
beforeWaters: "mc-before-waters",
|
|
3845
3846
|
beforeBoundaries: "mc-before-boundaries",
|
|
3846
3847
|
beforeNames: "mc-before-names",
|
|
3847
3848
|
beforeNone: "mc-before-none"
|
|
3848
|
-
},
|
|
3849
|
+
}, pr = {
|
|
3849
3850
|
jpg: "static",
|
|
3850
3851
|
png: "static",
|
|
3851
3852
|
svg: "static",
|
|
@@ -3863,7 +3864,7 @@ var ir = {
|
|
|
3863
3864
|
web_video: "video",
|
|
3864
3865
|
web: "interactive",
|
|
3865
3866
|
web_download: "interactive"
|
|
3866
|
-
},
|
|
3867
|
+
}, mr = [
|
|
3867
3868
|
"top_left",
|
|
3868
3869
|
"top_right",
|
|
3869
3870
|
"bottom_left",
|
|
@@ -3872,12 +3873,12 @@ var ir = {
|
|
|
3872
3873
|
"left_center",
|
|
3873
3874
|
"right_center",
|
|
3874
3875
|
"bottom_center"
|
|
3875
|
-
],
|
|
3876
|
-
async function
|
|
3876
|
+
], hr = /* @__PURE__ */ new Map(), gr = (e) => hr.delete(e);
|
|
3877
|
+
async function _r(e, t, n, r, i, a, o) {
|
|
3877
3878
|
let s = [...e.adornments ?? []], { fonts: c } = r;
|
|
3878
|
-
|
|
3879
|
+
vr(n), yr(n, t, o);
|
|
3879
3880
|
let l = [], u = s.some((e) => !["copyright", "webControls"].includes(e.type));
|
|
3880
|
-
|
|
3881
|
+
Ln() && u && !s.some((e) => e.type === "webControls") && s.unshift({
|
|
3881
3882
|
type: "webControls",
|
|
3882
3883
|
id: "web_controls",
|
|
3883
3884
|
name: "Web controls",
|
|
@@ -3887,15 +3888,15 @@ async function mr(e, t, n, r, i, a, o) {
|
|
|
3887
3888
|
}), s.forEach((t) => {
|
|
3888
3889
|
if (t.type === "custom") Q(n, Ce(t, n, o), t.position, t.stacking);
|
|
3889
3890
|
else if (t.type === "northArrow") Q(n, Qt(t, n, o), t.position, t.stacking);
|
|
3890
|
-
else if (t.type === "webControls" && t.buttons && o === "interactive") Q(n,
|
|
3891
|
+
else if (t.type === "webControls" && t.buttons && o === "interactive") Q(n, Rn(t, n, r, i, u), t.position, t.stacking);
|
|
3891
3892
|
else if (t.type === "scalebar") {
|
|
3892
|
-
let { element: e, ready: r } =
|
|
3893
|
+
let { element: e, ready: r } = rr(t, n, c, o);
|
|
3893
3894
|
Q(n, e, t.position, t.stacking), l.push(r);
|
|
3894
3895
|
} else if (t.type === "insetMap") {
|
|
3895
|
-
let { element: e, ready: r } =
|
|
3896
|
+
let { element: e, ready: r } = qn(t, n, a, o);
|
|
3896
3897
|
Q(n, e, t.position, t.stacking), l.push(r);
|
|
3897
3898
|
} else if (t.type === "heading") {
|
|
3898
|
-
let { element: e, ready: r } =
|
|
3899
|
+
let { element: e, ready: r } = ar(t, n, c, o);
|
|
3899
3900
|
Q(n, e, t.position, t.stacking), l.push(r);
|
|
3900
3901
|
} else if (t.type === "manualLegend") {
|
|
3901
3902
|
let { element: e, ready: r } = Zt(t, n, c, o);
|
|
@@ -3904,15 +3905,15 @@ async function mr(e, t, n, r, i, a, o) {
|
|
|
3904
3905
|
let { element: r, ready: i } = Ut(t, e, n, c, o);
|
|
3905
3906
|
Q(n, r, t.position, t.stacking), l.push(i);
|
|
3906
3907
|
} else if (t.type === "copyright" && o !== "interactive") {
|
|
3907
|
-
let { element: e, ready: r } =
|
|
3908
|
+
let { element: e, ready: r } = Vn(t, n, c);
|
|
3908
3909
|
Q(n, e, t.position, t.stacking), l.push(r);
|
|
3909
3910
|
}
|
|
3910
|
-
}), n.on("resize", () =>
|
|
3911
|
+
}), n.on("resize", () => yr(n, t, o)), await Promise.all(l);
|
|
3911
3912
|
}
|
|
3912
|
-
function
|
|
3913
|
+
function vr(e) {
|
|
3913
3914
|
let t = /* @__PURE__ */ new Map(), n = e.getContainer(), r = window.getComputedStyle(n);
|
|
3914
3915
|
n.style.setProperty("--adornment-text-direction", r.direction), n.style.setProperty("--adornment-text-writing-mode", r.writingMode);
|
|
3915
|
-
for (let e of
|
|
3916
|
+
for (let e of mr) {
|
|
3916
3917
|
let r = document.createElement("div"), i = document.createElement("div"), a = document.createElement("div");
|
|
3917
3918
|
r.classList.add("adornment-container", e), i.classList.add("inner"), a.classList.add("inner", "vertical"), r.append(i, a), n.appendChild(r), t.set(e, {
|
|
3918
3919
|
container: r,
|
|
@@ -3920,29 +3921,29 @@ function hr(e) {
|
|
|
3920
3921
|
vertical: a
|
|
3921
3922
|
});
|
|
3922
3923
|
}
|
|
3923
|
-
|
|
3924
|
+
hr.set(e, t);
|
|
3924
3925
|
}
|
|
3925
|
-
function
|
|
3926
|
-
let r =
|
|
3926
|
+
function yr(e, t, n) {
|
|
3927
|
+
let r = hr.get(e), i = e.getScale();
|
|
3927
3928
|
if (r) {
|
|
3928
3929
|
e.getContainer().style.setProperty("--adornment-spacing", `${5 * i}px`);
|
|
3929
|
-
for (let [e, { container: a }] of r) a.style.cssText =
|
|
3930
|
+
for (let [e, { container: a }] of r) a.style.cssText = br(e, t[e], i, n);
|
|
3930
3931
|
}
|
|
3931
3932
|
}
|
|
3932
|
-
function
|
|
3933
|
-
let i =
|
|
3933
|
+
function br(e, t, n, r) {
|
|
3934
|
+
let i = lr[e], a = "", o = [], { x: s, y: c, unit: l } = t;
|
|
3934
3935
|
return l === "px" && (s *= n, c *= n), i.x === "center" ? o.push(`translateX(${s}${l})`) : a += `${i.x}: ${s}${l};`, i.y === "center" ? o.push(`translateY(${c}${l})`) : e === "bottom_right" && r === "interactive" ? a += `${i.y}: max(${c}${l}, 25px);` : a += `${i.y}: ${c}${l};`, o.length && (a += `transform: ${o.join(" ")};`), a;
|
|
3935
3936
|
}
|
|
3936
3937
|
function Q(e, t, n, r) {
|
|
3937
|
-
|
|
3938
|
-
let i =
|
|
3938
|
+
Ln() && !t.classList.contains("web-control") && t.classList.add("hide"), r ||= ["left_center", "right_center"].includes(n) ? "vertical" : "horizontal";
|
|
3939
|
+
let i = hr.get(e)?.get(n), a = n === "left_center" || n === "right_center" ? "vertical" : "horizontal";
|
|
3939
3940
|
i?.[a].hasChildNodes() || (r = a), (i?.[r])?.appendChild(t);
|
|
3940
3941
|
}
|
|
3941
3942
|
//#endregion
|
|
3942
3943
|
//#region src/utils/mapstyle.ts
|
|
3943
|
-
function
|
|
3944
|
-
for (let t of
|
|
3945
|
-
let n =
|
|
3944
|
+
function xr(e) {
|
|
3945
|
+
for (let t of dr) {
|
|
3946
|
+
let n = fr[t];
|
|
3946
3947
|
e.layers.find((e) => e.id === n) === void 0 && (e.sources.empty === void 0 && (e.sources.empty = {
|
|
3947
3948
|
type: "geojson",
|
|
3948
3949
|
data: {
|
|
@@ -3959,12 +3960,12 @@ function vr(e) {
|
|
|
3959
3960
|
}
|
|
3960
3961
|
//#endregion
|
|
3961
3962
|
//#region src/models/polygon.ts
|
|
3962
|
-
function
|
|
3963
|
+
function Sr(e, t, n, r, i) {
|
|
3963
3964
|
e.addSource(t.id, {
|
|
3964
3965
|
type: "geojson",
|
|
3965
3966
|
data: {
|
|
3966
3967
|
type: "FeatureCollection",
|
|
3967
|
-
features: t.models.filter((e) => e.visible ?? !0).map((e) =>
|
|
3968
|
+
features: t.models.filter((e) => e.visible ?? !0).map((e) => Cr(t, e, r, i))
|
|
3968
3969
|
}
|
|
3969
3970
|
}), e.addLayer({
|
|
3970
3971
|
id: t.id,
|
|
@@ -4022,7 +4023,7 @@ function yr(e, t, n, r, i) {
|
|
|
4022
4023
|
}
|
|
4023
4024
|
}, n);
|
|
4024
4025
|
}
|
|
4025
|
-
function
|
|
4026
|
+
function Cr(e, t, n, r) {
|
|
4026
4027
|
let i = t.fillPattern === void 0 ? void 0 : r.getMapLibreImageKey(n[t.fillPattern], 2 * window.devicePixelRatio);
|
|
4027
4028
|
return {
|
|
4028
4029
|
type: "Feature",
|
|
@@ -4042,12 +4043,12 @@ function br(e, t, n, r) {
|
|
|
4042
4043
|
}
|
|
4043
4044
|
//#endregion
|
|
4044
4045
|
//#region src/models/circle.ts
|
|
4045
|
-
function
|
|
4046
|
+
function wr(e, t, n, r, i) {
|
|
4046
4047
|
e.addSource(t.id, {
|
|
4047
4048
|
type: "geojson",
|
|
4048
4049
|
data: {
|
|
4049
4050
|
type: "FeatureCollection",
|
|
4050
|
-
features: t.models.filter((e) => e.visible ?? !0).map((e) =>
|
|
4051
|
+
features: t.models.filter((e) => e.visible ?? !0).map((e) => Tr(t, e, 1, r, i))
|
|
4051
4052
|
}
|
|
4052
4053
|
}), e.addLayer({
|
|
4053
4054
|
id: t.id,
|
|
@@ -4141,7 +4142,7 @@ function xr(e, t, n, r, i) {
|
|
|
4141
4142
|
}
|
|
4142
4143
|
}, n);
|
|
4143
4144
|
}
|
|
4144
|
-
function
|
|
4145
|
+
function Tr(e, t, n, r, i) {
|
|
4145
4146
|
let a = t.fillPattern === void 0 ? void 0 : i.getMapLibreImageKey(r[t.fillPattern], 2 * window.devicePixelRatio);
|
|
4146
4147
|
return {
|
|
4147
4148
|
type: "Feature",
|
|
@@ -4170,13 +4171,13 @@ function Sr(e, t, n, r, i) {
|
|
|
4170
4171
|
}
|
|
4171
4172
|
//#endregion
|
|
4172
4173
|
//#region src/models/marker.ts
|
|
4173
|
-
var
|
|
4174
|
-
function
|
|
4174
|
+
var Er = "Roboto-Regular";
|
|
4175
|
+
function Dr(e, t, n, r, i, a) {
|
|
4175
4176
|
let o = [], s = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set(), l = ["match", ["get", "text-font"]], u = !!t.clustering;
|
|
4176
|
-
for (let n of t.models) (n.visible ?? !0) && o.push(
|
|
4177
|
+
for (let n of t.models) (n.visible ?? !0) && o.push(kr(e, t, n, 1, r, i)), s.add(n.textFont), c.add(n.textLineHeight ?? 1.2);
|
|
4177
4178
|
if (Array.from(s).length > 0) {
|
|
4178
|
-
for (let e of Array.from(s)) l.push(e, ["literal", [e,
|
|
4179
|
-
l.push(["literal", [
|
|
4179
|
+
for (let e of Array.from(s)) l.push(e, ["literal", [e, Er]]);
|
|
4180
|
+
l.push(["literal", [Er]]);
|
|
4180
4181
|
}
|
|
4181
4182
|
e.addSource(t.id, {
|
|
4182
4183
|
type: "geojson",
|
|
@@ -4273,7 +4274,7 @@ function wr(e, t, n, r, i, a) {
|
|
|
4273
4274
|
stops: t.clusterTextColor ?? []
|
|
4274
4275
|
} },
|
|
4275
4276
|
layout: {
|
|
4276
|
-
"text-font": ["literal", [
|
|
4277
|
+
"text-font": ["literal", [Er]],
|
|
4277
4278
|
"text-field": "{point_count_abbreviated}",
|
|
4278
4279
|
"text-size": {
|
|
4279
4280
|
property: "point_count",
|
|
@@ -4344,9 +4345,9 @@ function wr(e, t, n, r, i, a) {
|
|
|
4344
4345
|
["!", ["has", "point_count"]]
|
|
4345
4346
|
]
|
|
4346
4347
|
});
|
|
4347
|
-
}),
|
|
4348
|
+
}), Or(e, t)));
|
|
4348
4349
|
}
|
|
4349
|
-
function
|
|
4350
|
+
function Or(e, t) {
|
|
4350
4351
|
e.on("click", `${t.id}-circle-cluster`, async (t) => {
|
|
4351
4352
|
let n = e.queryRenderedFeatures(t.point).find((e) => e.properties.cluster);
|
|
4352
4353
|
if (!n) return;
|
|
@@ -4359,7 +4360,7 @@ function Tr(e, t) {
|
|
|
4359
4360
|
});
|
|
4360
4361
|
});
|
|
4361
4362
|
}
|
|
4362
|
-
function
|
|
4363
|
+
function kr(e, t, n, r, i, a) {
|
|
4363
4364
|
let o = n.svg === void 0 ? void 0 : ot(n.dataBindings ?? {}, i[n.svg], t.svg ? i[t.svg] : void 0), s = o === void 0 ? void 0 : a.getMapLibreImageKey(o, window.devicePixelRatio * (n.iconScale ?? 1) * e.getScale()), c = o === void 0 ? void 0 : Qe(o);
|
|
4364
4365
|
return {
|
|
4365
4366
|
type: "Feature",
|
|
@@ -4400,25 +4401,25 @@ function Er(e, t, n, r, i, a) {
|
|
|
4400
4401
|
}
|
|
4401
4402
|
//#endregion
|
|
4402
4403
|
//#region src/utils/overlays.ts
|
|
4403
|
-
async function
|
|
4404
|
+
async function Ar(e, t, n, r, i, a) {
|
|
4404
4405
|
let o = await Promise.all(t.map((e) => `${r}/styles/${e}.json?access_token=${i}`).map((e) => fetch(e).then((e) => e.json()))), s = fe(o.map((e) => e.sprite).filter((e) => typeof e == "string"));
|
|
4405
4406
|
await Promise.all(s.map((e) => n.loadSprite(e).then((e) => n.addImages(e)).catch(() => {})));
|
|
4406
4407
|
for (let t = 0; t < e.length; t++) {
|
|
4407
4408
|
let r = e[t], i = o[t];
|
|
4408
4409
|
for (let e of i.layers) e.metadata === void 0 && (e.metadata = {}), e.metadata["mc-original-layer-id"] = e.id, e.id = `${r} | ${e.id}`;
|
|
4409
|
-
|
|
4410
|
+
jr(i, n, a);
|
|
4410
4411
|
}
|
|
4411
4412
|
return o;
|
|
4412
4413
|
}
|
|
4413
|
-
function
|
|
4414
|
+
function jr(e, t, n) {
|
|
4414
4415
|
for (let n in e.sources) t.getSource(n) === void 0 && t.addSource(n, e.sources[n]);
|
|
4415
4416
|
for (let r of e.layers) {
|
|
4416
4417
|
t.getLayer(r.id) !== void 0 && t.removeLayer(r.id);
|
|
4417
4418
|
let e = r.metadata?.["mc-add-before"] ?? "mc-before-none";
|
|
4418
|
-
t.addLayer(
|
|
4419
|
+
t.addLayer(Mr(r, n), e);
|
|
4419
4420
|
}
|
|
4420
4421
|
}
|
|
4421
|
-
function
|
|
4422
|
+
function Mr(e, t) {
|
|
4422
4423
|
let n = t ?? {}, r = e.metadata?.["mc-original-layer-id"], i = r === void 0 ? {} : n[r] ?? {}, a = {
|
|
4423
4424
|
...e,
|
|
4424
4425
|
layout: {
|
|
@@ -4438,23 +4439,23 @@ function kr(e, t) {
|
|
|
4438
4439
|
}
|
|
4439
4440
|
//#endregion
|
|
4440
4441
|
//#region src/images/popup-previous.svg?raw
|
|
4441
|
-
var
|
|
4442
|
+
var Nr = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"6\" height=\"10\" viewBox=\"0 0 6 10\" fill=\"currentColor\"><path d=\"m0 4.647 4.282 4.4a.814.814 0 0 0 1.166-1.134L2.27 4.647l3.178-3.266A.814.814 0 1 0 4.282.246z\"/></svg>\n", Pr = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"10\" height=\"11\" viewBox=\"0 0 10 11\" fill=\"currentColor\"><path d=\"M.21.71a.714.714 0 0 1 1.011 0l3.78 3.78L8.778.71a.715.715 0 0 1 1.013 1.01L6.01 5.501l3.78 3.778a.715.715 0 0 1-1.01 1.012L5 6.51l-3.779 3.78A.716.716 0 0 1 .21 9.28L3.99 5.5.21 1.721A.714.714 0 0 1 .21.71\"/></svg>\n", Fr = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"6\" height=\"10\" viewBox=\"0 0 6 10\" fill=\"currentColor\"><path d=\"m5.678 4.647-4.282 4.4A.814.814 0 1 1 .23 7.914l3.177-3.266L.23 1.381A.814.814 0 1 1 1.396.246z\"/></svg>\n", Ir = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 40 40\" stroke=\"currentColor\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M20 4.167 1.667 35.834h36.667z\" stroke-width=\"2\" stroke-linejoin=\"round\"/><path d=\"M20 29.167v.834m0-14.167.007 8.333\" stroke-width=\"2\" stroke-linecap=\"round\"/></svg>\n";
|
|
4442
4443
|
//#endregion
|
|
4443
4444
|
//#region src/utils/youtube.ts
|
|
4444
|
-
function
|
|
4445
|
+
function Lr(e, t) {
|
|
4445
4446
|
let { allowFullscreen: n, loop: r } = e, i = te(e.src, t), a, o = i.match(/(?:youtube\.com\/(?:watch\?.*v=|embed\/|v\/)|youtu\.be\/)([-\w]{11})/)?.[1];
|
|
4446
4447
|
a = o ? `https://www.youtube.com/embed/${o}` : i;
|
|
4447
4448
|
let s = [];
|
|
4448
|
-
if (n || s.push("fs=0"), r && o && s.push(`loop=1&playlist=${o}`), a =
|
|
4449
|
+
if (n || s.push("fs=0"), r && o && s.push(`loop=1&playlist=${o}`), a = zr(a), a = Rr(a), s.length) {
|
|
4449
4450
|
let e = a.includes("?") ? "&" : "?";
|
|
4450
4451
|
a += `${e}${s.join("&")}`;
|
|
4451
4452
|
}
|
|
4452
4453
|
return a;
|
|
4453
4454
|
}
|
|
4454
|
-
function
|
|
4455
|
+
function Rr(e) {
|
|
4455
4456
|
return e.replace(/([?&])si=[^&]+(&)?/, (e, t, n) => t === "?" && !n ? "" : t === "?" && n ? "?" : n ? "&" : "");
|
|
4456
4457
|
}
|
|
4457
|
-
function
|
|
4458
|
+
function zr(e) {
|
|
4458
4459
|
let t = new URL(e), n = t.searchParams.get("t");
|
|
4459
4460
|
if (!n) return e;
|
|
4460
4461
|
let r = 0, i = /^((\d+)m)?((\d+)s)?$/;
|
|
@@ -4470,12 +4471,12 @@ function Ir(e) {
|
|
|
4470
4471
|
}
|
|
4471
4472
|
//#endregion
|
|
4472
4473
|
//#region src/utils/template.ts
|
|
4473
|
-
function
|
|
4474
|
+
function Br(e, t, n, r) {
|
|
4474
4475
|
let i;
|
|
4475
|
-
if (t?.type === "video") i = r ?
|
|
4476
|
+
if (t?.type === "video") i = r ? Gr(t.src, n) : `
|
|
4476
4477
|
<div class="youtube-container">
|
|
4477
4478
|
<iframe
|
|
4478
|
-
src="${
|
|
4479
|
+
src="${Lr(t, n)}"
|
|
4479
4480
|
width="100%" height="300" style="border: none" allowfullscreen>
|
|
4480
4481
|
</iframe>
|
|
4481
4482
|
</div>
|
|
@@ -4489,7 +4490,7 @@ function Lr(e, t, n, r) {
|
|
|
4489
4490
|
`;
|
|
4490
4491
|
}
|
|
4491
4492
|
i = i ? `<div class="media-content">${i}</div>` : "";
|
|
4492
|
-
let a = e ? `<div class="text-content">${
|
|
4493
|
+
let a = e ? `<div class="text-content">${Ur(e, n)}</div>` : "";
|
|
4493
4494
|
return `
|
|
4494
4495
|
<div class="popup-scroll-wrapper">
|
|
4495
4496
|
<div class="mc-popup">
|
|
@@ -4499,53 +4500,53 @@ function Lr(e, t, n, r) {
|
|
|
4499
4500
|
</div>
|
|
4500
4501
|
`;
|
|
4501
4502
|
}
|
|
4502
|
-
var
|
|
4503
|
+
var Vr = `
|
|
4503
4504
|
<button class="mc-popup-button close">
|
|
4504
|
-
${
|
|
4505
|
+
${Pr}
|
|
4505
4506
|
</button>
|
|
4506
|
-
`,
|
|
4507
|
+
`, Hr = `
|
|
4507
4508
|
<div class="cycle-buttons">
|
|
4508
4509
|
<button class="mc-popup-button prev">
|
|
4509
|
-
${
|
|
4510
|
+
${Nr}
|
|
4510
4511
|
</button>
|
|
4511
4512
|
<button class="mc-popup-button next">
|
|
4512
|
-
${
|
|
4513
|
+
${Fr}
|
|
4513
4514
|
</button>
|
|
4514
4515
|
</div>
|
|
4515
4516
|
`;
|
|
4516
|
-
function
|
|
4517
|
+
function Ur(e, t) {
|
|
4517
4518
|
return e ? (e = e.replace(/placeholder="[^"]+"/, ""), e = e.replace(/onerror="[^"]+"/, ""), e = e.replace(/youtube\.com\/embed\/\$([^"'<>\\]+)/gi, (e, n) => {
|
|
4518
4519
|
let r = ne(t[n]);
|
|
4519
4520
|
return r ? `youtube.com/embed/${ie(r)}?` : "";
|
|
4520
4521
|
}), e = e.replace(/(\S+?)\s*=\s*"\$([^"]+?)"/g, (e, n, r) => {
|
|
4521
4522
|
let i = ne(t[r]);
|
|
4522
|
-
return ["src", "href"].includes(n) && !i ? "" : ["src", "href"].includes(n) ? /^(mailto:|tel:|ftp:|data:|http:\/\/|https:\/\/)/i.test(i) ? ` ${n}="${i}"` : ` ${n}="${
|
|
4523
|
+
return ["src", "href"].includes(n) && !i ? "" : ["src", "href"].includes(n) ? /^(mailto:|tel:|ftp:|data:|http:\/\/|https:\/\/)/i.test(i) ? ` ${n}="${i}"` : ` ${n}="${Wr(i)}"` : ` ${n}="${i}"`;
|
|
4523
4524
|
}), e = e.replace(/>\$(.+?)</gi, (e, n) => `>${ne(t[n])}<`), e = e.replace(/<span\s+class="mention"\s+data-mention-id="[^"]*">(.*?)<\/span>/gim, (e, t) => t), e) : "";
|
|
4524
4525
|
}
|
|
4525
|
-
function
|
|
4526
|
+
function Wr(e) {
|
|
4526
4527
|
return /^https?:\/\//i.test(e) ? e : `https://${e}`;
|
|
4527
4528
|
}
|
|
4528
|
-
function
|
|
4529
|
+
function Gr(e, t) {
|
|
4529
4530
|
return `
|
|
4530
4531
|
<div class="youtube-placeholder">
|
|
4531
4532
|
<img src="${`https://img.youtube.com/vi/${ie(te(e, t))}/hqdefault.jpg`}" />
|
|
4532
4533
|
<div class="popup-alert">
|
|
4533
|
-
<div class="alert-icon">${
|
|
4534
|
-
<div>${
|
|
4534
|
+
<div class="alert-icon">${Ir}</div>
|
|
4535
|
+
<div>${Pn("videoAlert")}</div>
|
|
4535
4536
|
</div>
|
|
4536
4537
|
</div>
|
|
4537
4538
|
`;
|
|
4538
4539
|
}
|
|
4539
4540
|
//#endregion
|
|
4540
4541
|
//#region src/Registry.ts
|
|
4541
|
-
var
|
|
4542
|
+
var Kr = [
|
|
4542
4543
|
"area",
|
|
4543
4544
|
"circle",
|
|
4544
4545
|
"dot",
|
|
4545
4546
|
"line",
|
|
4546
4547
|
"marker",
|
|
4547
4548
|
"polygon"
|
|
4548
|
-
],
|
|
4549
|
+
], qr = class {
|
|
4549
4550
|
models;
|
|
4550
4551
|
groups;
|
|
4551
4552
|
customGroupIds;
|
|
@@ -4565,7 +4566,7 @@ var Ur = [
|
|
|
4565
4566
|
marker: {},
|
|
4566
4567
|
polygon: {}
|
|
4567
4568
|
};
|
|
4568
|
-
for (let t of
|
|
4569
|
+
for (let t of Kr) for (let n of e.registry?.models?.[t] ?? []) {
|
|
4569
4570
|
this.models[t][n.id] = {}, this.groups[t][n.id] = n;
|
|
4570
4571
|
for (let e of n.models) {
|
|
4571
4572
|
if (t === "area") {
|
|
@@ -4611,7 +4612,7 @@ var Ur = [
|
|
|
4611
4612
|
}
|
|
4612
4613
|
return e.reverse();
|
|
4613
4614
|
}
|
|
4614
|
-
},
|
|
4615
|
+
}, Jr = class {
|
|
4615
4616
|
map;
|
|
4616
4617
|
popupElements;
|
|
4617
4618
|
currentPopupElement;
|
|
@@ -4795,7 +4796,7 @@ var Ur = [
|
|
|
4795
4796
|
});
|
|
4796
4797
|
}
|
|
4797
4798
|
}
|
|
4798
|
-
},
|
|
4799
|
+
}, Yr = class {
|
|
4799
4800
|
map;
|
|
4800
4801
|
youTubePlaceholder;
|
|
4801
4802
|
language = "en";
|
|
@@ -4816,7 +4817,7 @@ var Ur = [
|
|
|
4816
4817
|
this.map = e, this.youTubePlaceholder = t, this.mapContainer = this.map.getContainer(), this.popupContainer = document.createElement("div"), this.popupContainer.classList.add("popup-container"), this.map.on("mousemove", (e) => this.onMouseMove(e)), this.map.on("click", (e) => this.onClick(e));
|
|
4817
4818
|
}
|
|
4818
4819
|
setJobObject(e) {
|
|
4819
|
-
this.registry = new
|
|
4820
|
+
this.registry = new qr(e);
|
|
4820
4821
|
}
|
|
4821
4822
|
setParams(e, t, n, r) {
|
|
4822
4823
|
this.popupPosition = e, this.language = t, this.restrictMapMovement = n, this.center = r;
|
|
@@ -4828,7 +4829,7 @@ var Ur = [
|
|
|
4828
4829
|
this.popupElements = this.registry.getPopupElements();
|
|
4829
4830
|
}
|
|
4830
4831
|
setHighlightManager() {
|
|
4831
|
-
this.highlightManager = new
|
|
4832
|
+
this.highlightManager = new Jr(this.map, this.popupElements);
|
|
4832
4833
|
}
|
|
4833
4834
|
onMouseMove(e) {
|
|
4834
4835
|
this.feature = this.getInteractiveFeature(e), this.feature ? this.map.getCanvas().style.cursor = "pointer" : this.map.getCanvas().style.cursor = "";
|
|
@@ -4874,7 +4875,7 @@ var Ur = [
|
|
|
4874
4875
|
}
|
|
4875
4876
|
getTemplate(e) {
|
|
4876
4877
|
let { layer: t } = e, n, r = this.registry.getModel(e);
|
|
4877
|
-
if (r?.popup || r?.popupMedia) n =
|
|
4878
|
+
if (r?.popup || r?.popupMedia) n = Br(r.popup, r.popupMedia, r.dataBindings ?? {}, this.youTubePlaceholder);
|
|
4878
4879
|
else {
|
|
4879
4880
|
let r = [];
|
|
4880
4881
|
this.publication && (r.push(`:${this.publication}-${this.language}`), r.push(`:${this.publication}-:en`)), r.push(`:${this.language}`), r.push(":en"), r.push("");
|
|
@@ -4898,11 +4899,11 @@ var Ur = [
|
|
|
4898
4899
|
return t.innerHTML = e.trim(), t.content.firstElementChild;
|
|
4899
4900
|
}
|
|
4900
4901
|
addPopupControls() {
|
|
4901
|
-
let e = this.htmlToElement(
|
|
4902
|
+
let e = this.htmlToElement(Vr);
|
|
4902
4903
|
if (e && (e.addEventListener("click", () => {
|
|
4903
4904
|
this.hidePopup(), this.highlightManager.highlight(void 0);
|
|
4904
4905
|
}), this.popupContainer.appendChild(e)), this.popupElements.length > 1) {
|
|
4905
|
-
let e = this.htmlToElement(
|
|
4906
|
+
let e = this.htmlToElement(Hr);
|
|
4906
4907
|
e && (e.querySelector(".prev")?.addEventListener("click", () => this.cyclePopups(!1)), e.querySelector(".next")?.addEventListener("click", () => this.cyclePopups()), this.popupContainer.appendChild(e));
|
|
4907
4908
|
}
|
|
4908
4909
|
}
|
|
@@ -4939,17 +4940,17 @@ var Ur = [
|
|
|
4939
4940
|
n = e ? t === this.popupElements.length - 1 ? 0 : t + 1 : t === 0 ? this.popupElements.length - 1 : t - 1;
|
|
4940
4941
|
let r = this.popupElements?.[n];
|
|
4941
4942
|
this.currentModelId = r.modelId, this.highlightManager.highlight(r, !0);
|
|
4942
|
-
let i =
|
|
4943
|
+
let i = Br(r.popup, r.popupMedia, r.dataBindings ?? {}, this.youTubePlaceholder), a = this.popupContainer;
|
|
4943
4944
|
this.popupContainer.remove(), a.innerHTML = i, this.mapContainer.appendChild(a), this.addPopupControls(), e ? this.popupContainer.querySelector(".mc-popup-button.next")?.focus() : this.popupContainer.querySelector(".mc-popup-button.prev")?.focus();
|
|
4944
4945
|
}
|
|
4945
4946
|
}
|
|
4946
|
-
},
|
|
4947
|
+
}, Xr = class {
|
|
4947
4948
|
line;
|
|
4948
4949
|
mercatorLine;
|
|
4949
4950
|
distances;
|
|
4950
4951
|
totalLength;
|
|
4951
4952
|
constructor(e) {
|
|
4952
|
-
this.line = e.filter((t, n) => n === 0 || e[n][0] !== e[n - 1][0] || e[n][1] !== e[n - 1][1]), this.mercatorLine = this.line.map((e) => a.fromLngLat(e)), this.distances =
|
|
4953
|
+
this.line = e.filter((t, n) => n === 0 || e[n][0] !== e[n - 1][0] || e[n][1] !== e[n - 1][1]), this.mercatorLine = this.line.map((e) => a.fromLngLat(e)), this.distances = Zr(this.mercatorLine), this.totalLength = this.distances[this.distances.length - 1];
|
|
4953
4954
|
}
|
|
4954
4955
|
sample(e) {
|
|
4955
4956
|
let t = this.mercatorLine, n = this.distances;
|
|
@@ -4969,11 +4970,11 @@ var Ur = [
|
|
|
4969
4970
|
let n = this.mercatorLine.filter((n, r) => this.distances[r] >= e * this.totalLength && this.distances[r] <= t * this.totalLength);
|
|
4970
4971
|
if (e > 0) {
|
|
4971
4972
|
let t = this.sample(e);
|
|
4972
|
-
|
|
4973
|
+
Qr(t, n[0]) || n.unshift(t);
|
|
4973
4974
|
}
|
|
4974
4975
|
if (t < 1) {
|
|
4975
4976
|
let e = this.sample(t);
|
|
4976
|
-
|
|
4977
|
+
Qr(e, n[n.length - 1]) || n.push(e);
|
|
4977
4978
|
}
|
|
4978
4979
|
return n.map((e) => {
|
|
4979
4980
|
let { lng: t, lat: n } = e.toLngLat();
|
|
@@ -4984,7 +4985,7 @@ var Ur = [
|
|
|
4984
4985
|
return this.totalLength;
|
|
4985
4986
|
}
|
|
4986
4987
|
};
|
|
4987
|
-
function
|
|
4988
|
+
function Zr(e) {
|
|
4988
4989
|
let t = 0, n = [t];
|
|
4989
4990
|
for (let r = 1; r < e.length; ++r) {
|
|
4990
4991
|
let i = e[r - 1], a = e[r], o = a.x - i.x, s = a.y - i.y;
|
|
@@ -4992,24 +4993,24 @@ function Jr(e) {
|
|
|
4992
4993
|
}
|
|
4993
4994
|
return n;
|
|
4994
4995
|
}
|
|
4995
|
-
function
|
|
4996
|
+
function Qr(e, t) {
|
|
4996
4997
|
return e.x === t.x && e.y === t.y;
|
|
4997
4998
|
}
|
|
4998
4999
|
//#endregion
|
|
4999
5000
|
//#region src/models/line.ts
|
|
5000
|
-
var
|
|
5001
|
+
var $r = {
|
|
5001
5002
|
solid: [1, 0],
|
|
5002
5003
|
dotted: [.7, .3],
|
|
5003
5004
|
dashed: [3.5, 1.5]
|
|
5004
5005
|
};
|
|
5005
|
-
function
|
|
5006
|
+
function ei(e, t, n, r, i) {
|
|
5006
5007
|
e.addSource(t.id, {
|
|
5007
5008
|
type: "geojson",
|
|
5008
5009
|
data: {
|
|
5009
5010
|
type: "FeatureCollection",
|
|
5010
|
-
features: t.models.filter((e) => e.visible ?? !0).map((n) =>
|
|
5011
|
+
features: t.models.filter((e) => e.visible ?? !0).map((n) => ti(e, t, n, 1, r))
|
|
5011
5012
|
}
|
|
5012
|
-
}), Object.entries(
|
|
5013
|
+
}), Object.entries($r).forEach(([r, i]) => {
|
|
5013
5014
|
t.models.some((e) => (e.lineStyle ?? "solid") === r) && e.addLayer({
|
|
5014
5015
|
id: `${t.id}-${r}`,
|
|
5015
5016
|
type: "line",
|
|
@@ -5092,8 +5093,8 @@ function Zr(e, t, n, r, i) {
|
|
|
5092
5093
|
]
|
|
5093
5094
|
}, n);
|
|
5094
5095
|
}
|
|
5095
|
-
function
|
|
5096
|
-
let a = new
|
|
5096
|
+
function ti(e, t, n, r, i) {
|
|
5097
|
+
let a = new Xr(n.geometry).slice(0, r), o = n.svg !== void 0 && a.length > 1 ? ot(n.dataBindings ?? {}, n.svg, void 0) : void 0, s = o === void 0 ? void 0 : i.getMapLibreImageKey(o, window.devicePixelRatio * (n.iconScale ?? 1) * e.getScale());
|
|
5097
5098
|
return {
|
|
5098
5099
|
type: "Feature",
|
|
5099
5100
|
id: V(n.id),
|
|
@@ -5104,7 +5105,7 @@ function Qr(e, t, n, r, i) {
|
|
|
5104
5105
|
"line-style": n.lineStyle ?? "solid",
|
|
5105
5106
|
"mc-image-key": s,
|
|
5106
5107
|
"mc-svg-string": o,
|
|
5107
|
-
"icon-rotate":
|
|
5108
|
+
"icon-rotate": ni(n, a, e),
|
|
5108
5109
|
"icon-offset": n.iconOffset,
|
|
5109
5110
|
"icon-size": n.iconScale
|
|
5110
5111
|
},
|
|
@@ -5120,12 +5121,12 @@ function Qr(e, t, n, r, i) {
|
|
|
5120
5121
|
}
|
|
5121
5122
|
};
|
|
5122
5123
|
}
|
|
5123
|
-
function
|
|
5124
|
+
function ni(e, t, n) {
|
|
5124
5125
|
return e.iconRotation ? e.iconAlign ? kt(t, n) + e.iconRotation : e.iconRotation : 0;
|
|
5125
5126
|
}
|
|
5126
5127
|
//#endregion
|
|
5127
5128
|
//#region src/models/area.ts
|
|
5128
|
-
function
|
|
5129
|
+
function ri(e, t, n, r, i, a, o) {
|
|
5129
5130
|
let s = It(t), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
|
|
5130
5131
|
for (let e of t.models) {
|
|
5131
5132
|
let n = e.featureId, a = t.id, o = [], u = Dt(e), d = Et(a, e), f = l.get(d) ?? {
|
|
@@ -5293,12 +5294,12 @@ function ei(e, t, n, r, i, a, o) {
|
|
|
5293
5294
|
}
|
|
5294
5295
|
//#endregion
|
|
5295
5296
|
//#region src/models/dot.ts
|
|
5296
|
-
function
|
|
5297
|
+
function ii(e, t, n) {
|
|
5297
5298
|
e.addSource(t.id, {
|
|
5298
5299
|
type: "geojson",
|
|
5299
5300
|
data: {
|
|
5300
5301
|
type: "FeatureCollection",
|
|
5301
|
-
features: t.models.filter((e) => e.visible ?? !0).map((e) =>
|
|
5302
|
+
features: t.models.filter((e) => e.visible ?? !0).map((e) => ai(t, e))
|
|
5302
5303
|
}
|
|
5303
5304
|
}), e.addLayer({
|
|
5304
5305
|
id: t.id,
|
|
@@ -5319,7 +5320,7 @@ function ti(e, t, n) {
|
|
|
5319
5320
|
}
|
|
5320
5321
|
}, n);
|
|
5321
5322
|
}
|
|
5322
|
-
function
|
|
5323
|
+
function ai(e, t) {
|
|
5323
5324
|
return {
|
|
5324
5325
|
type: "Feature",
|
|
5325
5326
|
id: t.id,
|
|
@@ -5336,7 +5337,7 @@ function ni(e, t) {
|
|
|
5336
5337
|
}
|
|
5337
5338
|
//#endregion
|
|
5338
5339
|
//#region src/utils/pdfFonts.ts
|
|
5339
|
-
function
|
|
5340
|
+
function oi(e) {
|
|
5340
5341
|
let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
5341
5342
|
function i(n) {
|
|
5342
5343
|
return t.get(n) ?? t.set(n, e.load(n)).get(n);
|
|
@@ -5379,18 +5380,18 @@ function ri(e) {
|
|
|
5379
5380
|
}
|
|
5380
5381
|
//#endregion
|
|
5381
5382
|
//#region src/utils/svg2pdf.ts
|
|
5382
|
-
function
|
|
5383
|
-
let r = e.metadata?.colorconversion, i = r ? new Map(r.map((e) => [
|
|
5383
|
+
function si(e, t, n) {
|
|
5384
|
+
let r = e.metadata?.colorconversion, i = r ? new Map(r.map((e) => [ci(e.rgbin.split(" ").map((e) => Number(e))), e.cmykout.split(" ").map((e) => Number(e) * 100)])) : null;
|
|
5384
5385
|
return {
|
|
5385
|
-
colorCallback:
|
|
5386
|
-
fontCallback:
|
|
5386
|
+
colorCallback: li.bind(null, i),
|
|
5387
|
+
fontCallback: ui(t, n),
|
|
5387
5388
|
assumePt: !0
|
|
5388
5389
|
};
|
|
5389
5390
|
}
|
|
5390
|
-
var
|
|
5391
|
-
function
|
|
5391
|
+
var ci = ([e, t, n]) => `R${e}G${t}B${n}`;
|
|
5392
|
+
function li(e, t) {
|
|
5392
5393
|
if (!t) return;
|
|
5393
|
-
let n = t[0], r =
|
|
5394
|
+
let n = t[0], r = ci(n), i = e?.get(r);
|
|
5394
5395
|
if (i) return [i, t[1]];
|
|
5395
5396
|
let a = (255 - n[0]) / 255, o = (255 - n[1]) / 255, s = (255 - n[2]) / 255, c = Math.min(a, o, s);
|
|
5396
5397
|
return [[
|
|
@@ -5400,8 +5401,8 @@ function oi(e, t) {
|
|
|
5400
5401
|
c * 100
|
|
5401
5402
|
], t[1]];
|
|
5402
5403
|
}
|
|
5403
|
-
function
|
|
5404
|
-
return
|
|
5404
|
+
function ui(e, t) {
|
|
5405
|
+
return oi({
|
|
5405
5406
|
registered: (t, n, r) => {
|
|
5406
5407
|
let i = Fe(e.fontMap.values(), t, n, r) ?? e.getDirectFont(t);
|
|
5407
5408
|
return i && {
|
|
@@ -5410,7 +5411,7 @@ function si(e, t) {
|
|
|
5410
5411
|
style: i.style
|
|
5411
5412
|
};
|
|
5412
5413
|
},
|
|
5413
|
-
search: async (e, n, r) => (await
|
|
5414
|
+
search: async (e, n, r) => (await di(t, {
|
|
5414
5415
|
family: e,
|
|
5415
5416
|
weight: String(n),
|
|
5416
5417
|
style: r
|
|
@@ -5424,7 +5425,7 @@ function si(e, t) {
|
|
|
5424
5425
|
}
|
|
5425
5426
|
});
|
|
5426
5427
|
}
|
|
5427
|
-
async function
|
|
5428
|
+
async function di(e, t) {
|
|
5428
5429
|
let n = new URLSearchParams(Object.entries(t).map(([e, t]) => [e, String(t)])), r = `${e.apiUrl ?? "https://api.mapcreator.io"}/v1/fonts/search?${n}`, i = {
|
|
5429
5430
|
Accept: "application/json",
|
|
5430
5431
|
Authorization: e.bearerToken.startsWith("Bearer ") ? e.bearerToken : `Bearer ${e.bearerToken}`
|
|
@@ -5443,10 +5444,10 @@ async function ci(e, t) {
|
|
|
5443
5444
|
}
|
|
5444
5445
|
//#endregion
|
|
5445
5446
|
//#region src/utils/geoTiff.ts
|
|
5446
|
-
function
|
|
5447
|
+
function fi(e, { width: t, height: n }) {
|
|
5447
5448
|
let r = [];
|
|
5448
5449
|
for (let i = 0; i <= 2; i++) for (let s = 0; s <= 2; s++) {
|
|
5449
|
-
let c = i / 2 * t, l = s / 2 * n, { x: u, y: d } =
|
|
5450
|
+
let c = i / 2 * t, l = s / 2 * n, { x: u, y: d } = pi(a.fromLngLat(e.unprojectWithScaleCorrection(new o(c, l))));
|
|
5450
5451
|
r.push(c, l, 0, u, d, 0);
|
|
5451
5452
|
}
|
|
5452
5453
|
return {
|
|
@@ -5459,7 +5460,7 @@ function li(e, { width: t, height: n }) {
|
|
|
5459
5460
|
ModelPixelScale: []
|
|
5460
5461
|
};
|
|
5461
5462
|
}
|
|
5462
|
-
function
|
|
5463
|
+
function pi(e) {
|
|
5463
5464
|
return {
|
|
5464
5465
|
x: H(-20037508.34, 20037508.34, e.x),
|
|
5465
5466
|
y: H(20037508.34, -20037508.34, e.y)
|
|
@@ -5467,7 +5468,7 @@ function ui(e) {
|
|
|
5467
5468
|
}
|
|
5468
5469
|
//#endregion
|
|
5469
5470
|
//#region src/Image.ts
|
|
5470
|
-
var
|
|
5471
|
+
var mi = class {
|
|
5471
5472
|
mcMap;
|
|
5472
5473
|
format;
|
|
5473
5474
|
svgCache;
|
|
@@ -5493,49 +5494,63 @@ var di = class {
|
|
|
5493
5494
|
};
|
|
5494
5495
|
//#endregion
|
|
5495
5496
|
//#region src/utils/video/index.ts
|
|
5496
|
-
function
|
|
5497
|
-
let t = e.length > 0 ? [
|
|
5497
|
+
function hi(e) {
|
|
5498
|
+
let t = e.length > 0 ? [gi(e[0])] : [], n = 0, r = 0;
|
|
5498
5499
|
for (let i = 1; i < e.length; ++i) {
|
|
5499
|
-
let a =
|
|
5500
|
-
n +=
|
|
5500
|
+
let a = gi(e[i]);
|
|
5501
|
+
n += _i(e[i - 1].center[0], a.center[0]), r += _i(e[i - 1].bearing, a.bearing), a.center[0] += n * 360, a.x += n, a.bearing += r * 360, t.push(a);
|
|
5501
5502
|
}
|
|
5502
5503
|
return t;
|
|
5503
5504
|
}
|
|
5504
|
-
function
|
|
5505
|
+
function gi(e) {
|
|
5505
5506
|
return {
|
|
5506
5507
|
...e,
|
|
5507
5508
|
center: [e.center[0], e.center[1]]
|
|
5508
5509
|
};
|
|
5509
5510
|
}
|
|
5510
|
-
function
|
|
5511
|
+
function _i(e, t) {
|
|
5511
5512
|
if (Math.abs(e) + Math.abs(t) > 180) {
|
|
5512
5513
|
if (e > 0 && t < 0) return 1;
|
|
5513
5514
|
if (e < 0 && t > 0) return -1;
|
|
5514
5515
|
}
|
|
5515
5516
|
return 0;
|
|
5516
5517
|
}
|
|
5517
|
-
function
|
|
5518
|
+
function vi(e) {
|
|
5518
5519
|
return 2 ** -e;
|
|
5519
5520
|
}
|
|
5520
|
-
function
|
|
5521
|
+
function yi(e) {
|
|
5521
5522
|
return e.length > 0 ? e[e.length - 1].time : 0;
|
|
5522
5523
|
}
|
|
5523
|
-
function
|
|
5524
|
+
function bi(e) {
|
|
5524
5525
|
return `${String(Math.floor(e % 36e5 / 6e4)).padStart(2, "0")}:${String(Math.floor(e % 6e4 / 1e3)).padStart(2, "0")}`;
|
|
5525
5526
|
}
|
|
5526
|
-
function
|
|
5527
|
+
function xi(e) {
|
|
5527
5528
|
return he(e, 23.976) ? 24e3 / 1001 : he(e, 29.97) ? 3e4 / 1001 : he(e, 59.94) ? 6e4 / 1001 : e;
|
|
5528
5529
|
}
|
|
5529
|
-
function
|
|
5530
|
+
function Si(e, t) {
|
|
5530
5531
|
return e === void 0 || t === void 0 ? e === t : e.center.lat === t.center.lat && e.center.lng === t.center.lng && e.zoom === t.zoom && e.bearing === t.bearing && e.pitch === t.pitch && e.fov === t.fov && e.elevation === t.elevation;
|
|
5531
5532
|
}
|
|
5532
5533
|
//#endregion
|
|
5533
5534
|
//#region src/VideoPreloadOverlay.ts
|
|
5534
|
-
var
|
|
5535
|
+
var Ci = `
|
|
5536
|
+
<div class="preload-bar-vertical"></div>
|
|
5537
|
+
<div class="preload-bar-horizontal"></div>
|
|
5538
|
+
<div class="preload-badge">
|
|
5539
|
+
<div class="preload-ring-outer"></div>
|
|
5540
|
+
<div class="preload-ring-inner"></div>
|
|
5541
|
+
<div class="preload-ring-dots"></div>
|
|
5542
|
+
<div class="preload-content">
|
|
5543
|
+
<div class="preload-logo"><svg xmlns="http://www.w3.org/2000/svg" width="130" height="18" viewBox="0 0 130 18" fill="currentColor"><path d="M16.49.815h-3.283V17.35h3.283zm-6.566 0h-3.32v6.567h3.32zm16.461 0h-6.567v3.32h6.567zm0 13.215h-6.567v3.319h6.567zM3.321.815H.038V17.35h3.283zM38.38 5.18l2.01 5.667 2-5.666h2.12v7.812h-1.62v-2.137l.164-3.684-2.092 5.82h-1.128l-2.11-5.82.164 3.684v2.137h-1.61V5.18zm14.488 6.176h-2.81l-.537 1.61h-1.728l2.91-7.812h1.492l2.928 7.812h-1.719zm-2.392-1.273h1.955l-.982-2.929zm9.432.154v2.729h-1.61V5.18h3.046a3.5 3.5 0 0 1 1.547.318c.426.193.784.51 1.027.91.246.405.372.872.364 1.346a2.21 2.21 0 0 1-.791 1.819 3.27 3.27 0 0 1-2.174.663zm0-1.3h1.436c.352.02.698-.09.974-.31a1.1 1.1 0 0 0 .336-.909 1.2 1.2 0 0 0-1.1-1.291h-1.646zm14.059 1.455a2.73 2.73 0 0 1-.91 1.982 3.2 3.2 0 0 1-2.21.728 2.94 2.94 0 0 1-2.364-1.01 4.16 4.16 0 0 1-.91-2.783v-.472a4.7 4.7 0 0 1 .419-2.028c.25-.535.656-.982 1.164-1.283a3.24 3.24 0 0 1 1.71-.455 3.17 3.17 0 0 1 2.182.728c.557.53.884 1.259.91 2.028h-1.592a1.62 1.62 0 0 0-.418-1.091 1.57 1.57 0 0 0-1.11-.346 1.35 1.35 0 0 0-1.2.582 3.1 3.1 0 0 0-.41 1.82v.59c-.037.63.095 1.258.383 1.82a1.32 1.32 0 0 0 1.21.581c.398.034.796-.086 1.109-.336.273-.284.426-.662.427-1.055zm6.393-.255h-1.28v2.856h-1.61V5.18h2.9a3.2 3.2 0 0 1 2.138.618 2.12 2.12 0 0 1 .755 1.737 2.17 2.17 0 0 1-1.373 2.192l1.691 3.192v.073H81.89zm-1.281-1.31h1.3c.332.018.657-.092.91-.309a1.1 1.1 0 0 0 .336-.845 1.2 1.2 0 0 0-.318-.91 1.32 1.32 0 0 0-.964-.318h-1.264zm12.55.783h-3.093v2.09h3.638v1.292h-5.247V5.18h5.23v1.3h-3.639v1.865h3.092zm8.339 1.746H97.14l-.537 1.61h-1.71l2.91-7.812h1.492l2.929 7.812h-1.71zm-2.392-1.3h1.956l-.983-2.929zm13.06-3.575h-2.374v6.512h-1.609V6.48h-2.365v-1.3h6.366zm9.631 2.783a4.7 4.7 0 0 1-.409 2.028 3 3 0 0 1-1.164 1.337 3.44 3.44 0 0 1-3.474 0 3.07 3.07 0 0 1-1.183-1.337 4.55 4.55 0 0 1-.427-1.991V8.91a4.56 4.56 0 0 1 .418-2.028 3.1 3.1 0 0 1 1.174-1.355 3.48 3.48 0 0 1 3.474 0c.516.325.925.797 1.173 1.355a4.56 4.56 0 0 1 .418 2.028zm-1.628-.354a3.2 3.2 0 0 0-.445-1.874 1.45 1.45 0 0 0-1.255-.636 1.42 1.42 0 0 0-1.246.636 3.2 3.2 0 0 0-.446 1.82v.381c-.03.636.121 1.267.437 1.819a1.53 1.53 0 0 0 1.255.65 1.54 1.54 0 0 0 1.255-.65 3.36 3.36 0 0 0 .445-1.819zm8.14 1.227h-1.237v2.856h-1.619V5.18h2.91a3.2 3.2 0 0 1 2.137.618 2.12 2.12 0 0 1 .755 1.737 2.23 2.23 0 0 1-1.455 2.192l1.692 3.192v.073h-1.692zm-1.237-1.31h1.291c.33.01.653-.1.91-.309a1.08 1.08 0 0 0 .327-.845 1.2 1.2 0 0 0-.309-.91 1.33 1.33 0 0 0-.964-.318h-1.255z"/></svg>
|
|
5544
|
+
</div>
|
|
5545
|
+
<div class="preload-percentage">0%</div>
|
|
5546
|
+
<div class="preload-label">${Pn("loadingMap")}</div>
|
|
5547
|
+
</div>
|
|
5548
|
+
</div>
|
|
5549
|
+
`, wi = class {
|
|
5535
5550
|
container;
|
|
5536
5551
|
percentage;
|
|
5537
5552
|
constructor(e) {
|
|
5538
|
-
this.container = document.createElement("div"), this.container.className = "preload-overlay", this.container.innerHTML =
|
|
5553
|
+
this.container = document.createElement("div"), this.container.className = "preload-overlay", this.container.innerHTML = Ci, this.percentage = this.container.querySelector(".preload-percentage"), e.getContainer().appendChild(this.container);
|
|
5539
5554
|
}
|
|
5540
5555
|
remove() {
|
|
5541
5556
|
this.container.remove();
|
|
@@ -5543,11 +5558,11 @@ var bi = "\n <div class=\"preload-bar-vertical\"></div>\n <div class=\"preload
|
|
|
5543
5558
|
setProgress(e) {
|
|
5544
5559
|
this.percentage.innerText = `${Math.floor(e * 100)}%`;
|
|
5545
5560
|
}
|
|
5546
|
-
},
|
|
5561
|
+
}, Ti = class {
|
|
5547
5562
|
segments;
|
|
5548
5563
|
constructor(e) {
|
|
5549
5564
|
this.segments = [];
|
|
5550
|
-
let t = new
|
|
5565
|
+
let t = new Ei(), n = A(t);
|
|
5551
5566
|
n.lineStart();
|
|
5552
5567
|
for (let t of e) n.point(t.x, t.y);
|
|
5553
5568
|
n.lineEnd(), this.segments = t.segments;
|
|
@@ -5562,7 +5577,7 @@ var bi = "\n <div class=\"preload-bar-vertical\"></div>\n <div class=\"preload
|
|
|
5562
5577
|
let n = M((t) => this.sample(t) - e, t);
|
|
5563
5578
|
return n === !1 ? t : n;
|
|
5564
5579
|
}
|
|
5565
|
-
},
|
|
5580
|
+
}, Ei = class {
|
|
5566
5581
|
previousPoint = {
|
|
5567
5582
|
x: 0,
|
|
5568
5583
|
y: 0
|
|
@@ -5607,25 +5622,25 @@ var bi = "\n <div class=\"preload-bar-vertical\"></div>\n <div class=\"preload
|
|
|
5607
5622
|
};
|
|
5608
5623
|
//#endregion
|
|
5609
5624
|
//#region src/utils/video/easings.ts
|
|
5610
|
-
function
|
|
5625
|
+
function Di(e, t, n, r) {
|
|
5611
5626
|
return t + n / r * e;
|
|
5612
5627
|
}
|
|
5613
|
-
function
|
|
5628
|
+
function Oi(e, t, n, r) {
|
|
5614
5629
|
return n * ((e = e / r - 1) * e * e + 1) + t;
|
|
5615
5630
|
}
|
|
5616
|
-
function
|
|
5631
|
+
function ki(e, t, n, r) {
|
|
5617
5632
|
let i = 1.70158, a = 0, o = n;
|
|
5618
5633
|
return e === 0 ? t : (e /= r) === 1 ? t + n : (a ||= r * .3, o < Math.abs(n) ? (o = n, i = a / 4) : i = a / (2 * Math.PI) * Math.asin(n / o), o * 2 ** (-10 * e) * Math.sin((e * r - i) * (2 * Math.PI) / a) + n + t);
|
|
5619
5634
|
}
|
|
5620
|
-
function
|
|
5635
|
+
function Ai(e, t, n, r, i) {
|
|
5621
5636
|
return i === void 0 && (i = 1.70158), n * ((e = e / r - 1) * e * ((i + 1) * e + i) + 1) + t;
|
|
5622
5637
|
}
|
|
5623
|
-
function
|
|
5638
|
+
function ji(e, t, n, r) {
|
|
5624
5639
|
return (e /= r) < 1 / 2.75 ? n * (7.5625 * e * e) + t : e < 2 / 2.75 ? n * (7.5625 * (e -= 1.5 / 2.75) * e + .75) + t : e < 2.5 / 2.75 ? n * (7.5625 * (e -= 2.25 / 2.75) * e + .9375) + t : n * (7.5625 * (e -= 2.625 / 2.75) * e + .984375) + t;
|
|
5625
5640
|
}
|
|
5626
5641
|
//#endregion
|
|
5627
5642
|
//#region src/utils/video/cameraCurve.ts
|
|
5628
|
-
var
|
|
5643
|
+
var Mi = class {
|
|
5629
5644
|
script;
|
|
5630
5645
|
xCurve;
|
|
5631
5646
|
yCurve;
|
|
@@ -5636,10 +5651,10 @@ var ki = class {
|
|
|
5636
5651
|
altitudeCurve;
|
|
5637
5652
|
elevationCurve;
|
|
5638
5653
|
constructor(e) {
|
|
5639
|
-
this.script =
|
|
5654
|
+
this.script = hi(e), this.xCurve = this.createMonotonicCurve(this.script, "x"), this.yCurve = this.createMonotonicCurve(this.script, "y"), this.fovCurve = this.createMonotonicCurve(this.script, "fov"), this.zoomCurve = this.createMonotonicCurve(this.script, "zoom"), this.pitchCurve = this.createMonotonicCurve(this.script, "pitch"), this.bearingCurve = this.createMonotonicCurve(this.script, "bearing"), this.altitudeCurve = this.createMonotonicCurve(this.script, "altitude"), this.elevationCurve = this.createMonotonicCurve(this.script, "elevation");
|
|
5640
5655
|
}
|
|
5641
5656
|
sample(e) {
|
|
5642
|
-
let t = this.zoomCurve.sample(e), n = this.altitudeCurve.solve(
|
|
5657
|
+
let t = this.zoomCurve.sample(e), n = this.altitudeCurve.solve(vi(t), e), r = this.xCurve.sample(n), i = this.yCurve.sample(n), o = this.elevationCurve.sample(n), s = this.bearingCurve.sample(e), c = this.pitchCurve.sample(e), l = this.fovCurve.sample(e);
|
|
5643
5658
|
return {
|
|
5644
5659
|
center: new a(r, i).toLngLat(),
|
|
5645
5660
|
zoom: t,
|
|
@@ -5683,7 +5698,7 @@ var ki = class {
|
|
|
5683
5698
|
y: l
|
|
5684
5699
|
});
|
|
5685
5700
|
}
|
|
5686
|
-
return new
|
|
5701
|
+
return new Ti(n);
|
|
5687
5702
|
}
|
|
5688
5703
|
sampleAutoHideOpacity(e) {
|
|
5689
5704
|
let t = this.script;
|
|
@@ -5694,12 +5709,12 @@ var ki = class {
|
|
|
5694
5709
|
if (r.hideLabels === (a?.hideLabels ?? !1)) o = r.hideLabels ? 0 : 1;
|
|
5695
5710
|
else {
|
|
5696
5711
|
let t = e - r.time, n = Math.min(400, i.time - r.time);
|
|
5697
|
-
o = U(
|
|
5712
|
+
o = U(Oi(t, r.hideLabels ? 1 : 0, r.hideLabels ? -1 : 1, n), 0, 1);
|
|
5698
5713
|
}
|
|
5699
5714
|
let s;
|
|
5700
5715
|
if (n === t.length - 2 && r.hideLabels) {
|
|
5701
5716
|
let t = Math.max(r.time, i.time - 400);
|
|
5702
|
-
s = U(
|
|
5717
|
+
s = U(Oi(e - t, 0, 1, i.time - t), 0, 1);
|
|
5703
5718
|
} else s = 0;
|
|
5704
5719
|
return Math.max(o, s);
|
|
5705
5720
|
}
|
|
@@ -5711,9 +5726,9 @@ var ki = class {
|
|
|
5711
5726
|
}
|
|
5712
5727
|
}
|
|
5713
5728
|
getKeyframeValue(e, t) {
|
|
5714
|
-
return t === "altitude" ?
|
|
5729
|
+
return t === "altitude" ? vi(e.zoom) : e[t];
|
|
5715
5730
|
}
|
|
5716
|
-
},
|
|
5731
|
+
}, Ni = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\"><path d=\"M2.83545 2.66675V6.00008H6.00078M3.38078 5.33341C3.99882 4.26305 4.96943 3.44057 6.1267 3.00656C7.28398 2.57255 8.55607 2.55396 9.72553 2.95397C10.895 3.35397 11.8892 4.14774 12.5383 5.19959C13.1873 6.25144 13.4509 7.49606 13.2839 8.72072C13.117 9.94537 12.5298 11.074 11.6229 11.9137C10.716 12.7535 9.54555 13.2521 8.31169 13.3245C7.07782 13.3968 5.85714 13.0384 4.85828 12.3104C3.85942 11.5824 3.1444 10.5302 2.83545 9.33341\" stroke-width=\"1.25\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>\n", Pi = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"10\" height=\"12\" viewBox=\"0 0 10 12\" fill=\"currentColor\"><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M0.991136 3.66807e-08C1.53861 1.64225e-08 1.98242 0.474849 1.98242 1.06061L1.98242 10.6061C1.98242 11.1918 1.53861 11.6667 0.991137 11.6667C0.443665 11.6667 -0.000148911 11.1918 -0.000148941 10.6061L-0.000149434 1.06061C-0.000149464 0.47485 0.443664 5.69389e-08 0.991136 3.66807e-08Z\"/><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M8.92082 3.66807e-08C9.4683 1.64225e-08 9.91211 0.474849 9.91211 1.06061L9.91211 10.6061C9.91211 11.1918 9.4683 11.6667 8.92082 11.6667C8.37335 11.6667 7.92954 11.1918 7.92954 10.6061L7.92954 1.06061C7.92954 0.47485 8.37335 5.69389e-08 8.92082 3.66807e-08Z\"/></svg>\n", Fi = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\"><path d=\"M4.88141 14.9874C4.58039 14.9874 4.2919 14.9121 4.01596 14.774C3.38883 14.4475 3 13.8072 3 13.104V2.88322C3 2.18007 3.38883 1.5397 4.01596 1.21323C4.6431 0.886771 5.39567 0.936996 5.97263 1.35135L13.2098 6.46175C13.7115 6.81332 14 7.39091 14 8.00617C14 8.62142 13.699 9.18645 13.2098 9.55059L5.97263 14.6484C5.64652 14.8744 5.27024 15 4.89396 15L4.88141 14.9874ZM4.88141 2.2554C4.78107 2.2554 4.68073 2.28052 4.59293 2.33074C4.3797 2.44375 4.25428 2.64465 4.25428 2.88322V13.104C4.25428 13.3426 4.3797 13.556 4.59293 13.6565C4.80616 13.7695 5.04447 13.7444 5.24515 13.6063L12.4823 8.49586C12.5634 8.4368 12.6294 8.35937 12.6749 8.2699C12.7204 8.18043 12.7442 8.08145 12.7442 7.98105C12.7442 7.88065 12.7204 7.78168 12.6749 7.69221C12.6294 7.60274 12.5634 7.52531 12.4823 7.46625L5.24515 2.36841C5.1378 2.29542 5.01118 2.25608 4.88141 2.2554Z\"/></svg>\n", Ii = (e) => `
|
|
5717
5732
|
<div class="video-slider-container">
|
|
5718
5733
|
<div class="video-slider-line-wrapper">
|
|
5719
5734
|
<div class="video-slider-line-left"></div>
|
|
@@ -5723,21 +5738,21 @@ var ki = class {
|
|
|
5723
5738
|
</div>
|
|
5724
5739
|
<div class="video-controls-row">
|
|
5725
5740
|
<button class="video-button play">
|
|
5726
|
-
<span class="video-icon play-icon">${
|
|
5727
|
-
<span class="video-icon pause-icon">${
|
|
5741
|
+
<span class="video-icon play-icon">${Fi}</span>
|
|
5742
|
+
<span class="video-icon pause-icon">${Pi}</span>
|
|
5728
5743
|
</button>
|
|
5729
5744
|
<button class="video-button restart">
|
|
5730
|
-
${
|
|
5745
|
+
${Ni}
|
|
5731
5746
|
</button>
|
|
5732
5747
|
<div class="video-time">
|
|
5733
|
-
<span class="video-playhead">${
|
|
5734
|
-
<span class="video-duration">${
|
|
5748
|
+
<span class="video-playhead">${bi(0)}</span> /
|
|
5749
|
+
<span class="video-duration">${bi(e)}</span>
|
|
5735
5750
|
</div>
|
|
5736
5751
|
<button class="video-button fullscreen">
|
|
5737
5752
|
${_n}
|
|
5738
5753
|
</button>
|
|
5739
5754
|
</div>
|
|
5740
|
-
`,
|
|
5755
|
+
`, Li = class {
|
|
5741
5756
|
callbacks;
|
|
5742
5757
|
duration;
|
|
5743
5758
|
container;
|
|
@@ -5751,7 +5766,7 @@ var ki = class {
|
|
|
5751
5766
|
playhead = 0;
|
|
5752
5767
|
isPlaying = !1;
|
|
5753
5768
|
constructor(e, t, n) {
|
|
5754
|
-
this.duration = t, this.callbacks = n, this.mapContainer = e.getContainer(), this.container = document.createElement("div"), this.container.className = "video-controls", this.container.innerHTML =
|
|
5769
|
+
this.duration = t, this.callbacks = n, this.mapContainer = e.getContainer(), this.container = document.createElement("div"), this.container.className = "video-controls", this.container.innerHTML = Ii(t), this.playButton = this.container.querySelector(".video-button.play"), this.restartButton = this.container.querySelector(".video-button.restart"), this.fullscreenButton = this.container.querySelector(".video-button.fullscreen"), this.slider = this.container.querySelector(".video-slider"), this.sliderFill = this.container.querySelector(".video-slider-line-left"), this.playheadLabel = this.container.querySelector(".video-playhead"), this.playButton.addEventListener("click", () => this.callbacks.playPause()), this.restartButton.addEventListener("click", () => this.callbacks.restart()), this.fullscreenButton.addEventListener("click", () => Sn(this.mapContainer)), this.slider.addEventListener("input", () => {
|
|
5755
5770
|
this.duration > 0 && this.callbacks.seek(Number(this.slider.value));
|
|
5756
5771
|
}), this.mapContainer.appendChild(this.container), this.update();
|
|
5757
5772
|
}
|
|
@@ -5763,39 +5778,39 @@ var ki = class {
|
|
|
5763
5778
|
}
|
|
5764
5779
|
update() {
|
|
5765
5780
|
let { duration: e, playhead: t } = this;
|
|
5766
|
-
this.playButton.classList.toggle("playing", this.isPlaying), this.restartButton.classList.toggle("disabled", t === 0), this.slider.value = String(t), this.sliderFill.style.width = `${de(0, e, t) * 100}%`, this.playheadLabel.textContent =
|
|
5781
|
+
this.playButton.classList.toggle("playing", this.isPlaying), this.restartButton.classList.toggle("disabled", t === 0), this.slider.value = String(t), this.sliderFill.style.width = `${de(0, e, t) * 100}%`, this.playheadLabel.textContent = bi(t);
|
|
5767
5782
|
}
|
|
5768
|
-
},
|
|
5783
|
+
}, Ri = class extends t {
|
|
5769
5784
|
time;
|
|
5770
5785
|
constructor(e, t) {
|
|
5771
5786
|
super(e), this.time = t;
|
|
5772
5787
|
}
|
|
5773
|
-
},
|
|
5774
|
-
linear:
|
|
5775
|
-
easeOutCubic:
|
|
5776
|
-
easeOutBack:
|
|
5777
|
-
easeOutBounce:
|
|
5778
|
-
easeOutElastic:
|
|
5788
|
+
}, zi = {
|
|
5789
|
+
linear: Di,
|
|
5790
|
+
easeOutCubic: Oi,
|
|
5791
|
+
easeOutBack: Ai,
|
|
5792
|
+
easeOutBounce: ji,
|
|
5793
|
+
easeOutElastic: ki
|
|
5779
5794
|
};
|
|
5780
|
-
function
|
|
5795
|
+
function Bi(e) {
|
|
5781
5796
|
return e.entryType === "fade" || e.exitType === "fade" || e.entryType === "instant" || e.exitType === "instant";
|
|
5782
5797
|
}
|
|
5783
|
-
function
|
|
5798
|
+
function Vi(e) {
|
|
5784
5799
|
return e.entryType === "grow" || e.exitType === "grow";
|
|
5785
5800
|
}
|
|
5786
5801
|
function $(e, t, n) {
|
|
5787
5802
|
let { entry: r, entryDuration: i, exit: a, exitDuration: o } = e, { entryType: s, entryEasing: c, exitType: l, exitEasing: u } = e;
|
|
5788
|
-
return n < r && (s === t || s === "instant" && t === "fade") || n > a && (l === t || l === "instant" && t === "fade") ? 0 : i > 0 && n < r + i && s === t ?
|
|
5803
|
+
return n < r && (s === t || s === "instant" && t === "fade") || n > a && (l === t || l === "instant" && t === "fade") ? 0 : i > 0 && n < r + i && s === t ? zi[c](n - r, 0, 1, i) : o > 0 && n > a - o && l === t ? zi[u](n - (a - o), 1, -1, o) : 1;
|
|
5789
5804
|
}
|
|
5790
|
-
function
|
|
5805
|
+
function Hi(e) {
|
|
5791
5806
|
return e.target.type === "model";
|
|
5792
5807
|
}
|
|
5793
|
-
function
|
|
5808
|
+
function Ui(e) {
|
|
5794
5809
|
return e.target.type === "layer" || e.target.type === "overlay";
|
|
5795
5810
|
}
|
|
5796
5811
|
//#endregion
|
|
5797
5812
|
//#region src/Video.ts
|
|
5798
|
-
var
|
|
5813
|
+
var Wi = class {
|
|
5799
5814
|
mcMap;
|
|
5800
5815
|
cameraCurve;
|
|
5801
5816
|
registryAnimations;
|
|
@@ -5826,11 +5841,11 @@ var Vi = class {
|
|
|
5826
5841
|
elevation: e.elevation ?? 0
|
|
5827
5842
|
};
|
|
5828
5843
|
}), u = t.video?.animations ?? [];
|
|
5829
|
-
this.layerAnimations = u.filter(
|
|
5830
|
-
let d = u.filter(
|
|
5831
|
-
this.registryAnimations = [...d.filter((e) => e.target.modelId === void 0), ...d.filter((e) => e.target.modelId !== void 0)], this.duration =
|
|
5844
|
+
this.layerAnimations = u.filter(Ui);
|
|
5845
|
+
let d = u.filter(Hi);
|
|
5846
|
+
this.registryAnimations = [...d.filter((e) => e.target.modelId === void 0), ...d.filter((e) => e.target.modelId !== void 0)], this.duration = yi(l), this.frameRate = xi(t.export?.frameRate ?? 60), this.cameraCurve = new Mi(l), this.registry = new qr(t), this.svgs = n, this.svgCache = r, this.mapstyle = i, this.overlays = o, this.layerInfo = s, this.backgroundColor = c;
|
|
5832
5847
|
let f = t.export?.format === "web_video";
|
|
5833
|
-
this.loop = f && (t.web?.loop ?? !1), f && t.web?.controls && (this.controls = new
|
|
5848
|
+
this.loop = f && (t.web?.loop ?? !1), f && t.web?.controls && (this.controls = new Li(e.map, this.duration, {
|
|
5834
5849
|
playPause: () => this.playbackContext === void 0 ? this.play() : this.pause(),
|
|
5835
5850
|
restart: () => {
|
|
5836
5851
|
this.seekTo(0), this.play();
|
|
@@ -5852,10 +5867,10 @@ var Vi = class {
|
|
|
5852
5867
|
this.playbackContext === void 0 && this.duration > 0 && (this.playhead >= this.duration && (this.playhead = 0), this.playbackContext = {
|
|
5853
5868
|
startTime: Date.now(),
|
|
5854
5869
|
startPlayhead: this.playhead
|
|
5855
|
-
}, this.mcMap.fire(new
|
|
5870
|
+
}, this.mcMap.fire(new Ri("playstart", this.playhead)), this.controls?.setPlaying(!0), this.playFrame());
|
|
5856
5871
|
}
|
|
5857
5872
|
pause() {
|
|
5858
|
-
this.playbackContext !== void 0 && (this.playbackContext = void 0, this.mcMap.fire(new
|
|
5873
|
+
this.playbackContext !== void 0 && (this.playbackContext = void 0, this.mcMap.fire(new Ri("playend", this.playhead)), this.controls?.setPlaying(!1));
|
|
5859
5874
|
}
|
|
5860
5875
|
seekTo(e) {
|
|
5861
5876
|
this.duration > 0 && (e = U(e, 0, this.duration), this.setFrame(e), this.playbackContext !== void 0 && (this.playbackContext = {
|
|
@@ -5875,46 +5890,50 @@ var Vi = class {
|
|
|
5875
5890
|
}
|
|
5876
5891
|
async preload() {
|
|
5877
5892
|
this.playbackContext !== void 0 && this.pause();
|
|
5878
|
-
let e = this.mcMap.map, t = Math.ceil(this.duration * this.frameRate / 1e3);
|
|
5879
|
-
|
|
5893
|
+
let e = this.mcMap.map, t = Math.ceil(this.duration * this.frameRate / 1e3), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set();
|
|
5894
|
+
for (let t of Object.values(e.style.tileManagers)) {
|
|
5895
|
+
let e = t.getSource();
|
|
5896
|
+
if (e.type === "vector" || e.type === "raster" || e.type === "raster-dem" || e.type === "geojson") {
|
|
5897
|
+
let r = t.usedForTerrain ? t.tileSize : e.tileSize, i = !t.usedForTerrain && (e.roundZoom ?? !1);
|
|
5898
|
+
n.set(`${r}/${i}`, {
|
|
5899
|
+
tileSize: r,
|
|
5900
|
+
roundZoom: i
|
|
5901
|
+
});
|
|
5902
|
+
}
|
|
5903
|
+
}
|
|
5904
|
+
this.preloadOverlay = new wi(this.mcMap.map), e._fadeDuration = 0;
|
|
5880
5905
|
try {
|
|
5881
|
-
let
|
|
5882
|
-
for (let
|
|
5883
|
-
this.preloadOverlay?.setProgress(
|
|
5884
|
-
let
|
|
5885
|
-
|
|
5906
|
+
let i, a = /* @__PURE__ */ new Set();
|
|
5907
|
+
for (let o = 0; o < t; o++) {
|
|
5908
|
+
this.preloadOverlay?.setProgress(o / t);
|
|
5909
|
+
let s = this.cameraCurve.sample(o * 1e3 / this.frameRate);
|
|
5910
|
+
if (Si(i, s)) continue;
|
|
5911
|
+
this.setCamera(s);
|
|
5912
|
+
let c = new Set([...n].flatMap(([t, n]) => e.coveringTiles(n).map((e) => `${t}/${e.key}`)));
|
|
5913
|
+
if (i !== void 0 && [...a].some((e) => !r.has(e) && !c.has(e))) {
|
|
5914
|
+
this.setCamera(i), await e.once("idle");
|
|
5915
|
+
for (let e of a) r.add(e);
|
|
5916
|
+
}
|
|
5917
|
+
i = s, a = c;
|
|
5886
5918
|
}
|
|
5887
|
-
|
|
5919
|
+
i !== void 0 && (this.setCamera(i), await e.once("idle"));
|
|
5888
5920
|
} finally {
|
|
5889
5921
|
this.setFrame(this.playhead), e._fadeDuration = 300, this.preloadOverlay?.remove(), this.preloadOverlay = void 0;
|
|
5890
5922
|
}
|
|
5891
5923
|
}
|
|
5892
|
-
waitForRenderOrAbort() {
|
|
5893
|
-
let e = this.mcMap.map;
|
|
5894
|
-
return new Promise((t) => {
|
|
5895
|
-
let n = () => {
|
|
5896
|
-
e.off("render", r), e.off("dataabort", i);
|
|
5897
|
-
}, r = () => {
|
|
5898
|
-
n(), t("render");
|
|
5899
|
-
}, i = (e) => {
|
|
5900
|
-
e.tile?.state === "loading" && (n(), t("abort"));
|
|
5901
|
-
};
|
|
5902
|
-
e.on("render", r), e.on("dataabort", i);
|
|
5903
|
-
});
|
|
5904
|
-
}
|
|
5905
5924
|
async captureFrame(e, t, n, r, i, a, o, s, c) {
|
|
5906
5925
|
return this.setFrame(e), await this.mcMap.map.once("idle"), i.fillStyle = this.backgroundColor, i.fillRect(0, 0, a, o), i.drawImage(n, 0, 0), await He(i, this.svgCache, s, c), t ? r.convertToBlob() : i.getImageData(0, 0, a, o);
|
|
5907
5926
|
}
|
|
5908
5927
|
playFrame() {
|
|
5909
5928
|
if (this.playbackContext !== void 0) {
|
|
5910
5929
|
let e = this.playbackContext.startPlayhead + (Date.now() - this.playbackContext.startTime);
|
|
5911
|
-
e > this.duration ? this.loop ? (this.seekTo(0), requestAnimationFrame(() => this.playFrame())) : (this.setFrame(this.duration), this.playbackContext = void 0, this.mcMap.fire(new
|
|
5930
|
+
e > this.duration ? this.loop ? (this.seekTo(0), requestAnimationFrame(() => this.playFrame())) : (this.setFrame(this.duration), this.playbackContext = void 0, this.mcMap.fire(new Ri("playend", this.playhead)), this.controls?.setPlaying(!1)) : (this.setFrame(e), requestAnimationFrame(() => this.playFrame()));
|
|
5912
5931
|
}
|
|
5913
5932
|
}
|
|
5914
5933
|
setFrame(e) {
|
|
5915
5934
|
this.playhead = e;
|
|
5916
5935
|
let t = this.cameraCurve.sample(e);
|
|
5917
|
-
this.setCamera(t), this.applyAnimations(e), this.mcMap.fire(new
|
|
5936
|
+
this.setCamera(t), this.applyAnimations(e), this.mcMap.fire(new Ri("play", e)), this.controls?.setPlayhead(e);
|
|
5918
5937
|
}
|
|
5919
5938
|
setCamera(e) {
|
|
5920
5939
|
let t = this.mcMap.map, n = t.getCenter(), r = t.getZoom(), i = t.getBearing(), a = t.getPitch(), o = t.getCenterElevation(), s = t.getVerticalFieldOfView();
|
|
@@ -5924,7 +5943,7 @@ var Vi = class {
|
|
|
5924
5943
|
let t = this.mcMap.map, { svgs: n, svgCache: r, registryAnimations: i } = this;
|
|
5925
5944
|
for (let n of i) {
|
|
5926
5945
|
let { target: r } = n;
|
|
5927
|
-
if (!
|
|
5946
|
+
if (!Bi(n)) continue;
|
|
5928
5947
|
let { modelType: i, groupId: a, modelId: o } = r, s = $(n, "fade", e);
|
|
5929
5948
|
if (i === "area") {
|
|
5930
5949
|
let e = this.registry.models.area[a] ?? {}, n = o === void 0 ? Object.values(e) : e[o] ? [e[o]] : [];
|
|
@@ -5947,7 +5966,7 @@ var Vi = class {
|
|
|
5947
5966
|
type: "FeatureCollection",
|
|
5948
5967
|
features: i.models.filter((e) => e.visible ?? !0).map((t) => {
|
|
5949
5968
|
let a = o.get(t.id);
|
|
5950
|
-
return
|
|
5969
|
+
return Tr(i, t, a === void 0 ? s : $(a, "grow", e), n, r);
|
|
5951
5970
|
})
|
|
5952
5971
|
});
|
|
5953
5972
|
}
|
|
@@ -5957,7 +5976,7 @@ var Vi = class {
|
|
|
5957
5976
|
type: "FeatureCollection",
|
|
5958
5977
|
features: n.models.filter((e) => e.visible ?? !0).map((i) => {
|
|
5959
5978
|
let s = a.get(i.id);
|
|
5960
|
-
return
|
|
5979
|
+
return ti(t, n, i, s === void 0 ? o : $(s, "grow", e), r);
|
|
5961
5980
|
})
|
|
5962
5981
|
});
|
|
5963
5982
|
}
|
|
@@ -5967,7 +5986,7 @@ var Vi = class {
|
|
|
5967
5986
|
type: "FeatureCollection",
|
|
5968
5987
|
features: i.models.filter((e) => e.visible ?? !0).map((a) => {
|
|
5969
5988
|
let c = o.get(a.id);
|
|
5970
|
-
return
|
|
5989
|
+
return kr(t, i, a, c === void 0 ? s : $(c, "grow", e), n, r);
|
|
5971
5990
|
})
|
|
5972
5991
|
});
|
|
5973
5992
|
}
|
|
@@ -5985,7 +6004,7 @@ var Vi = class {
|
|
|
5985
6004
|
let r, i = /* @__PURE__ */ new Map();
|
|
5986
6005
|
for (let a of this.registryAnimations) {
|
|
5987
6006
|
let { target: o } = a;
|
|
5988
|
-
o.modelType === e && o.groupId === t && (n === "opacity" &&
|
|
6007
|
+
o.modelType === e && o.groupId === t && (n === "opacity" && Bi(a) || n === "scale" && Vi(a)) && (o.modelId === void 0 ? r = a : i.set(o.modelId, a));
|
|
5989
6008
|
}
|
|
5990
6009
|
return {
|
|
5991
6010
|
groupAnimation: r,
|
|
@@ -5999,18 +6018,18 @@ var Vi = class {
|
|
|
5999
6018
|
let { target: n } = t;
|
|
6000
6019
|
n.type === "layer" && n.ids.includes(e.id) && n.ids.length < a && (i = t, a = n.ids.length);
|
|
6001
6020
|
}
|
|
6002
|
-
let o = this.layerInfo[e.id]?.opacity ??
|
|
6021
|
+
let o = this.layerInfo[e.id]?.opacity ?? ur[e.type].defaultValue;
|
|
6003
6022
|
return i === void 0 ? r === void 0 ? void 0 : $(r, "fade", t) * o : $(i, "fade", t) * o;
|
|
6004
6023
|
}
|
|
6005
6024
|
setLayerOpacity(e, t) {
|
|
6006
|
-
let n = this.mcMap.map, r =
|
|
6025
|
+
let n = this.mcMap.map, r = ur[e.type];
|
|
6007
6026
|
for (let i of r.props) n.setPaintProperty(e.id, i, t);
|
|
6008
6027
|
}
|
|
6009
6028
|
resetLayerOpacity(e) {
|
|
6010
|
-
let t = this.mcMap.map, n =
|
|
6029
|
+
let t = this.mcMap.map, n = ur[e.type], r = this.layerInfo[e.id]?.opacity;
|
|
6011
6030
|
for (let i of n.props) t.setPaintProperty(e.id, i, r ?? e.paint?.[i] ?? n.defaultValue);
|
|
6012
6031
|
}
|
|
6013
|
-
},
|
|
6032
|
+
}, Gi = class extends n {
|
|
6014
6033
|
map;
|
|
6015
6034
|
format;
|
|
6016
6035
|
mapstyle;
|
|
@@ -6021,7 +6040,7 @@ var Vi = class {
|
|
|
6021
6040
|
image;
|
|
6022
6041
|
video;
|
|
6023
6042
|
constructor(e, t, n, r, i, a, o, s, c, l, u, d) {
|
|
6024
|
-
super(), this.map = e, this.format = t, this.mapstyle = o, this.svgCache = a, this.backgroundColor = l, this.vapiUrl = u, this.accessToken = d, this.image = new
|
|
6043
|
+
super(), this.map = e, this.format = t, this.mapstyle = o, this.svgCache = a, this.backgroundColor = l, this.vapiUrl = u, this.accessToken = d, this.image = new mi(this, t, a, l), n === "video" && (r.video?.keyframes ?? []).length > 0 && (this.video = new Wi(this, r, i, a, o, s, c, l));
|
|
6025
6044
|
}
|
|
6026
6045
|
play() {
|
|
6027
6046
|
this.video?.play();
|
|
@@ -6039,7 +6058,7 @@ var Vi = class {
|
|
|
6039
6058
|
return this.video?.preload() ?? Promise.resolve();
|
|
6040
6059
|
}
|
|
6041
6060
|
geoTiffMetadata(e) {
|
|
6042
|
-
return
|
|
6061
|
+
return fi(this.map, e);
|
|
6043
6062
|
}
|
|
6044
6063
|
svgExportOptions(e, t, n) {
|
|
6045
6064
|
return {
|
|
@@ -6057,7 +6076,7 @@ var Vi = class {
|
|
|
6057
6076
|
};
|
|
6058
6077
|
}
|
|
6059
6078
|
pdfExportOptions(e) {
|
|
6060
|
-
return
|
|
6079
|
+
return si(this.mapstyle, this.svgCache.fonts, {
|
|
6061
6080
|
vapiUrl: this.vapiUrl,
|
|
6062
6081
|
accessToken: this.accessToken,
|
|
6063
6082
|
apiUrl: e.href,
|
|
@@ -6066,14 +6085,14 @@ var Vi = class {
|
|
|
6066
6085
|
}
|
|
6067
6086
|
remove() {
|
|
6068
6087
|
let e = this.map.getContainer();
|
|
6069
|
-
|
|
6088
|
+
gr(this.map), this.video?.remove(), this.map.remove(), e.innerHTML = "", e.style.backgroundColor = "", e.classList.remove("mc-map"), e.classList.remove("mc-mode-web");
|
|
6070
6089
|
}
|
|
6071
6090
|
};
|
|
6072
6091
|
//#endregion
|
|
6073
6092
|
//#region src/initMap.ts
|
|
6074
|
-
async function
|
|
6075
|
-
let { accessToken: n, env: r = "production" } = t, a = r === "bleeding" ? "https://vapi.bleeding.mc-cdn.io" : r === "beta" ? "https://vapi.beta.mc-cdn.io" : "https://vapi.mc-cdn.io", o = r === "bleeding" ? "https://cdn.bleeding.mapcreator.io" : r === "beta" ? "https://cdn.beta.mapcreator.io" : "https://cdn.mapcreator.io", s = typeof t.job == "string" ? await
|
|
6076
|
-
await
|
|
6093
|
+
async function Ki(t) {
|
|
6094
|
+
let { accessToken: n, env: r = "production" } = t, a = r === "bleeding" ? "https://vapi.bleeding.mc-cdn.io" : r === "beta" ? "https://vapi.beta.mc-cdn.io" : "https://vapi.mc-cdn.io", o = r === "bleeding" ? "https://cdn.bleeding.mapcreator.io" : r === "beta" ? "https://cdn.beta.mapcreator.io" : "https://cdn.mapcreator.io", s = typeof t.job == "string" ? await qi(t.job, o, n) : t.job, c = s.export?.format ?? "png", l = pr[c] ?? "static";
|
|
6095
|
+
await Ji();
|
|
6077
6096
|
let u = {
|
|
6078
6097
|
container: t.container,
|
|
6079
6098
|
attributionControl: !1,
|
|
@@ -6087,9 +6106,9 @@ async function Ui(t) {
|
|
|
6087
6106
|
maxPitch: 85,
|
|
6088
6107
|
maxZoom: 22,
|
|
6089
6108
|
locale: {
|
|
6090
|
-
"CooperativeGesturesHandler.WindowsHelpText":
|
|
6091
|
-
"CooperativeGesturesHandler.MacHelpText":
|
|
6092
|
-
"CooperativeGesturesHandler.MobileHelpText":
|
|
6109
|
+
"CooperativeGesturesHandler.WindowsHelpText": Pn("windowsHelpText"),
|
|
6110
|
+
"CooperativeGesturesHandler.MacHelpText": Pn("macHelpText"),
|
|
6111
|
+
"CooperativeGesturesHandler.MobileHelpText": Pn("mobileHelpText")
|
|
6093
6112
|
},
|
|
6094
6113
|
maxCanvasSize: le(),
|
|
6095
6114
|
canvasContextAttributes: { preserveDrawingBuffer: t.preserveDrawingBuffer ?? !1 }
|
|
@@ -6097,7 +6116,7 @@ async function Ui(t) {
|
|
|
6097
6116
|
l === "video" && (u.maxTileCacheSize = Infinity, u.maxTileCacheZoomLevels = Infinity, u.refreshExpiredTiles = !1);
|
|
6098
6117
|
let d = new i(u), f = d.getContainer();
|
|
6099
6118
|
f.classList.add("mc-map"), l === "interactive" && f.classList.add("mc-mode-web");
|
|
6100
|
-
let p = l === "interactive" ? new
|
|
6119
|
+
let p = l === "interactive" ? new Yr(d, t.youTubePlaceholder ?? !1) : void 0, { map: { language: m, hideBasemap: h, detailLevel: g = 0, projection: _ = "mercator", terrain: v = !1, terrainExaggeration: y = 1 }, registry: b = {}, web: x, positionOffsets: S } = s, { models: C = {}, slots: w = {}, svgs: T = {} } = b, E = new et(d, await Oe(r, a, n), a, n);
|
|
6101
6120
|
d.resize();
|
|
6102
6121
|
let D = l === "video" ? s.video?.keyframes[0] : void 0, O = D?.pitch ?? s.map.pitch ?? 0, k = D?.bearing ?? s.map.rotation ?? 0, A = D?.zoom ?? s.map.zoom, j = D?.center === void 0 ? s.map.center : {
|
|
6103
6122
|
lng: D.center[0],
|
|
@@ -6108,7 +6127,7 @@ async function Ui(t) {
|
|
|
6108
6127
|
l === "interactive" ? (I = A - g + Math.log2(M), P = 1) : (I = A - g, P = M, d.on("resize", () => {
|
|
6109
6128
|
let e = me(s, f, l, c);
|
|
6110
6129
|
e !== d.getScale() && d.setScale(e);
|
|
6111
|
-
})), d.setScale(P), d.setZoom(I), d.setCenter(j), d.setDetailLevel(g), d.setMinZoom(g), d.addControl(new e({ compact: !1 })), await
|
|
6130
|
+
})), d.setScale(P), d.setZoom(I), d.setCenter(j), d.setDetailLevel(g), d.setMinZoom(g), d.addControl(new e({ compact: !1 })), await _r(s, S ?? cr, d, E, {
|
|
6112
6131
|
center: j,
|
|
6113
6132
|
zoom: I,
|
|
6114
6133
|
pitch: O,
|
|
@@ -6121,22 +6140,22 @@ async function Ui(t) {
|
|
|
6121
6140
|
sources: {},
|
|
6122
6141
|
layers: []
|
|
6123
6142
|
} : await fetch(`${a}/styles/${R}.json?access_token=${n}`).then((e) => e.json());
|
|
6124
|
-
|
|
6143
|
+
xr(z), d.setStyle(null), d.setStyle(z), await d.once("style.load"), Se(d, l), d.on("moveend", () => Se(d, l)), d.on("resize", () => Se(d, l)), d.on("attributionchange", () => Se(d, l)), N(m, d);
|
|
6125
6144
|
let B = s.map.overlays ?? [], V = s.meta?.layers ?? [];
|
|
6126
6145
|
B.length !== V.length && (B = [], V = []);
|
|
6127
|
-
let te = await
|
|
6128
|
-
|
|
6129
|
-
let re =
|
|
6130
|
-
|
|
6131
|
-
let ie =
|
|
6132
|
-
|
|
6133
|
-
let ae = new
|
|
6146
|
+
let te = await Ar(B, V, d, a, n, z.metadata?.styleOverride), ne = B.reduce((e, t, n) => e.set(t, te[n]), /* @__PURE__ */ new Map());
|
|
6147
|
+
ea(d, E, C, w, T, a, n, l), N(m, d), p?.setPublication(z.metadata?.publication), p?.setpopupElements(), p?.setHighlightManager(), d.setProjection({ type: _ === "globe" ? "globe" : "mercator" });
|
|
6148
|
+
let re = Yi(d, _);
|
|
6149
|
+
Xi(d, re), v && Zi(d, a, n, y);
|
|
6150
|
+
let ie = Qi(s.map.layerInfo, z, te);
|
|
6151
|
+
$i(d, ie, !h);
|
|
6152
|
+
let ae = new Gi(d, c, l, s, T, E, z, ne, ie, re, a, n);
|
|
6134
6153
|
return await E.settledImages(), ae;
|
|
6135
6154
|
}
|
|
6136
|
-
function
|
|
6155
|
+
function qi(e, t, n) {
|
|
6137
6156
|
return fetch(`${t}/jobs/${e}.json?access_token=${n}`).then((e) => e.json());
|
|
6138
6157
|
}
|
|
6139
|
-
function
|
|
6158
|
+
function Ji() {
|
|
6140
6159
|
return new Promise((e) => {
|
|
6141
6160
|
let t = () => {
|
|
6142
6161
|
window.innerWidth > 0 && window.innerHeight > 0 && (window.removeEventListener("resize", t), e());
|
|
@@ -6144,18 +6163,18 @@ function Gi() {
|
|
|
6144
6163
|
window.addEventListener("resize", t), t();
|
|
6145
6164
|
});
|
|
6146
6165
|
}
|
|
6147
|
-
function
|
|
6166
|
+
function Yi(e, t) {
|
|
6148
6167
|
let n = e.getStyle().metadata ?? {}, r = n["mc:background-color"] ?? "#f8f8f8", i = n["mc:background-color-globe"] ?? "#000000";
|
|
6149
6168
|
return t === "globe" ? i : r;
|
|
6150
6169
|
}
|
|
6151
|
-
function
|
|
6152
|
-
e.getContainer().style.backgroundColor = t, e.setSky(e.getStyle().sky ??
|
|
6170
|
+
function Xi(e, t) {
|
|
6171
|
+
e.getContainer().style.backgroundColor = t, e.setSky(e.getStyle().sky ?? sr), e.setLight({ position: [
|
|
6153
6172
|
1.15,
|
|
6154
6173
|
210,
|
|
6155
6174
|
45
|
|
6156
6175
|
] });
|
|
6157
6176
|
}
|
|
6158
|
-
function
|
|
6177
|
+
function Zi(e, t, n, r) {
|
|
6159
6178
|
e.addSource("mc-dem", {
|
|
6160
6179
|
type: "raster-dem",
|
|
6161
6180
|
tiles: [`${t}/dataset/jaxa_terrainrgb/{z}/{x}/{y}?access_token=${n}`],
|
|
@@ -6167,7 +6186,7 @@ function Ji(e, t, n, r) {
|
|
|
6167
6186
|
exaggeration: r
|
|
6168
6187
|
});
|
|
6169
6188
|
}
|
|
6170
|
-
function
|
|
6189
|
+
function Qi(e, t, n) {
|
|
6171
6190
|
let r = e?.reduce((e, t) => (e[t.id] = {
|
|
6172
6191
|
visibility: t.visibility,
|
|
6173
6192
|
...t.opacity !== void 0 && { opacity: t.opacity }
|
|
@@ -6176,53 +6195,53 @@ function Yi(e, t, n) {
|
|
|
6176
6195
|
for (let e of n) for (let t of e.layers) i[t.id] = r[t.id] ?? { visibility: !1 };
|
|
6177
6196
|
return i;
|
|
6178
6197
|
}
|
|
6179
|
-
function
|
|
6198
|
+
function $i(e, t, n) {
|
|
6180
6199
|
for (let r in t) {
|
|
6181
6200
|
let i = e.getLayer(r);
|
|
6182
6201
|
if (i !== void 0) {
|
|
6183
6202
|
let a = t[r];
|
|
6184
6203
|
if (e.setLayoutProperty(r, "visibility", a.visibility && n ? "visible" : "none"), a.opacity !== void 0) {
|
|
6185
|
-
let t =
|
|
6204
|
+
let t = ur[i.type];
|
|
6186
6205
|
for (let n of t.props) e.setPaintProperty(r, n, a.opacity);
|
|
6187
6206
|
}
|
|
6188
6207
|
}
|
|
6189
6208
|
}
|
|
6190
6209
|
}
|
|
6191
|
-
function
|
|
6210
|
+
function ea(e, t, n, r, i, a, o, s) {
|
|
6192
6211
|
let { beforeNone: c = [], beforeNames: l = [], beforeBoundaries: u = [], beforeWaters: d = [] } = r;
|
|
6193
6212
|
c.forEach((r) => {
|
|
6194
|
-
|
|
6213
|
+
ta(e, t, n, r, i, "mc-before-none", a, o, s);
|
|
6195
6214
|
}), l.forEach((r) => {
|
|
6196
|
-
|
|
6215
|
+
ta(e, t, n, r, i, "mc-before-names", a, o, s);
|
|
6197
6216
|
}), u.forEach((r) => {
|
|
6198
|
-
|
|
6217
|
+
ta(e, t, n, r, i, "mc-before-boundaries", a, o, s);
|
|
6199
6218
|
}), d.forEach((r) => {
|
|
6200
|
-
|
|
6219
|
+
ta(e, t, n, r, i, "mc-before-waters", a, o, s);
|
|
6201
6220
|
});
|
|
6202
6221
|
}
|
|
6203
|
-
function
|
|
6222
|
+
function ta(e, t, n, r, i, a, o, s, c) {
|
|
6204
6223
|
if (r.type === "marker") {
|
|
6205
6224
|
let o = n.marker?.find((e) => e.id === r.groupId);
|
|
6206
|
-
o &&
|
|
6225
|
+
o && Dr(e, o, a, i, t, c);
|
|
6207
6226
|
} else if (r.type === "polygon") {
|
|
6208
6227
|
let o = n.polygon?.find((e) => e.id === r.groupId);
|
|
6209
|
-
o &&
|
|
6228
|
+
o && Sr(e, o, a, i, t);
|
|
6210
6229
|
} else if (r.type === "circle") {
|
|
6211
6230
|
let o = n.circle?.find((e) => e.id === r.groupId);
|
|
6212
|
-
o &&
|
|
6231
|
+
o && wr(e, o, a, i, t);
|
|
6213
6232
|
} else if (r.type === "line") {
|
|
6214
6233
|
let i = n.line?.find((e) => e.id === r.groupId);
|
|
6215
|
-
i &&
|
|
6234
|
+
i && ei(e, i, a, t, c);
|
|
6216
6235
|
} else if (r.type === "dot") {
|
|
6217
6236
|
let t = n.dot?.find((e) => e.id === r.groupId);
|
|
6218
|
-
t &&
|
|
6237
|
+
t && ii(e, t, a);
|
|
6219
6238
|
} else if (r.type === "area") {
|
|
6220
6239
|
let c = n.area?.find((e) => e.id === r.groupId);
|
|
6221
|
-
c &&
|
|
6240
|
+
c && ri(e, c, a, i, t, o, s);
|
|
6222
6241
|
}
|
|
6223
6242
|
}
|
|
6224
6243
|
//#endregion
|
|
6225
6244
|
//#region src/index.bundler.ts
|
|
6226
6245
|
c() || l(new URL("./mapcreator-sdk-worker.mjs",import.meta.url).href);
|
|
6227
6246
|
//#endregion
|
|
6228
|
-
export {
|
|
6247
|
+
export { Ki as initMap };
|