vue3-google-map 0.25.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -1
- package/dist/index.cjs +3 -3
- package/dist/index.mjs +873 -709
- package/dist/index.umd.js +4 -4
- package/dist/types/components/DebouncedMarkerClusterer.d.ts +20 -0
- package/dist/types/components/MarkerCluster.d.ts +12 -2
- package/package.json +4 -2
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode(".mapdiv[data-v-c63ff230]{width:100%;height:100%}.advanced-marker-wrapper{display:none}.mapdiv .advanced-marker-wrapper{display:inline-block}.custom-control-wrapper[data-v-ab9120cd]{display:none}.mapdiv .custom-control-wrapper[data-v-ab9120cd]{display:inline-block}.info-window-wrapper[data-v-
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
import { defineComponent as
|
|
6
|
-
const
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode(".mapdiv[data-v-c63ff230]{width:100%;height:100%}.advanced-marker-wrapper{display:none}.mapdiv .advanced-marker-wrapper{display:inline-block}.custom-control-wrapper[data-v-ab9120cd]{display:none}.mapdiv .custom-control-wrapper[data-v-ab9120cd]{display:inline-block}.info-window-wrapper[data-v-d182c1f9]{display:none}.mapdiv .info-window-wrapper[data-v-d182c1f9]{display:inline-block}.custom-marker-wrapper[data-v-2d2d343a]{display:none}.mapdiv .custom-marker-wrapper[data-v-2d2d343a]{display:inline-block}")),document.head.appendChild(a)}}catch(d){console.error("vite-plugin-css-injected-by-js",d)}})();
|
|
2
|
+
var pt = Object.defineProperty;
|
|
3
|
+
var ft = (t, e, r) => e in t ? pt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
4
|
+
var se = (t, e, r) => (ft(t, typeof e != "symbol" ? e + "" : e, r), r);
|
|
5
|
+
import { defineComponent as T, ref as _, provide as U, watch as S, onMounted as tt, onBeforeUnmount as B, markRaw as A, toRef as R, openBlock as F, createElementBlock as V, createElementVNode as ce, renderSlot as z, normalizeProps as mt, guardReactiveProps as ht, computed as W, Comment as we, inject as C, Fragment as gt, mergeProps as ke, createCommentVNode as be } from "vue";
|
|
6
|
+
const D = Symbol("map"), Z = Symbol("api"), Ce = Symbol("marker"), Oe = Symbol("markerCluster"), de = Symbol("CustomMarker"), rt = Symbol("mapTilesLoaded"), H = [
|
|
7
7
|
"click",
|
|
8
8
|
"dblclick",
|
|
9
9
|
"drag",
|
|
@@ -16,55 +16,55 @@ const B = Symbol("map"), D = Symbol("api"), Ee = Symbol("marker"), we = Symbol("
|
|
|
16
16
|
"mouseup",
|
|
17
17
|
"rightclick"
|
|
18
18
|
];
|
|
19
|
-
function
|
|
20
|
-
|
|
19
|
+
function vt(t, e) {
|
|
20
|
+
t.src = e;
|
|
21
21
|
}
|
|
22
|
-
const
|
|
23
|
-
var e,
|
|
22
|
+
const yt = (t) => {
|
|
23
|
+
var e, r, n, s = "The Google Maps JavaScript API", o = "google", i = "importLibrary", l = "__ib__", a = document, c = window, p = c[o] || (c[o] = {}), u = p.maps || (p.maps = {}), f = /* @__PURE__ */ new Set(), m = new URLSearchParams(), h = () => e || (e = new Promise(async (d, g) => {
|
|
24
24
|
var v;
|
|
25
|
-
await (
|
|
26
|
-
for (n in
|
|
27
|
-
m.set(n.replace(/[A-Z]/g, (
|
|
28
|
-
m.set("callback", o + ".maps." + l),
|
|
25
|
+
await (r = a.createElement("script")), m.set("libraries", [...f] + "");
|
|
26
|
+
for (n in t)
|
|
27
|
+
m.set(n.replace(/[A-Z]/g, (y) => "_" + y[0].toLowerCase()), t[n]);
|
|
28
|
+
m.set("callback", o + ".maps." + l), vt(r, "https://maps.googleapis.com/maps/api/js?" + m), u[l] = d, r.onerror = () => e = g(Error(s + " could not load.")), r.nonce = ((v = a.querySelector("script[nonce]")) == null ? void 0 : v.nonce) || "", a.head.append(r);
|
|
29
29
|
}));
|
|
30
|
-
u[i] ? console.warn(s + " only loads once. Ignoring:",
|
|
31
|
-
},
|
|
32
|
-
console.warn(`[@googlemaps/js-api-loader] ${
|
|
30
|
+
u[i] ? console.warn(s + " only loads once. Ignoring:", t) : u[i] = (d, ...g) => f.add(d) && h().then(() => u[i](d, ...g));
|
|
31
|
+
}, _t = (t) => `The setOptions() function should only be called once. The options passed to the additional call (${JSON.stringify(t)}) will be ignored.`, Et = (t) => `The google.maps.importLibrary() function is already defined, and @googlemaps/js-api-loader will use the existing function instead of overwriting it. The options passed to setOptions (${JSON.stringify(t)}) will be ignored.`, wt = "No options were set before calling importLibrary. Make sure to configure the loader using setOptions().", kt = "There already is a script loading the Google Maps JavaScript API, and no google.maps.importLibrary function is defined. @googlemaps/js-api-loader will proceed to bootstrap the API with the specified options, but the existing script might cause problems using the API. Make sure to remove the script loading the API.", Me = process.env.NODE_ENV !== "production" ? (t) => {
|
|
32
|
+
console.warn(`[@googlemaps/js-api-loader] ${t}`);
|
|
33
33
|
} : () => {
|
|
34
|
-
},
|
|
35
|
-
console.info(`[@googlemaps/js-api-loader] ${
|
|
34
|
+
}, bt = process.env.NODE_ENV !== "production" ? (t) => {
|
|
35
|
+
console.info(`[@googlemaps/js-api-loader] ${t}`);
|
|
36
36
|
} : () => {
|
|
37
37
|
};
|
|
38
|
-
let
|
|
39
|
-
function
|
|
40
|
-
if (
|
|
41
|
-
|
|
38
|
+
let ye = !1;
|
|
39
|
+
function Ct(t) {
|
|
40
|
+
if (ye) {
|
|
41
|
+
Me(_t(t));
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
|
-
|
|
44
|
+
Mt(t), ye = !0;
|
|
45
45
|
}
|
|
46
|
-
async function
|
|
47
|
-
var e,
|
|
48
|
-
if (
|
|
46
|
+
async function Ot(t) {
|
|
47
|
+
var e, r;
|
|
48
|
+
if (ye || Me(wt), !((r = (e = window == null ? void 0 : window.google) == null ? void 0 : e.maps) != null && r.importLibrary))
|
|
49
49
|
throw new Error("google.maps.importLibrary is not installed.");
|
|
50
|
-
return await google.maps.importLibrary(
|
|
50
|
+
return await google.maps.importLibrary(t);
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
var
|
|
54
|
-
const e = !!((n = (
|
|
55
|
-
e ?
|
|
52
|
+
function Mt(t) {
|
|
53
|
+
var r, n;
|
|
54
|
+
const e = !!((n = (r = window.google) == null ? void 0 : r.maps) != null && n.importLibrary);
|
|
55
|
+
e ? bt(Et(t)) : process.env.NODE_ENV !== "production" && document.querySelector('script[src*="maps.googleapis.com/maps/api/js"]') && Me(kt), e || yt(t);
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
return class extends
|
|
57
|
+
function St(t) {
|
|
58
|
+
return class extends t.OverlayView {
|
|
59
59
|
constructor(n) {
|
|
60
60
|
super();
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
se(this, "element");
|
|
62
|
+
se(this, "opts");
|
|
63
63
|
const { element: s, ...o } = n;
|
|
64
64
|
this.element = s, this.opts = o, this.opts.map && this.setMap(this.opts.map);
|
|
65
65
|
}
|
|
66
66
|
getPosition() {
|
|
67
|
-
return this.opts.position ? this.opts.position instanceof
|
|
67
|
+
return this.opts.position ? this.opts.position instanceof t.LatLng ? this.opts.position : new t.LatLng(this.opts.position) : null;
|
|
68
68
|
}
|
|
69
69
|
getVisible() {
|
|
70
70
|
if (!this.element)
|
|
@@ -126,8 +126,8 @@ function yt(r) {
|
|
|
126
126
|
}
|
|
127
127
|
};
|
|
128
128
|
}
|
|
129
|
-
let
|
|
130
|
-
const
|
|
129
|
+
let Ae = !1;
|
|
130
|
+
const qe = [
|
|
131
131
|
"bounds_changed",
|
|
132
132
|
"center_changed",
|
|
133
133
|
"click",
|
|
@@ -150,7 +150,7 @@ const be = [
|
|
|
150
150
|
"tilesloaded",
|
|
151
151
|
"tilt_changed",
|
|
152
152
|
"zoom_changed"
|
|
153
|
-
],
|
|
153
|
+
], Tt = T({
|
|
154
154
|
props: {
|
|
155
155
|
apiPromise: {
|
|
156
156
|
type: Promise
|
|
@@ -356,30 +356,30 @@ const be = [
|
|
|
356
356
|
required: !1
|
|
357
357
|
}
|
|
358
358
|
},
|
|
359
|
-
emits:
|
|
360
|
-
setup(
|
|
361
|
-
const
|
|
362
|
-
U(
|
|
359
|
+
emits: qe,
|
|
360
|
+
setup(t, { emit: e }) {
|
|
361
|
+
const r = _(), n = _(!1), s = _(), o = _(), i = _(!1);
|
|
362
|
+
U(D, s), U(Z, o), U(rt, i);
|
|
363
363
|
const l = () => {
|
|
364
|
-
const u = { ...
|
|
365
|
-
Object.keys(u).forEach((
|
|
366
|
-
u[
|
|
364
|
+
const u = { ...t };
|
|
365
|
+
Object.keys(u).forEach((d) => {
|
|
366
|
+
u[d] === void 0 && delete u[d];
|
|
367
367
|
});
|
|
368
|
-
const m = (
|
|
368
|
+
const m = (d) => {
|
|
369
369
|
var g;
|
|
370
|
-
return
|
|
370
|
+
return d ? { position: (g = o.value) == null ? void 0 : g.ControlPosition[d] } : {};
|
|
371
371
|
}, h = {
|
|
372
|
-
scaleControlOptions:
|
|
373
|
-
panControlOptions: m(
|
|
374
|
-
zoomControlOptions: m(
|
|
375
|
-
rotateControlOptions: m(
|
|
376
|
-
streetViewControlOptions: m(
|
|
377
|
-
fullscreenControlOptions: m(
|
|
378
|
-
cameraControlOptions: m(
|
|
379
|
-
disableDefaultUI:
|
|
372
|
+
scaleControlOptions: t.scaleControlStyle ? { style: t.scaleControlStyle } : {},
|
|
373
|
+
panControlOptions: m(t.panControlPosition),
|
|
374
|
+
zoomControlOptions: m(t.zoomControlPosition),
|
|
375
|
+
rotateControlOptions: m(t.rotateControlPosition),
|
|
376
|
+
streetViewControlOptions: m(t.streetViewControlPosition),
|
|
377
|
+
fullscreenControlOptions: m(t.fullscreenControlPosition),
|
|
378
|
+
cameraControlOptions: m(t.cameraControlPosition),
|
|
379
|
+
disableDefaultUI: t.disableDefaultUi
|
|
380
380
|
};
|
|
381
381
|
return { ...u, ...h };
|
|
382
|
-
}, a =
|
|
382
|
+
}, a = S(
|
|
383
383
|
[o, s],
|
|
384
384
|
([u, f]) => {
|
|
385
385
|
const m = u, h = f;
|
|
@@ -389,99 +389,99 @@ const be = [
|
|
|
389
389
|
},
|
|
390
390
|
{ immediate: !0 }
|
|
391
391
|
), c = () => {
|
|
392
|
-
const { apiKey: u, region: f, version: m, language: h, libraries:
|
|
393
|
-
|
|
394
|
-
},
|
|
392
|
+
const { apiKey: u, region: f, version: m, language: h, libraries: d } = t;
|
|
393
|
+
Ct({ key: u, region: f, v: m, language: h, libraries: d });
|
|
394
|
+
}, p = (u) => {
|
|
395
395
|
const f = u ? u.maps : google.maps;
|
|
396
|
-
o.value =
|
|
397
|
-
const m =
|
|
398
|
-
o.value[
|
|
396
|
+
o.value = A(f), s.value = A(new f.Map(r.value, l()));
|
|
397
|
+
const m = St(o.value);
|
|
398
|
+
o.value[de] = m, qe.forEach((d) => {
|
|
399
399
|
var g;
|
|
400
|
-
(g = s.value) == null || g.addListener(
|
|
400
|
+
(g = s.value) == null || g.addListener(d, (v) => e(d, v));
|
|
401
401
|
}), n.value = !0;
|
|
402
|
-
const h = Object.keys(
|
|
403
|
-
(
|
|
404
|
-
).map((
|
|
405
|
-
|
|
406
|
-
[() =>
|
|
407
|
-
([
|
|
408
|
-
var
|
|
409
|
-
const { center:
|
|
410
|
-
(
|
|
411
|
-
const
|
|
412
|
-
|
|
402
|
+
const h = Object.keys(t).filter(
|
|
403
|
+
(d) => !["apiPromise", "apiKey", "version", "libraries", "region", "language", "center", "zoom"].includes(d)
|
|
404
|
+
).map((d) => R(t, d));
|
|
405
|
+
S(
|
|
406
|
+
[() => t.center, () => t.zoom, ...h],
|
|
407
|
+
([d, g], [v, y]) => {
|
|
408
|
+
var k, M, L;
|
|
409
|
+
const { center: w, zoom: P, ...O } = l();
|
|
410
|
+
(k = s.value) == null || k.setOptions(O), g !== void 0 && g !== y && ((M = s.value) == null || M.setZoom(g));
|
|
411
|
+
const E = !v || d.lng !== v.lng || d.lat !== v.lat;
|
|
412
|
+
d && E && ((L = s.value) == null || L.panTo(d));
|
|
413
413
|
}
|
|
414
414
|
);
|
|
415
415
|
};
|
|
416
|
-
return
|
|
417
|
-
if (
|
|
418
|
-
|
|
416
|
+
return tt(() => {
|
|
417
|
+
if (t.apiPromise && t.apiPromise instanceof Promise)
|
|
418
|
+
t.apiPromise.then(p);
|
|
419
419
|
else {
|
|
420
|
-
|
|
421
|
-
const u =
|
|
422
|
-
Promise.all(u.map((f) =>
|
|
420
|
+
Ae || (c(), Ae = !0);
|
|
421
|
+
const u = t.libraries && t.libraries.length > 0 ? t.libraries : ["maps", "marker"];
|
|
422
|
+
Promise.all(u.map((f) => Ot(f))).then(() => p());
|
|
423
423
|
}
|
|
424
|
-
}),
|
|
424
|
+
}), B(() => {
|
|
425
425
|
var u;
|
|
426
426
|
i.value = !1, s.value && ((u = o.value) == null || u.event.clearInstanceListeners(s.value));
|
|
427
|
-
}), { mapRef:
|
|
427
|
+
}), { mapRef: r, ready: n, map: s, api: o, mapTilesLoaded: i };
|
|
428
428
|
}
|
|
429
429
|
});
|
|
430
|
-
const
|
|
431
|
-
const
|
|
430
|
+
const re = (t, e) => {
|
|
431
|
+
const r = t.__vccOpts || t;
|
|
432
432
|
for (const [n, s] of e)
|
|
433
|
-
|
|
434
|
-
return
|
|
435
|
-
},
|
|
433
|
+
r[n] = s;
|
|
434
|
+
return r;
|
|
435
|
+
}, Pt = {
|
|
436
436
|
ref: "mapRef",
|
|
437
437
|
class: "mapdiv"
|
|
438
438
|
};
|
|
439
|
-
function
|
|
440
|
-
return
|
|
441
|
-
|
|
442
|
-
|
|
439
|
+
function At(t, e, r, n, s, o) {
|
|
440
|
+
return F(), V("div", null, [
|
|
441
|
+
ce("div", Pt, null, 512),
|
|
442
|
+
z(t.$slots, "default", mt(ht({ ready: t.ready, map: t.map, api: t.api, mapTilesLoaded: t.mapTilesLoaded })), void 0, !0)
|
|
443
443
|
]);
|
|
444
444
|
}
|
|
445
|
-
const
|
|
446
|
-
function
|
|
447
|
-
return
|
|
445
|
+
const bn = /* @__PURE__ */ re(Tt, [["render", At], ["__scopeId", "data-v-c63ff230"]]);
|
|
446
|
+
function qt(t) {
|
|
447
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
448
448
|
}
|
|
449
|
-
var
|
|
450
|
-
if (e ===
|
|
449
|
+
var Lt = function t(e, r) {
|
|
450
|
+
if (e === r)
|
|
451
451
|
return !0;
|
|
452
|
-
if (e &&
|
|
453
|
-
if (e.constructor !==
|
|
452
|
+
if (e && r && typeof e == "object" && typeof r == "object") {
|
|
453
|
+
if (e.constructor !== r.constructor)
|
|
454
454
|
return !1;
|
|
455
455
|
var n, s, o;
|
|
456
456
|
if (Array.isArray(e)) {
|
|
457
|
-
if (n = e.length, n !=
|
|
457
|
+
if (n = e.length, n != r.length)
|
|
458
458
|
return !1;
|
|
459
459
|
for (s = n; s-- !== 0; )
|
|
460
|
-
if (!
|
|
460
|
+
if (!t(e[s], r[s]))
|
|
461
461
|
return !1;
|
|
462
462
|
return !0;
|
|
463
463
|
}
|
|
464
464
|
if (e.constructor === RegExp)
|
|
465
|
-
return e.source ===
|
|
465
|
+
return e.source === r.source && e.flags === r.flags;
|
|
466
466
|
if (e.valueOf !== Object.prototype.valueOf)
|
|
467
|
-
return e.valueOf() ===
|
|
467
|
+
return e.valueOf() === r.valueOf();
|
|
468
468
|
if (e.toString !== Object.prototype.toString)
|
|
469
|
-
return e.toString() ===
|
|
470
|
-
if (o = Object.keys(e), n = o.length, n !== Object.keys(
|
|
469
|
+
return e.toString() === r.toString();
|
|
470
|
+
if (o = Object.keys(e), n = o.length, n !== Object.keys(r).length)
|
|
471
471
|
return !1;
|
|
472
472
|
for (s = n; s-- !== 0; )
|
|
473
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
473
|
+
if (!Object.prototype.hasOwnProperty.call(r, o[s]))
|
|
474
474
|
return !1;
|
|
475
475
|
for (s = n; s-- !== 0; ) {
|
|
476
476
|
var i = o[s];
|
|
477
|
-
if (!
|
|
477
|
+
if (!t(e[i], r[i]))
|
|
478
478
|
return !1;
|
|
479
479
|
}
|
|
480
480
|
return !0;
|
|
481
481
|
}
|
|
482
|
-
return e !== e &&
|
|
482
|
+
return e !== e && r !== r;
|
|
483
483
|
};
|
|
484
|
-
const
|
|
484
|
+
const ee = /* @__PURE__ */ qt(Lt), Le = ["click", "drag", "dragend", "dragstart", "gmp-click"], xt = T({
|
|
485
485
|
name: "AdvancedMarker",
|
|
486
486
|
props: {
|
|
487
487
|
options: {
|
|
@@ -493,32 +493,32 @@ const Q = /* @__PURE__ */ kt(Ct), Se = ["click", "drag", "dragend", "dragstart",
|
|
|
493
493
|
required: !1
|
|
494
494
|
}
|
|
495
495
|
},
|
|
496
|
-
emits:
|
|
497
|
-
setup(
|
|
498
|
-
const s =
|
|
496
|
+
emits: Le,
|
|
497
|
+
setup(t, { emit: e, expose: r, slots: n }) {
|
|
498
|
+
const s = _(), o = W(() => {
|
|
499
499
|
var m;
|
|
500
|
-
return (m = n.content) == null ? void 0 : m.call(n).some((h) => h.type !==
|
|
501
|
-
}), i = R(
|
|
502
|
-
() => !!(u.value &&
|
|
500
|
+
return (m = n.content) == null ? void 0 : m.call(n).some((h) => h.type !== we);
|
|
501
|
+
}), i = R(t, "options"), l = R(t, "pinOptions"), a = _(), c = C(D, _()), p = C(Z, _()), u = C(Oe, _()), f = W(
|
|
502
|
+
() => !!(u.value && p.value && a.value instanceof google.maps.marker.AdvancedMarkerElement)
|
|
503
503
|
);
|
|
504
|
-
return
|
|
504
|
+
return S(
|
|
505
505
|
[c, i, l, s],
|
|
506
|
-
async (m, [h,
|
|
507
|
-
var
|
|
508
|
-
const
|
|
509
|
-
if (!c.value || !
|
|
506
|
+
async (m, [h, d, g, v]) => {
|
|
507
|
+
var k, M, L;
|
|
508
|
+
const y = !ee(i.value, d) || !ee(l.value, g), w = s.value !== v, P = y || w || c.value !== h;
|
|
509
|
+
if (!c.value || !p.value || !P || o.value && !s.value)
|
|
510
510
|
return;
|
|
511
|
-
const { AdvancedMarkerElement:
|
|
511
|
+
const { AdvancedMarkerElement: O, PinElement: E } = p.value.marker;
|
|
512
512
|
if (a.value) {
|
|
513
|
-
const { map:
|
|
513
|
+
const { map: pe, content: ne, ...fe } = i.value;
|
|
514
514
|
Object.assign(a.value, {
|
|
515
|
-
content: o.value ? s.value : l.value ? new
|
|
516
|
-
...
|
|
517
|
-
}), f.value && ((
|
|
515
|
+
content: o.value ? s.value : l.value ? new E(l.value).element : ne,
|
|
516
|
+
...fe
|
|
517
|
+
}), f.value && ((k = u.value) == null || k.removeMarker(a.value), (M = u.value) == null || M.addMarker(a.value));
|
|
518
518
|
} else
|
|
519
|
-
o.value ? i.value.content = s.value : l.value && (i.value.content = new
|
|
520
|
-
var
|
|
521
|
-
(
|
|
519
|
+
o.value ? i.value.content = s.value : l.value && (i.value.content = new E(l.value).element), a.value = A(new O(i.value)), f.value ? (L = u.value) == null || L.addMarker(a.value) : a.value.map = c.value, Le.forEach((pe) => {
|
|
520
|
+
var ne;
|
|
521
|
+
(ne = a.value) == null || ne.addListener(pe, (fe) => e(pe, fe));
|
|
522
522
|
});
|
|
523
523
|
},
|
|
524
524
|
{
|
|
@@ -526,56 +526,56 @@ const Q = /* @__PURE__ */ kt(Ct), Se = ["click", "drag", "dragend", "dragstart",
|
|
|
526
526
|
flush: "post"
|
|
527
527
|
// Ensure DOM updates happen before this watcher runs
|
|
528
528
|
}
|
|
529
|
-
),
|
|
529
|
+
), B(() => {
|
|
530
530
|
var m, h;
|
|
531
|
-
a.value && ((m =
|
|
532
|
-
}), U(
|
|
531
|
+
a.value && ((m = p.value) == null || m.event.clearInstanceListeners(a.value), f.value ? (h = u.value) == null || h.removeMarker(a.value) : a.value.map = null);
|
|
532
|
+
}), U(Ce, a), r({ marker: a }), { hasCustomSlotContent: o, markerRef: s };
|
|
533
533
|
}
|
|
534
534
|
});
|
|
535
|
-
const
|
|
535
|
+
const jt = {
|
|
536
536
|
key: 0,
|
|
537
537
|
class: "advanced-marker-wrapper"
|
|
538
538
|
};
|
|
539
|
-
function
|
|
540
|
-
return
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
539
|
+
function It(t, e, r, n, s, o) {
|
|
540
|
+
return F(), V(gt, null, [
|
|
541
|
+
t.hasCustomSlotContent ? (F(), V("div", jt, [
|
|
542
|
+
ce("div", ke({ ref: "markerRef" }, t.$attrs), [
|
|
543
|
+
z(t.$slots, "content")
|
|
544
544
|
], 16)
|
|
545
|
-
])) :
|
|
546
|
-
|
|
545
|
+
])) : be("", !0),
|
|
546
|
+
z(t.$slots, "default")
|
|
547
547
|
], 64);
|
|
548
548
|
}
|
|
549
|
-
const
|
|
550
|
-
const s =
|
|
551
|
-
() => !!(l.value && i.value && (s.value instanceof i.value.Marker || s.value instanceof i.value[
|
|
549
|
+
const Cn = /* @__PURE__ */ re(xt, [["render", It]]), xe = (t) => t === "Marker", je = (t) => t === de, K = (t, e, r, n) => {
|
|
550
|
+
const s = _(), o = C(D, _()), i = C(Z, _()), l = C(Oe, _()), a = W(
|
|
551
|
+
() => !!(l.value && i.value && (s.value instanceof i.value.Marker || s.value instanceof i.value[de]))
|
|
552
552
|
);
|
|
553
|
-
return
|
|
554
|
-
[o,
|
|
555
|
-
(c, [
|
|
556
|
-
var m, h,
|
|
557
|
-
const f = !
|
|
553
|
+
return S(
|
|
554
|
+
[o, r],
|
|
555
|
+
(c, [p, u]) => {
|
|
556
|
+
var m, h, d;
|
|
557
|
+
const f = !ee(r.value, u) || o.value !== p;
|
|
558
558
|
if (!(!o.value || !i.value || !f))
|
|
559
559
|
if (s.value)
|
|
560
|
-
s.value.setOptions(
|
|
560
|
+
s.value.setOptions(r.value), a.value && ((m = l.value) == null || m.removeMarker(s.value), (h = l.value) == null || h.addMarker(s.value));
|
|
561
561
|
else {
|
|
562
|
-
if (
|
|
563
|
-
s.value =
|
|
564
|
-
new i.value[
|
|
562
|
+
if (xe(t))
|
|
563
|
+
s.value = A(
|
|
564
|
+
new i.value[t](r.value)
|
|
565
565
|
);
|
|
566
|
-
else if (
|
|
567
|
-
const g =
|
|
568
|
-
g.element && (s.value =
|
|
566
|
+
else if (je(t)) {
|
|
567
|
+
const g = r.value;
|
|
568
|
+
g.element && (s.value = A(new i.value[t](g)));
|
|
569
569
|
} else
|
|
570
|
-
s.value =
|
|
571
|
-
new i.value[
|
|
572
|
-
...
|
|
570
|
+
s.value = A(
|
|
571
|
+
new i.value[t]({
|
|
572
|
+
...r.value,
|
|
573
573
|
map: o.value
|
|
574
574
|
})
|
|
575
575
|
);
|
|
576
|
-
s.value && (a.value ? (
|
|
576
|
+
s.value && (a.value ? (d = l.value) == null || d.addMarker(s.value) : (xe(t) || je(t)) && s.value.setMap(o.value)), e.forEach((g) => {
|
|
577
577
|
var v;
|
|
578
|
-
(v = s.value) == null || v.addListener(g, (
|
|
578
|
+
(v = s.value) == null || v.addListener(g, (y) => n(g, y));
|
|
579
579
|
});
|
|
580
580
|
}
|
|
581
581
|
},
|
|
@@ -583,11 +583,11 @@ const Nr = /* @__PURE__ */ te(Ot, [["render", Pt]]), Ae = (r) => r === "Marker",
|
|
|
583
583
|
immediate: !0,
|
|
584
584
|
flush: "post"
|
|
585
585
|
}
|
|
586
|
-
),
|
|
587
|
-
var c,
|
|
588
|
-
s.value && ((c = i.value) == null || c.event.clearInstanceListeners(s.value), a.value ? (
|
|
586
|
+
), B(() => {
|
|
587
|
+
var c, p;
|
|
588
|
+
s.value && ((c = i.value) == null || c.event.clearInstanceListeners(s.value), a.value ? (p = l.value) == null || p.removeMarker(s.value) : s.value.setMap(null));
|
|
589
589
|
}), s;
|
|
590
|
-
},
|
|
590
|
+
}, Ie = [
|
|
591
591
|
"animation_changed",
|
|
592
592
|
"click",
|
|
593
593
|
"dblclick",
|
|
@@ -610,7 +610,7 @@ const Nr = /* @__PURE__ */ te(Ot, [["render", Pt]]), Ae = (r) => r === "Marker",
|
|
|
610
610
|
"shape_changed",
|
|
611
611
|
"title_changed",
|
|
612
612
|
"visible_changed"
|
|
613
|
-
],
|
|
613
|
+
], On = T({
|
|
614
614
|
name: "Marker",
|
|
615
615
|
props: {
|
|
616
616
|
options: {
|
|
@@ -618,15 +618,15 @@ const Nr = /* @__PURE__ */ te(Ot, [["render", Pt]]), Ae = (r) => r === "Marker",
|
|
|
618
618
|
required: !0
|
|
619
619
|
}
|
|
620
620
|
},
|
|
621
|
-
emits:
|
|
622
|
-
setup(
|
|
623
|
-
const s = R(
|
|
624
|
-
return U(
|
|
621
|
+
emits: Ie,
|
|
622
|
+
setup(t, { emit: e, expose: r, slots: n }) {
|
|
623
|
+
const s = R(t, "options"), o = K("Marker", Ie, s, e);
|
|
624
|
+
return U(Ce, o), r({ marker: o }), () => {
|
|
625
625
|
var i;
|
|
626
626
|
return (i = n.default) == null ? void 0 : i.call(n);
|
|
627
627
|
};
|
|
628
628
|
}
|
|
629
|
-
}),
|
|
629
|
+
}), Mn = T({
|
|
630
630
|
name: "Polyline",
|
|
631
631
|
props: {
|
|
632
632
|
options: {
|
|
@@ -634,13 +634,13 @@ const Nr = /* @__PURE__ */ te(Ot, [["render", Pt]]), Ae = (r) => r === "Marker",
|
|
|
634
634
|
required: !0
|
|
635
635
|
}
|
|
636
636
|
},
|
|
637
|
-
emits:
|
|
638
|
-
setup(
|
|
639
|
-
const
|
|
640
|
-
return { polyline:
|
|
637
|
+
emits: H,
|
|
638
|
+
setup(t, { emit: e }) {
|
|
639
|
+
const r = R(t, "options");
|
|
640
|
+
return { polyline: K("Polyline", H, r, e) };
|
|
641
641
|
},
|
|
642
642
|
render: () => null
|
|
643
|
-
}),
|
|
643
|
+
}), Sn = T({
|
|
644
644
|
name: "Polygon",
|
|
645
645
|
props: {
|
|
646
646
|
options: {
|
|
@@ -648,13 +648,13 @@ const Nr = /* @__PURE__ */ te(Ot, [["render", Pt]]), Ae = (r) => r === "Marker",
|
|
|
648
648
|
required: !0
|
|
649
649
|
}
|
|
650
650
|
},
|
|
651
|
-
emits:
|
|
652
|
-
setup(
|
|
653
|
-
const
|
|
654
|
-
return { polygon:
|
|
651
|
+
emits: H,
|
|
652
|
+
setup(t, { emit: e }) {
|
|
653
|
+
const r = R(t, "options");
|
|
654
|
+
return { polygon: K("Polygon", H, r, e) };
|
|
655
655
|
},
|
|
656
656
|
render: () => null
|
|
657
|
-
}),
|
|
657
|
+
}), Re = H.concat(["bounds_changed"]), Tn = T({
|
|
658
658
|
name: "Rectangle",
|
|
659
659
|
props: {
|
|
660
660
|
options: {
|
|
@@ -662,13 +662,13 @@ const Nr = /* @__PURE__ */ te(Ot, [["render", Pt]]), Ae = (r) => r === "Marker",
|
|
|
662
662
|
required: !0
|
|
663
663
|
}
|
|
664
664
|
},
|
|
665
|
-
emits:
|
|
666
|
-
setup(
|
|
667
|
-
const
|
|
668
|
-
return { rectangle:
|
|
665
|
+
emits: Re,
|
|
666
|
+
setup(t, { emit: e }) {
|
|
667
|
+
const r = R(t, "options");
|
|
668
|
+
return { rectangle: K("Rectangle", Re, r, e) };
|
|
669
669
|
},
|
|
670
670
|
render: () => null
|
|
671
|
-
}),
|
|
671
|
+
}), $e = H.concat(["center_changed", "radius_changed"]), Pn = T({
|
|
672
672
|
name: "Circle",
|
|
673
673
|
props: {
|
|
674
674
|
options: {
|
|
@@ -676,13 +676,13 @@ const Nr = /* @__PURE__ */ te(Ot, [["render", Pt]]), Ae = (r) => r === "Marker",
|
|
|
676
676
|
required: !0
|
|
677
677
|
}
|
|
678
678
|
},
|
|
679
|
-
emits:
|
|
680
|
-
setup(
|
|
681
|
-
const
|
|
682
|
-
return { circle:
|
|
679
|
+
emits: $e,
|
|
680
|
+
setup(t, { emit: e }) {
|
|
681
|
+
const r = R(t, "options");
|
|
682
|
+
return { circle: K("Circle", $e, r, e) };
|
|
683
683
|
},
|
|
684
684
|
render: () => null
|
|
685
|
-
}),
|
|
685
|
+
}), Rt = T({
|
|
686
686
|
props: {
|
|
687
687
|
position: {
|
|
688
688
|
type: String,
|
|
@@ -694,57 +694,57 @@ const Nr = /* @__PURE__ */ te(Ot, [["render", Pt]]), Ae = (r) => r === "Marker",
|
|
|
694
694
|
}
|
|
695
695
|
},
|
|
696
696
|
emits: ["content:loaded"],
|
|
697
|
-
setup(
|
|
698
|
-
const
|
|
699
|
-
[o, s,
|
|
700
|
-
([c,
|
|
701
|
-
|
|
697
|
+
setup(t, { emit: e }) {
|
|
698
|
+
const r = _(null), n = C(D, _()), s = C(Z, _()), o = C(rt, _(!1)), i = S(
|
|
699
|
+
[o, s, r],
|
|
700
|
+
([c, p, u]) => {
|
|
701
|
+
p && c && u && (l(t.position), e("content:loaded"), setTimeout(i, 0));
|
|
702
702
|
},
|
|
703
703
|
{ immediate: !0 }
|
|
704
704
|
), l = (c) => {
|
|
705
|
-
if (n.value && s.value &&
|
|
706
|
-
const
|
|
707
|
-
|
|
705
|
+
if (n.value && s.value && r.value) {
|
|
706
|
+
const p = s.value.ControlPosition[c];
|
|
707
|
+
r.value.index = t.index, n.value.controls[p].push(r.value);
|
|
708
708
|
}
|
|
709
709
|
}, a = (c) => {
|
|
710
710
|
if (n.value && s.value) {
|
|
711
|
-
let
|
|
711
|
+
let p = null;
|
|
712
712
|
const u = s.value.ControlPosition[c];
|
|
713
713
|
n.value.controls[u].forEach((f, m) => {
|
|
714
|
-
f ===
|
|
715
|
-
}),
|
|
714
|
+
f === r.value && (p = m);
|
|
715
|
+
}), p !== null && n.value.controls[u].removeAt(p);
|
|
716
716
|
}
|
|
717
717
|
};
|
|
718
|
-
return
|
|
719
|
-
() =>
|
|
720
|
-
(c,
|
|
721
|
-
a(
|
|
718
|
+
return B(() => a(t.position)), S(
|
|
719
|
+
() => t.position,
|
|
720
|
+
(c, p) => {
|
|
721
|
+
a(p), l(c);
|
|
722
722
|
}
|
|
723
|
-
),
|
|
724
|
-
() =>
|
|
723
|
+
), S(
|
|
724
|
+
() => t.index,
|
|
725
725
|
(c) => {
|
|
726
|
-
|
|
726
|
+
r.value && (r.value.index = c);
|
|
727
727
|
}
|
|
728
|
-
), { controlRef:
|
|
728
|
+
), { controlRef: r };
|
|
729
729
|
}
|
|
730
730
|
});
|
|
731
|
-
const
|
|
731
|
+
const $t = {
|
|
732
732
|
ref: "controlRef",
|
|
733
733
|
class: "custom-control-wrapper"
|
|
734
734
|
};
|
|
735
|
-
function
|
|
736
|
-
return
|
|
737
|
-
|
|
735
|
+
function Nt(t, e, r, n, s, o) {
|
|
736
|
+
return F(), V("div", $t, [
|
|
737
|
+
z(t.$slots, "default", {}, void 0, !0)
|
|
738
738
|
], 512);
|
|
739
739
|
}
|
|
740
|
-
const
|
|
740
|
+
const An = /* @__PURE__ */ re(Rt, [["render", Nt], ["__scopeId", "data-v-ab9120cd"]]), Ne = [
|
|
741
741
|
"closeclick",
|
|
742
742
|
"content_changed",
|
|
743
743
|
"domready",
|
|
744
744
|
"position_changed",
|
|
745
745
|
"visible",
|
|
746
746
|
"zindex_changed"
|
|
747
|
-
],
|
|
747
|
+
], Bt = T({
|
|
748
748
|
inheritAttrs: !1,
|
|
749
749
|
props: {
|
|
750
750
|
options: {
|
|
@@ -755,251 +755,257 @@ const Gr = /* @__PURE__ */ te(bt, [["render", At], ["__scopeId", "data-v-ab9120c
|
|
|
755
755
|
type: Boolean
|
|
756
756
|
}
|
|
757
757
|
},
|
|
758
|
-
emits: [...
|
|
759
|
-
setup(
|
|
760
|
-
const s =
|
|
761
|
-
let c,
|
|
762
|
-
const u =
|
|
763
|
-
var
|
|
764
|
-
return (
|
|
765
|
-
}), f = (
|
|
766
|
-
|
|
767
|
-
}, m = (
|
|
768
|
-
s.value && (s.value.open({ map: i.value, anchor: a.value, ...
|
|
758
|
+
emits: [...Ne, "update:modelValue"],
|
|
759
|
+
setup(t, { slots: e, emit: r, expose: n }) {
|
|
760
|
+
const s = _(), o = _(), i = C(D, _()), l = C(Z, _()), a = C(Ce, _());
|
|
761
|
+
let c, p = t.modelValue;
|
|
762
|
+
const u = W(() => {
|
|
763
|
+
var d;
|
|
764
|
+
return (d = e.default) == null ? void 0 : d.call(e).some((g) => g.type !== we);
|
|
765
|
+
}), f = (d) => {
|
|
766
|
+
p = d, r("update:modelValue", d);
|
|
767
|
+
}, m = (d) => {
|
|
768
|
+
s.value && (s.value.open({ map: i.value, anchor: a.value, ...d }), f(!0));
|
|
769
769
|
}, h = () => {
|
|
770
770
|
s.value && (s.value.close(), f(!1));
|
|
771
771
|
};
|
|
772
|
-
return
|
|
773
|
-
|
|
774
|
-
[i, () =>
|
|
775
|
-
([
|
|
776
|
-
var
|
|
777
|
-
const
|
|
778
|
-
i.value && l.value &&
|
|
772
|
+
return tt(() => {
|
|
773
|
+
S(
|
|
774
|
+
[i, () => t.options],
|
|
775
|
+
([d, g], [v, y]) => {
|
|
776
|
+
var P;
|
|
777
|
+
const w = !ee(g, y) || i.value !== v;
|
|
778
|
+
i.value && l.value && w && (s.value ? (s.value.setOptions({
|
|
779
779
|
...g,
|
|
780
780
|
content: u.value ? o.value : g.content
|
|
781
|
-
}), a.value || m()) : (s.value =
|
|
781
|
+
}), a.value || m()) : (s.value = A(
|
|
782
782
|
new l.value.InfoWindow({
|
|
783
783
|
...g,
|
|
784
784
|
content: u.value ? o.value : g.content
|
|
785
785
|
})
|
|
786
|
-
), a.value && (c = a.value.addListener("click", () => {
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
(b = s.value) == null || b.addListener(P, (C) => t(P, C));
|
|
791
|
-
}), (q = s.value) == null || q.addListener("closeclick", () => f(!1))));
|
|
786
|
+
), a.value && (c = a.value.addListener("click", () => m())), (!a.value || p) && m(), Ne.forEach((O) => {
|
|
787
|
+
var E;
|
|
788
|
+
(E = s.value) == null || E.addListener(O, (k) => r(O, k));
|
|
789
|
+
}), (P = s.value) == null || P.addListener("closeclick", () => f(!1))));
|
|
792
790
|
},
|
|
793
791
|
{
|
|
794
792
|
immediate: !0,
|
|
795
793
|
flush: "post"
|
|
796
794
|
}
|
|
797
|
-
),
|
|
798
|
-
|
|
799
|
-
(
|
|
800
|
-
|
|
795
|
+
), S(
|
|
796
|
+
a,
|
|
797
|
+
(d, g) => {
|
|
798
|
+
!s.value || d === g || (c && (c.remove(), c = void 0), d && (c = d.addListener("click", () => m())));
|
|
799
|
+
},
|
|
800
|
+
{
|
|
801
|
+
flush: "post"
|
|
802
|
+
}
|
|
803
|
+
), S(
|
|
804
|
+
() => t.modelValue,
|
|
805
|
+
(d) => {
|
|
806
|
+
d !== p && (d ? m() : h());
|
|
801
807
|
}
|
|
802
808
|
);
|
|
803
|
-
}),
|
|
804
|
-
var
|
|
805
|
-
c && c.remove(), s.value && ((
|
|
809
|
+
}), B(() => {
|
|
810
|
+
var d;
|
|
811
|
+
c && c.remove(), s.value && ((d = l.value) == null || d.event.clearInstanceListeners(s.value), h());
|
|
806
812
|
}), n({ infoWindow: s, open: m, close: h }), { infoWindow: s, infoWindowRef: o, hasSlotContent: u, open: m, close: h };
|
|
807
813
|
}
|
|
808
814
|
});
|
|
809
|
-
const
|
|
815
|
+
const Dt = {
|
|
810
816
|
key: 0,
|
|
811
817
|
class: "info-window-wrapper"
|
|
812
818
|
};
|
|
813
|
-
function
|
|
814
|
-
return
|
|
815
|
-
|
|
816
|
-
|
|
819
|
+
function Zt(t, e, r, n, s, o) {
|
|
820
|
+
return t.hasSlotContent ? (F(), V("div", Dt, [
|
|
821
|
+
ce("div", ke({ ref: "infoWindowRef" }, t.$attrs), [
|
|
822
|
+
z(t.$slots, "default", {}, void 0, !0)
|
|
817
823
|
], 16)
|
|
818
|
-
])) :
|
|
824
|
+
])) : be("", !0);
|
|
819
825
|
}
|
|
820
|
-
const
|
|
821
|
-
var
|
|
822
|
-
function
|
|
826
|
+
const qn = /* @__PURE__ */ re(Bt, [["render", Zt], ["__scopeId", "data-v-d182c1f9"]]);
|
|
827
|
+
var Gt = Object.getOwnPropertyNames, Ut = Object.getOwnPropertySymbols, Ft = Object.prototype.hasOwnProperty;
|
|
828
|
+
function Be(t, e) {
|
|
823
829
|
return function(n, s, o) {
|
|
824
|
-
return
|
|
830
|
+
return t(n, s, o) && e(n, s, o);
|
|
825
831
|
};
|
|
826
832
|
}
|
|
827
|
-
function
|
|
828
|
-
return function(
|
|
829
|
-
if (!
|
|
830
|
-
return r
|
|
831
|
-
var o = s.cache, i = o.get(
|
|
833
|
+
function oe(t) {
|
|
834
|
+
return function(r, n, s) {
|
|
835
|
+
if (!r || !n || typeof r != "object" || typeof n != "object")
|
|
836
|
+
return t(r, n, s);
|
|
837
|
+
var o = s.cache, i = o.get(r), l = o.get(n);
|
|
832
838
|
if (i && l)
|
|
833
|
-
return i === n && l ===
|
|
834
|
-
o.set(
|
|
835
|
-
var a = r
|
|
836
|
-
return o.delete(
|
|
839
|
+
return i === n && l === r;
|
|
840
|
+
o.set(r, n), o.set(n, r);
|
|
841
|
+
var a = t(r, n, s);
|
|
842
|
+
return o.delete(r), o.delete(n), a;
|
|
837
843
|
};
|
|
838
844
|
}
|
|
839
|
-
function
|
|
840
|
-
return
|
|
845
|
+
function De(t) {
|
|
846
|
+
return Gt(t).concat(Ut(t));
|
|
841
847
|
}
|
|
842
|
-
var
|
|
843
|
-
return
|
|
848
|
+
var Vt = Object.hasOwn || function(t, e) {
|
|
849
|
+
return Ft.call(t, e);
|
|
844
850
|
};
|
|
845
|
-
function
|
|
846
|
-
return
|
|
851
|
+
function G(t, e) {
|
|
852
|
+
return t === e || !t && !e && t !== t && e !== e;
|
|
847
853
|
}
|
|
848
|
-
var
|
|
849
|
-
function
|
|
850
|
-
var n =
|
|
854
|
+
var zt = "__v", Wt = "__o", Ht = "_owner", Ze = Object.getOwnPropertyDescriptor, Ge = Object.keys;
|
|
855
|
+
function Kt(t, e, r) {
|
|
856
|
+
var n = t.length;
|
|
851
857
|
if (e.length !== n)
|
|
852
858
|
return !1;
|
|
853
859
|
for (; n-- > 0; )
|
|
854
|
-
if (!
|
|
860
|
+
if (!r.equals(t[n], e[n], n, n, t, e, r))
|
|
855
861
|
return !1;
|
|
856
862
|
return !0;
|
|
857
863
|
}
|
|
858
|
-
function
|
|
859
|
-
return
|
|
864
|
+
function Xt(t, e) {
|
|
865
|
+
return G(t.getTime(), e.getTime());
|
|
860
866
|
}
|
|
861
|
-
function
|
|
862
|
-
return
|
|
867
|
+
function Yt(t, e) {
|
|
868
|
+
return t.name === e.name && t.message === e.message && t.cause === e.cause && t.stack === e.stack;
|
|
863
869
|
}
|
|
864
|
-
function
|
|
865
|
-
return
|
|
870
|
+
function Jt(t, e) {
|
|
871
|
+
return t === e;
|
|
866
872
|
}
|
|
867
|
-
function
|
|
868
|
-
var n =
|
|
873
|
+
function Ue(t, e, r) {
|
|
874
|
+
var n = t.size;
|
|
869
875
|
if (n !== e.size)
|
|
870
876
|
return !1;
|
|
871
877
|
if (!n)
|
|
872
878
|
return !0;
|
|
873
|
-
for (var s = new Array(n), o =
|
|
874
|
-
for (var c = e.entries(),
|
|
879
|
+
for (var s = new Array(n), o = t.entries(), i, l, a = 0; (i = o.next()) && !i.done; ) {
|
|
880
|
+
for (var c = e.entries(), p = !1, u = 0; (l = c.next()) && !l.done; ) {
|
|
875
881
|
if (s[u]) {
|
|
876
882
|
u++;
|
|
877
883
|
continue;
|
|
878
884
|
}
|
|
879
885
|
var f = i.value, m = l.value;
|
|
880
|
-
if (
|
|
881
|
-
|
|
886
|
+
if (r.equals(f[0], m[0], a, u, t, e, r) && r.equals(f[1], m[1], f[0], m[0], t, e, r)) {
|
|
887
|
+
p = s[u] = !0;
|
|
882
888
|
break;
|
|
883
889
|
}
|
|
884
890
|
u++;
|
|
885
891
|
}
|
|
886
|
-
if (!
|
|
892
|
+
if (!p)
|
|
887
893
|
return !1;
|
|
888
894
|
a++;
|
|
889
895
|
}
|
|
890
896
|
return !0;
|
|
891
897
|
}
|
|
892
|
-
var
|
|
893
|
-
function
|
|
894
|
-
var n =
|
|
895
|
-
if (
|
|
898
|
+
var Qt = G;
|
|
899
|
+
function er(t, e, r) {
|
|
900
|
+
var n = Ge(t), s = n.length;
|
|
901
|
+
if (Ge(e).length !== s)
|
|
896
902
|
return !1;
|
|
897
903
|
for (; s-- > 0; )
|
|
898
|
-
if (!
|
|
904
|
+
if (!nt(t, e, r, n[s]))
|
|
899
905
|
return !1;
|
|
900
906
|
return !0;
|
|
901
907
|
}
|
|
902
|
-
function
|
|
903
|
-
var n =
|
|
904
|
-
if (
|
|
908
|
+
function X(t, e, r) {
|
|
909
|
+
var n = De(t), s = n.length;
|
|
910
|
+
if (De(e).length !== s)
|
|
905
911
|
return !1;
|
|
906
912
|
for (var o, i, l; s-- > 0; )
|
|
907
|
-
if (o = n[s], !
|
|
913
|
+
if (o = n[s], !nt(t, e, r, o) || (i = Ze(t, o), l = Ze(e, o), (i || l) && (!i || !l || i.configurable !== l.configurable || i.enumerable !== l.enumerable || i.writable !== l.writable)))
|
|
908
914
|
return !1;
|
|
909
915
|
return !0;
|
|
910
916
|
}
|
|
911
|
-
function
|
|
912
|
-
return
|
|
917
|
+
function tr(t, e) {
|
|
918
|
+
return G(t.valueOf(), e.valueOf());
|
|
913
919
|
}
|
|
914
|
-
function
|
|
915
|
-
return
|
|
920
|
+
function rr(t, e) {
|
|
921
|
+
return t.source === e.source && t.flags === e.flags;
|
|
916
922
|
}
|
|
917
|
-
function
|
|
918
|
-
var n =
|
|
923
|
+
function Fe(t, e, r) {
|
|
924
|
+
var n = t.size;
|
|
919
925
|
if (n !== e.size)
|
|
920
926
|
return !1;
|
|
921
927
|
if (!n)
|
|
922
928
|
return !0;
|
|
923
|
-
for (var s = new Array(n), o =
|
|
924
|
-
for (var a = e.values(), c = !1,
|
|
925
|
-
if (!s[
|
|
926
|
-
c = s[
|
|
929
|
+
for (var s = new Array(n), o = t.values(), i, l; (i = o.next()) && !i.done; ) {
|
|
930
|
+
for (var a = e.values(), c = !1, p = 0; (l = a.next()) && !l.done; ) {
|
|
931
|
+
if (!s[p] && r.equals(i.value, l.value, i.value, l.value, t, e, r)) {
|
|
932
|
+
c = s[p] = !0;
|
|
927
933
|
break;
|
|
928
934
|
}
|
|
929
|
-
|
|
935
|
+
p++;
|
|
930
936
|
}
|
|
931
937
|
if (!c)
|
|
932
938
|
return !1;
|
|
933
939
|
}
|
|
934
940
|
return !0;
|
|
935
941
|
}
|
|
936
|
-
function
|
|
937
|
-
var
|
|
938
|
-
if (e.length !==
|
|
942
|
+
function nr(t, e) {
|
|
943
|
+
var r = t.length;
|
|
944
|
+
if (e.length !== r)
|
|
939
945
|
return !1;
|
|
940
|
-
for (;
|
|
941
|
-
if (r
|
|
946
|
+
for (; r-- > 0; )
|
|
947
|
+
if (t[r] !== e[r])
|
|
942
948
|
return !1;
|
|
943
949
|
return !0;
|
|
944
950
|
}
|
|
945
|
-
function
|
|
946
|
-
return
|
|
951
|
+
function sr(t, e) {
|
|
952
|
+
return t.hostname === e.hostname && t.pathname === e.pathname && t.protocol === e.protocol && t.port === e.port && t.hash === e.hash && t.username === e.username && t.password === e.password;
|
|
947
953
|
}
|
|
948
|
-
function
|
|
949
|
-
return (n ===
|
|
954
|
+
function nt(t, e, r, n) {
|
|
955
|
+
return (n === Ht || n === Wt || n === zt) && (t.$$typeof || e.$$typeof) ? !0 : Vt(e, n) && r.equals(t[n], e[n], n, n, t, e, r);
|
|
950
956
|
}
|
|
951
|
-
var
|
|
952
|
-
function
|
|
953
|
-
var e =
|
|
954
|
-
return function(h,
|
|
955
|
-
if (h ===
|
|
957
|
+
var or = "[object Arguments]", ar = "[object Boolean]", ir = "[object Date]", lr = "[object Error]", ur = "[object Map]", cr = "[object Number]", dr = "[object Object]", pr = "[object RegExp]", fr = "[object Set]", mr = "[object String]", hr = "[object URL]", gr = Array.isArray, Ve = typeof ArrayBuffer == "function" && ArrayBuffer.isView ? ArrayBuffer.isView : null, ze = Object.assign, vr = Object.prototype.toString.call.bind(Object.prototype.toString);
|
|
958
|
+
function yr(t) {
|
|
959
|
+
var e = t.areArraysEqual, r = t.areDatesEqual, n = t.areErrorsEqual, s = t.areFunctionsEqual, o = t.areMapsEqual, i = t.areNumbersEqual, l = t.areObjectsEqual, a = t.arePrimitiveWrappersEqual, c = t.areRegExpsEqual, p = t.areSetsEqual, u = t.areTypedArraysEqual, f = t.areUrlsEqual;
|
|
960
|
+
return function(h, d, g) {
|
|
961
|
+
if (h === d)
|
|
956
962
|
return !0;
|
|
957
|
-
if (h == null ||
|
|
963
|
+
if (h == null || d == null)
|
|
958
964
|
return !1;
|
|
959
965
|
var v = typeof h;
|
|
960
|
-
if (v !== typeof
|
|
966
|
+
if (v !== typeof d)
|
|
961
967
|
return !1;
|
|
962
968
|
if (v !== "object")
|
|
963
|
-
return v === "number" ? i(h,
|
|
964
|
-
var
|
|
965
|
-
if (
|
|
969
|
+
return v === "number" ? i(h, d, g) : v === "function" ? s(h, d, g) : !1;
|
|
970
|
+
var y = h.constructor;
|
|
971
|
+
if (y !== d.constructor)
|
|
966
972
|
return !1;
|
|
967
|
-
if (
|
|
968
|
-
return l(h,
|
|
969
|
-
if (
|
|
970
|
-
return e(h,
|
|
971
|
-
if (
|
|
972
|
-
return u(h,
|
|
973
|
-
if (
|
|
974
|
-
return
|
|
975
|
-
if (
|
|
976
|
-
return c(h,
|
|
977
|
-
if (
|
|
978
|
-
return o(h,
|
|
979
|
-
if (
|
|
980
|
-
return
|
|
981
|
-
var
|
|
982
|
-
return
|
|
973
|
+
if (y === Object)
|
|
974
|
+
return l(h, d, g);
|
|
975
|
+
if (gr(h))
|
|
976
|
+
return e(h, d, g);
|
|
977
|
+
if (Ve != null && Ve(h))
|
|
978
|
+
return u(h, d, g);
|
|
979
|
+
if (y === Date)
|
|
980
|
+
return r(h, d, g);
|
|
981
|
+
if (y === RegExp)
|
|
982
|
+
return c(h, d, g);
|
|
983
|
+
if (y === Map)
|
|
984
|
+
return o(h, d, g);
|
|
985
|
+
if (y === Set)
|
|
986
|
+
return p(h, d, g);
|
|
987
|
+
var w = vr(h);
|
|
988
|
+
return w === ir ? r(h, d, g) : w === pr ? c(h, d, g) : w === ur ? o(h, d, g) : w === fr ? p(h, d, g) : w === dr ? typeof h.then != "function" && typeof d.then != "function" && l(h, d, g) : w === hr ? f(h, d, g) : w === lr ? n(h, d, g) : w === or ? l(h, d, g) : w === ar || w === cr || w === mr ? a(h, d, g) : !1;
|
|
983
989
|
};
|
|
984
990
|
}
|
|
985
|
-
function
|
|
986
|
-
var e =
|
|
987
|
-
areArraysEqual: n ?
|
|
988
|
-
areDatesEqual:
|
|
989
|
-
areErrorsEqual:
|
|
990
|
-
areFunctionsEqual:
|
|
991
|
-
areMapsEqual: n ?
|
|
992
|
-
areNumbersEqual:
|
|
993
|
-
areObjectsEqual: n ?
|
|
994
|
-
arePrimitiveWrappersEqual:
|
|
995
|
-
areRegExpsEqual:
|
|
996
|
-
areSetsEqual: n ?
|
|
997
|
-
areTypedArraysEqual: n ?
|
|
998
|
-
areUrlsEqual:
|
|
991
|
+
function _r(t) {
|
|
992
|
+
var e = t.circular, r = t.createCustomConfig, n = t.strict, s = {
|
|
993
|
+
areArraysEqual: n ? X : Kt,
|
|
994
|
+
areDatesEqual: Xt,
|
|
995
|
+
areErrorsEqual: Yt,
|
|
996
|
+
areFunctionsEqual: Jt,
|
|
997
|
+
areMapsEqual: n ? Be(Ue, X) : Ue,
|
|
998
|
+
areNumbersEqual: Qt,
|
|
999
|
+
areObjectsEqual: n ? X : er,
|
|
1000
|
+
arePrimitiveWrappersEqual: tr,
|
|
1001
|
+
areRegExpsEqual: rr,
|
|
1002
|
+
areSetsEqual: n ? Be(Fe, X) : Fe,
|
|
1003
|
+
areTypedArraysEqual: n ? X : nr,
|
|
1004
|
+
areUrlsEqual: sr
|
|
999
1005
|
};
|
|
1000
|
-
if (
|
|
1001
|
-
var o =
|
|
1002
|
-
s =
|
|
1006
|
+
if (r && (s = ze({}, s, r(s))), e) {
|
|
1007
|
+
var o = oe(s.areArraysEqual), i = oe(s.areMapsEqual), l = oe(s.areObjectsEqual), a = oe(s.areSetsEqual);
|
|
1008
|
+
s = ze({}, s, {
|
|
1003
1009
|
areArraysEqual: o,
|
|
1004
1010
|
areMapsEqual: i,
|
|
1005
1011
|
areObjectsEqual: l,
|
|
@@ -1008,17 +1014,17 @@ function cr(r) {
|
|
|
1008
1014
|
}
|
|
1009
1015
|
return s;
|
|
1010
1016
|
}
|
|
1011
|
-
function
|
|
1012
|
-
return function(e,
|
|
1013
|
-
return
|
|
1017
|
+
function Er(t) {
|
|
1018
|
+
return function(e, r, n, s, o, i, l) {
|
|
1019
|
+
return t(e, r, l);
|
|
1014
1020
|
};
|
|
1015
1021
|
}
|
|
1016
|
-
function
|
|
1017
|
-
var e =
|
|
1022
|
+
function wr(t) {
|
|
1023
|
+
var e = t.circular, r = t.comparator, n = t.createState, s = t.equals, o = t.strict;
|
|
1018
1024
|
if (n)
|
|
1019
1025
|
return function(a, c) {
|
|
1020
|
-
var
|
|
1021
|
-
return
|
|
1026
|
+
var p = n(), u = p.cache, f = u === void 0 ? e ? /* @__PURE__ */ new WeakMap() : void 0 : u, m = p.meta;
|
|
1027
|
+
return r(a, c, {
|
|
1022
1028
|
cache: f,
|
|
1023
1029
|
equals: s,
|
|
1024
1030
|
meta: m,
|
|
@@ -1027,7 +1033,7 @@ function dr(r) {
|
|
|
1027
1033
|
};
|
|
1028
1034
|
if (e)
|
|
1029
1035
|
return function(a, c) {
|
|
1030
|
-
return
|
|
1036
|
+
return r(a, c, {
|
|
1031
1037
|
cache: /* @__PURE__ */ new WeakMap(),
|
|
1032
1038
|
equals: s,
|
|
1033
1039
|
meta: void 0,
|
|
@@ -1041,46 +1047,46 @@ function dr(r) {
|
|
|
1041
1047
|
strict: o
|
|
1042
1048
|
};
|
|
1043
1049
|
return function(a, c) {
|
|
1044
|
-
return
|
|
1050
|
+
return r(a, c, i);
|
|
1045
1051
|
};
|
|
1046
1052
|
}
|
|
1047
|
-
var
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1053
|
+
var le = $();
|
|
1054
|
+
$({ strict: !0 });
|
|
1055
|
+
$({ circular: !0 });
|
|
1056
|
+
$({
|
|
1051
1057
|
circular: !0,
|
|
1052
1058
|
strict: !0
|
|
1053
1059
|
});
|
|
1054
|
-
|
|
1060
|
+
$({
|
|
1055
1061
|
createInternalComparator: function() {
|
|
1056
|
-
return
|
|
1062
|
+
return G;
|
|
1057
1063
|
}
|
|
1058
1064
|
});
|
|
1059
|
-
|
|
1065
|
+
$({
|
|
1060
1066
|
strict: !0,
|
|
1061
1067
|
createInternalComparator: function() {
|
|
1062
|
-
return
|
|
1068
|
+
return G;
|
|
1063
1069
|
}
|
|
1064
1070
|
});
|
|
1065
|
-
|
|
1071
|
+
$({
|
|
1066
1072
|
circular: !0,
|
|
1067
1073
|
createInternalComparator: function() {
|
|
1068
|
-
return
|
|
1074
|
+
return G;
|
|
1069
1075
|
}
|
|
1070
1076
|
});
|
|
1071
|
-
|
|
1077
|
+
$({
|
|
1072
1078
|
circular: !0,
|
|
1073
1079
|
createInternalComparator: function() {
|
|
1074
|
-
return
|
|
1080
|
+
return G;
|
|
1075
1081
|
},
|
|
1076
1082
|
strict: !0
|
|
1077
1083
|
});
|
|
1078
|
-
function
|
|
1079
|
-
|
|
1080
|
-
var e =
|
|
1081
|
-
return
|
|
1084
|
+
function $(t) {
|
|
1085
|
+
t === void 0 && (t = {});
|
|
1086
|
+
var e = t.circular, r = e === void 0 ? !1 : e, n = t.createInternalComparator, s = t.createState, o = t.strict, i = o === void 0 ? !1 : o, l = _r(t), a = yr(l), c = n ? n(a) : Er(a);
|
|
1087
|
+
return wr({ circular: r, comparator: a, createState: s, equals: c, strict: i });
|
|
1082
1088
|
}
|
|
1083
|
-
const
|
|
1089
|
+
const We = [
|
|
1084
1090
|
Int8Array,
|
|
1085
1091
|
Uint8Array,
|
|
1086
1092
|
Uint8ClampedArray,
|
|
@@ -1090,8 +1096,8 @@ const Ge = [
|
|
|
1090
1096
|
Uint32Array,
|
|
1091
1097
|
Float32Array,
|
|
1092
1098
|
Float64Array
|
|
1093
|
-
],
|
|
1094
|
-
class
|
|
1099
|
+
], me = 1, Y = 8;
|
|
1100
|
+
class Se {
|
|
1095
1101
|
/**
|
|
1096
1102
|
* Creates an index from raw `ArrayBuffer` data.
|
|
1097
1103
|
* @param {ArrayBuffer} data
|
|
@@ -1099,17 +1105,17 @@ class Ce {
|
|
|
1099
1105
|
static from(e) {
|
|
1100
1106
|
if (!(e instanceof ArrayBuffer))
|
|
1101
1107
|
throw new Error("Data must be an instance of ArrayBuffer.");
|
|
1102
|
-
const [
|
|
1103
|
-
if (
|
|
1108
|
+
const [r, n] = new Uint8Array(e, 0, 2);
|
|
1109
|
+
if (r !== 219)
|
|
1104
1110
|
throw new Error("Data does not appear to be in a KDBush format.");
|
|
1105
1111
|
const s = n >> 4;
|
|
1106
|
-
if (s !==
|
|
1107
|
-
throw new Error(`Got v${s} data when expected v${
|
|
1108
|
-
const o =
|
|
1112
|
+
if (s !== me)
|
|
1113
|
+
throw new Error(`Got v${s} data when expected v${me}.`);
|
|
1114
|
+
const o = We[n & 15];
|
|
1109
1115
|
if (!o)
|
|
1110
1116
|
throw new Error("Unrecognized array type.");
|
|
1111
1117
|
const [i] = new Uint16Array(e, 2, 1), [l] = new Uint32Array(e, 4, 1);
|
|
1112
|
-
return new
|
|
1118
|
+
return new Se(l, i, o, e);
|
|
1113
1119
|
}
|
|
1114
1120
|
/**
|
|
1115
1121
|
* Creates an index that will hold a given number of items.
|
|
@@ -1118,14 +1124,14 @@ class Ce {
|
|
|
1118
1124
|
* @param {TypedArrayConstructor} [ArrayType=Float64Array] The array type used for coordinates storage (`Float64Array` by default).
|
|
1119
1125
|
* @param {ArrayBuffer} [data] (For internal use only)
|
|
1120
1126
|
*/
|
|
1121
|
-
constructor(e,
|
|
1127
|
+
constructor(e, r = 64, n = Float64Array, s) {
|
|
1122
1128
|
if (isNaN(e) || e < 0)
|
|
1123
1129
|
throw new Error(`Unpexpected numItems value: ${e}.`);
|
|
1124
|
-
this.numItems = +e, this.nodeSize = Math.min(Math.max(+
|
|
1125
|
-
const o =
|
|
1130
|
+
this.numItems = +e, this.nodeSize = Math.min(Math.max(+r, 2), 65535), this.ArrayType = n, this.IndexArrayType = e < 65536 ? Uint16Array : Uint32Array;
|
|
1131
|
+
const o = We.indexOf(this.ArrayType), i = e * 2 * this.ArrayType.BYTES_PER_ELEMENT, l = e * this.IndexArrayType.BYTES_PER_ELEMENT, a = (8 - l % 8) % 8;
|
|
1126
1132
|
if (o < 0)
|
|
1127
1133
|
throw new Error(`Unexpected typed array class: ${n}.`);
|
|
1128
|
-
s && s instanceof ArrayBuffer ? (this.data = s, this.ids = new this.IndexArrayType(this.data,
|
|
1134
|
+
s && s instanceof ArrayBuffer ? (this.data = s, this.ids = new this.IndexArrayType(this.data, Y, e), this.coords = new this.ArrayType(this.data, Y + l + a, e * 2), this._pos = e * 2, this._finished = !0) : (this.data = new ArrayBuffer(Y + i + l + a), this.ids = new this.IndexArrayType(this.data, Y, e), this.coords = new this.ArrayType(this.data, Y + l + a, e * 2), this._pos = 0, this._finished = !1, new Uint8Array(this.data, 0, 2).set([219, (me << 4) + o]), new Uint16Array(this.data, 2, 1)[0] = r, new Uint32Array(this.data, 4, 1)[0] = e);
|
|
1129
1135
|
}
|
|
1130
1136
|
/**
|
|
1131
1137
|
* Add a point to the index.
|
|
@@ -1133,9 +1139,9 @@ class Ce {
|
|
|
1133
1139
|
* @param {number} y
|
|
1134
1140
|
* @returns {number} An incremental index associated with the added item (starting from `0`).
|
|
1135
1141
|
*/
|
|
1136
|
-
add(e,
|
|
1142
|
+
add(e, r) {
|
|
1137
1143
|
const n = this._pos >> 1;
|
|
1138
|
-
return this.ids[n] = n, this.coords[this._pos++] = e, this.coords[this._pos++] =
|
|
1144
|
+
return this.ids[n] = n, this.coords[this._pos++] = e, this.coords[this._pos++] = r, n;
|
|
1139
1145
|
}
|
|
1140
1146
|
/**
|
|
1141
1147
|
* Perform indexing of the added points.
|
|
@@ -1144,7 +1150,7 @@ class Ce {
|
|
|
1144
1150
|
const e = this._pos >> 1;
|
|
1145
1151
|
if (e !== this.numItems)
|
|
1146
1152
|
throw new Error(`Added ${e} items when expected ${this.numItems}.`);
|
|
1147
|
-
return
|
|
1153
|
+
return _e(this.ids, this.coords, this.nodeSize, 0, this.numItems - 1, 0), this._finished = !0, this;
|
|
1148
1154
|
}
|
|
1149
1155
|
/**
|
|
1150
1156
|
* Search the index for items within a given bounding box.
|
|
@@ -1154,21 +1160,21 @@ class Ce {
|
|
|
1154
1160
|
* @param {number} maxY
|
|
1155
1161
|
* @returns {number[]} An array of indices correponding to the found items.
|
|
1156
1162
|
*/
|
|
1157
|
-
range(e,
|
|
1163
|
+
range(e, r, n, s) {
|
|
1158
1164
|
if (!this._finished)
|
|
1159
1165
|
throw new Error("Data not yet indexed - call index.finish().");
|
|
1160
1166
|
const { ids: o, coords: i, nodeSize: l } = this, a = [0, o.length - 1, 0], c = [];
|
|
1161
1167
|
for (; a.length; ) {
|
|
1162
|
-
const
|
|
1168
|
+
const p = a.pop() || 0, u = a.pop() || 0, f = a.pop() || 0;
|
|
1163
1169
|
if (u - f <= l) {
|
|
1164
1170
|
for (let g = f; g <= u; g++) {
|
|
1165
|
-
const v = i[2 * g],
|
|
1166
|
-
v >= e && v <= n &&
|
|
1171
|
+
const v = i[2 * g], y = i[2 * g + 1];
|
|
1172
|
+
v >= e && v <= n && y >= r && y <= s && c.push(o[g]);
|
|
1167
1173
|
}
|
|
1168
1174
|
continue;
|
|
1169
1175
|
}
|
|
1170
|
-
const m = f + u >> 1, h = i[2 * m],
|
|
1171
|
-
h >= e && h <= n &&
|
|
1176
|
+
const m = f + u >> 1, h = i[2 * m], d = i[2 * m + 1];
|
|
1177
|
+
h >= e && h <= n && d >= r && d <= s && c.push(o[m]), (p === 0 ? e <= h : r <= d) && (a.push(f), a.push(m - 1), a.push(1 - p)), (p === 0 ? n >= h : s >= d) && (a.push(m + 1), a.push(u), a.push(1 - p));
|
|
1172
1178
|
}
|
|
1173
1179
|
return c;
|
|
1174
1180
|
}
|
|
@@ -1179,58 +1185,58 @@ class Ce {
|
|
|
1179
1185
|
* @param {number} r Query radius.
|
|
1180
1186
|
* @returns {number[]} An array of indices correponding to the found items.
|
|
1181
1187
|
*/
|
|
1182
|
-
within(e,
|
|
1188
|
+
within(e, r, n) {
|
|
1183
1189
|
if (!this._finished)
|
|
1184
1190
|
throw new Error("Data not yet indexed - call index.finish().");
|
|
1185
1191
|
const { ids: s, coords: o, nodeSize: i } = this, l = [0, s.length - 1, 0], a = [], c = n * n;
|
|
1186
1192
|
for (; l.length; ) {
|
|
1187
|
-
const
|
|
1193
|
+
const p = l.pop() || 0, u = l.pop() || 0, f = l.pop() || 0;
|
|
1188
1194
|
if (u - f <= i) {
|
|
1189
1195
|
for (let g = f; g <= u; g++)
|
|
1190
|
-
|
|
1196
|
+
He(o[2 * g], o[2 * g + 1], e, r) <= c && a.push(s[g]);
|
|
1191
1197
|
continue;
|
|
1192
1198
|
}
|
|
1193
|
-
const m = f + u >> 1, h = o[2 * m],
|
|
1194
|
-
|
|
1199
|
+
const m = f + u >> 1, h = o[2 * m], d = o[2 * m + 1];
|
|
1200
|
+
He(h, d, e, r) <= c && a.push(s[m]), (p === 0 ? e - n <= h : r - n <= d) && (l.push(f), l.push(m - 1), l.push(1 - p)), (p === 0 ? e + n >= h : r + n >= d) && (l.push(m + 1), l.push(u), l.push(1 - p));
|
|
1195
1201
|
}
|
|
1196
1202
|
return a;
|
|
1197
1203
|
}
|
|
1198
1204
|
}
|
|
1199
|
-
function
|
|
1200
|
-
if (s - n <=
|
|
1205
|
+
function _e(t, e, r, n, s, o) {
|
|
1206
|
+
if (s - n <= r)
|
|
1201
1207
|
return;
|
|
1202
1208
|
const i = n + s >> 1;
|
|
1203
|
-
|
|
1209
|
+
st(t, e, i, n, s, o), _e(t, e, r, n, i - 1, 1 - o), _e(t, e, r, i + 1, s, 1 - o);
|
|
1204
1210
|
}
|
|
1205
|
-
function
|
|
1211
|
+
function st(t, e, r, n, s, o) {
|
|
1206
1212
|
for (; s > n; ) {
|
|
1207
1213
|
if (s - n > 600) {
|
|
1208
|
-
const c = s - n + 1,
|
|
1209
|
-
|
|
1214
|
+
const c = s - n + 1, p = r - n + 1, u = Math.log(c), f = 0.5 * Math.exp(2 * u / 3), m = 0.5 * Math.sqrt(u * f * (c - f) / c) * (p - c / 2 < 0 ? -1 : 1), h = Math.max(n, Math.floor(r - p * f / c + m)), d = Math.min(s, Math.floor(r + (c - p) * f / c + m));
|
|
1215
|
+
st(t, e, r, h, d, o);
|
|
1210
1216
|
}
|
|
1211
|
-
const i = e[2 *
|
|
1217
|
+
const i = e[2 * r + o];
|
|
1212
1218
|
let l = n, a = s;
|
|
1213
|
-
for (
|
|
1214
|
-
for (
|
|
1219
|
+
for (J(t, e, n, r), e[2 * s + o] > i && J(t, e, n, s); l < a; ) {
|
|
1220
|
+
for (J(t, e, l, a), l++, a--; e[2 * l + o] < i; )
|
|
1215
1221
|
l++;
|
|
1216
1222
|
for (; e[2 * a + o] > i; )
|
|
1217
1223
|
a--;
|
|
1218
1224
|
}
|
|
1219
|
-
e[2 * n + o] === i ?
|
|
1225
|
+
e[2 * n + o] === i ? J(t, e, n, a) : (a++, J(t, e, a, s)), a <= r && (n = a + 1), r <= a && (s = a - 1);
|
|
1220
1226
|
}
|
|
1221
1227
|
}
|
|
1222
|
-
function
|
|
1223
|
-
|
|
1228
|
+
function J(t, e, r, n) {
|
|
1229
|
+
he(t, r, n), he(e, 2 * r, 2 * n), he(e, 2 * r + 1, 2 * n + 1);
|
|
1224
1230
|
}
|
|
1225
|
-
function
|
|
1226
|
-
const n =
|
|
1227
|
-
|
|
1231
|
+
function he(t, e, r) {
|
|
1232
|
+
const n = t[e];
|
|
1233
|
+
t[e] = t[r], t[r] = n;
|
|
1228
1234
|
}
|
|
1229
|
-
function
|
|
1230
|
-
const s =
|
|
1235
|
+
function He(t, e, r, n) {
|
|
1236
|
+
const s = t - r, o = e - n;
|
|
1231
1237
|
return s * s + o * o;
|
|
1232
1238
|
}
|
|
1233
|
-
const
|
|
1239
|
+
const kr = {
|
|
1234
1240
|
minZoom: 0,
|
|
1235
1241
|
// min zoom to generate clusters on
|
|
1236
1242
|
maxZoom: 16,
|
|
@@ -1251,24 +1257,24 @@ const fr = {
|
|
|
1251
1257
|
reduce: null,
|
|
1252
1258
|
// (accumulated, props) => { accumulated.sum += props.sum; }
|
|
1253
1259
|
// properties to use for individual points when running the reducer
|
|
1254
|
-
map: (
|
|
1260
|
+
map: (t) => t
|
|
1255
1261
|
// props => ({sum: props.my_value})
|
|
1256
|
-
},
|
|
1257
|
-
class
|
|
1262
|
+
}, Ke = Math.fround || ((t) => (e) => (t[0] = +e, t[0]))(new Float32Array(1)), N = 2, j = 3, ge = 4, x = 5, ot = 6;
|
|
1263
|
+
class at {
|
|
1258
1264
|
constructor(e) {
|
|
1259
|
-
this.options = Object.assign(Object.create(
|
|
1265
|
+
this.options = Object.assign(Object.create(kr), e), this.trees = new Array(this.options.maxZoom + 1), this.stride = this.options.reduce ? 7 : 6, this.clusterProps = [];
|
|
1260
1266
|
}
|
|
1261
1267
|
load(e) {
|
|
1262
|
-
const { log:
|
|
1263
|
-
|
|
1268
|
+
const { log: r, minZoom: n, maxZoom: s } = this.options;
|
|
1269
|
+
r && console.time("total time");
|
|
1264
1270
|
const o = `prepare ${e.length} points`;
|
|
1265
|
-
|
|
1271
|
+
r && console.time(o), this.points = e;
|
|
1266
1272
|
const i = [];
|
|
1267
1273
|
for (let a = 0; a < e.length; a++) {
|
|
1268
1274
|
const c = e[a];
|
|
1269
1275
|
if (!c.geometry)
|
|
1270
1276
|
continue;
|
|
1271
|
-
const [
|
|
1277
|
+
const [p, u] = c.geometry.coordinates, f = Ke(ae(p)), m = Ke(ie(u));
|
|
1272
1278
|
i.push(
|
|
1273
1279
|
f,
|
|
1274
1280
|
m,
|
|
@@ -1284,14 +1290,14 @@ class Qe {
|
|
|
1284
1290
|
), this.options.reduce && i.push(0);
|
|
1285
1291
|
}
|
|
1286
1292
|
let l = this.trees[s + 1] = this._createTree(i);
|
|
1287
|
-
|
|
1293
|
+
r && console.timeEnd(o);
|
|
1288
1294
|
for (let a = s; a >= n; a--) {
|
|
1289
1295
|
const c = +Date.now();
|
|
1290
|
-
l = this.trees[a] = this._createTree(this._cluster(l, a)),
|
|
1296
|
+
l = this.trees[a] = this._createTree(this._cluster(l, a)), r && console.log("z%d: %d clusters in %dms", a, l.numItems, +Date.now() - c);
|
|
1291
1297
|
}
|
|
1292
|
-
return
|
|
1298
|
+
return r && console.timeEnd("total time"), this;
|
|
1293
1299
|
}
|
|
1294
|
-
getClusters(e,
|
|
1300
|
+
getClusters(e, r) {
|
|
1295
1301
|
let n = ((e[0] + 180) % 360 + 360) % 360 - 180;
|
|
1296
1302
|
const s = Math.max(-90, Math.min(90, e[1]));
|
|
1297
1303
|
let o = e[2] === 180 ? 180 : ((e[2] + 180) % 360 + 360) % 360 - 180;
|
|
@@ -1299,57 +1305,57 @@ class Qe {
|
|
|
1299
1305
|
if (e[2] - e[0] >= 360)
|
|
1300
1306
|
n = -180, o = 180;
|
|
1301
1307
|
else if (n > o) {
|
|
1302
|
-
const u = this.getClusters([n, s, 180, i],
|
|
1308
|
+
const u = this.getClusters([n, s, 180, i], r), f = this.getClusters([-180, s, o, i], r);
|
|
1303
1309
|
return u.concat(f);
|
|
1304
1310
|
}
|
|
1305
|
-
const l = this.trees[this._limitZoom(
|
|
1311
|
+
const l = this.trees[this._limitZoom(r)], a = l.range(ae(n), ie(i), ae(o), ie(s)), c = l.data, p = [];
|
|
1306
1312
|
for (const u of a) {
|
|
1307
1313
|
const f = this.stride * u;
|
|
1308
|
-
|
|
1314
|
+
p.push(c[f + x] > 1 ? Xe(c, f, this.clusterProps) : this.points[c[f + j]]);
|
|
1309
1315
|
}
|
|
1310
|
-
return
|
|
1316
|
+
return p;
|
|
1311
1317
|
}
|
|
1312
1318
|
getChildren(e) {
|
|
1313
|
-
const
|
|
1319
|
+
const r = this._getOriginId(e), n = this._getOriginZoom(e), s = "No cluster with the specified id.", o = this.trees[n];
|
|
1314
1320
|
if (!o)
|
|
1315
1321
|
throw new Error(s);
|
|
1316
1322
|
const i = o.data;
|
|
1317
|
-
if (
|
|
1323
|
+
if (r * this.stride >= i.length)
|
|
1318
1324
|
throw new Error(s);
|
|
1319
|
-
const l = this.options.radius / (this.options.extent * Math.pow(2, n - 1)), a = i[
|
|
1320
|
-
for (const f of
|
|
1325
|
+
const l = this.options.radius / (this.options.extent * Math.pow(2, n - 1)), a = i[r * this.stride], c = i[r * this.stride + 1], p = o.within(a, c, l), u = [];
|
|
1326
|
+
for (const f of p) {
|
|
1321
1327
|
const m = f * this.stride;
|
|
1322
|
-
i[m +
|
|
1328
|
+
i[m + ge] === e && u.push(i[m + x] > 1 ? Xe(i, m, this.clusterProps) : this.points[i[m + j]]);
|
|
1323
1329
|
}
|
|
1324
1330
|
if (u.length === 0)
|
|
1325
1331
|
throw new Error(s);
|
|
1326
1332
|
return u;
|
|
1327
1333
|
}
|
|
1328
|
-
getLeaves(e,
|
|
1329
|
-
|
|
1334
|
+
getLeaves(e, r, n) {
|
|
1335
|
+
r = r || 10, n = n || 0;
|
|
1330
1336
|
const s = [];
|
|
1331
|
-
return this._appendLeaves(s, e,
|
|
1337
|
+
return this._appendLeaves(s, e, r, n, 0), s;
|
|
1332
1338
|
}
|
|
1333
|
-
getTile(e,
|
|
1334
|
-
const s = this.trees[this._limitZoom(e)], o = Math.pow(2, e), { extent: i, radius: l } = this.options, a = l / i, c = (n - a) / o,
|
|
1339
|
+
getTile(e, r, n) {
|
|
1340
|
+
const s = this.trees[this._limitZoom(e)], o = Math.pow(2, e), { extent: i, radius: l } = this.options, a = l / i, c = (n - a) / o, p = (n + 1 + a) / o, u = {
|
|
1335
1341
|
features: []
|
|
1336
1342
|
};
|
|
1337
1343
|
return this._addTileFeatures(
|
|
1338
|
-
s.range((
|
|
1344
|
+
s.range((r - a) / o, c, (r + 1 + a) / o, p),
|
|
1339
1345
|
s.data,
|
|
1340
|
-
|
|
1346
|
+
r,
|
|
1341
1347
|
n,
|
|
1342
1348
|
o,
|
|
1343
1349
|
u
|
|
1344
|
-
),
|
|
1345
|
-
s.range(1 - a / o, c, 1,
|
|
1350
|
+
), r === 0 && this._addTileFeatures(
|
|
1351
|
+
s.range(1 - a / o, c, 1, p),
|
|
1346
1352
|
s.data,
|
|
1347
1353
|
o,
|
|
1348
1354
|
n,
|
|
1349
1355
|
o,
|
|
1350
1356
|
u
|
|
1351
|
-
),
|
|
1352
|
-
s.range(0, c, a / o,
|
|
1357
|
+
), r === o - 1 && this._addTileFeatures(
|
|
1358
|
+
s.range(0, c, a / o, p),
|
|
1353
1359
|
s.data,
|
|
1354
1360
|
-1,
|
|
1355
1361
|
n,
|
|
@@ -1358,17 +1364,17 @@ class Qe {
|
|
|
1358
1364
|
), u.features.length ? u : null;
|
|
1359
1365
|
}
|
|
1360
1366
|
getClusterExpansionZoom(e) {
|
|
1361
|
-
let
|
|
1362
|
-
for (;
|
|
1367
|
+
let r = this._getOriginZoom(e) - 1;
|
|
1368
|
+
for (; r <= this.options.maxZoom; ) {
|
|
1363
1369
|
const n = this.getChildren(e);
|
|
1364
|
-
if (
|
|
1370
|
+
if (r++, n.length !== 1)
|
|
1365
1371
|
break;
|
|
1366
1372
|
e = n[0].properties.cluster_id;
|
|
1367
1373
|
}
|
|
1368
|
-
return
|
|
1374
|
+
return r;
|
|
1369
1375
|
}
|
|
1370
|
-
_appendLeaves(e,
|
|
1371
|
-
const i = this.getChildren(
|
|
1376
|
+
_appendLeaves(e, r, n, s, o) {
|
|
1377
|
+
const i = this.getChildren(r);
|
|
1372
1378
|
for (const l of i) {
|
|
1373
1379
|
const a = l.properties;
|
|
1374
1380
|
if (a && a.cluster ? o + a.point_count <= s ? o += a.point_count : o = this._appendLeaves(e, a.cluster_id, n, s, o) : o < s ? o++ : e.push(l), e.length === n)
|
|
@@ -1377,22 +1383,22 @@ class Qe {
|
|
|
1377
1383
|
return o;
|
|
1378
1384
|
}
|
|
1379
1385
|
_createTree(e) {
|
|
1380
|
-
const
|
|
1386
|
+
const r = new Se(e.length / this.stride | 0, this.options.nodeSize, Float32Array);
|
|
1381
1387
|
for (let n = 0; n < e.length; n += this.stride)
|
|
1382
|
-
|
|
1383
|
-
return
|
|
1388
|
+
r.add(e[n], e[n + 1]);
|
|
1389
|
+
return r.finish(), r.data = e, r;
|
|
1384
1390
|
}
|
|
1385
|
-
_addTileFeatures(e,
|
|
1391
|
+
_addTileFeatures(e, r, n, s, o, i) {
|
|
1386
1392
|
for (const l of e) {
|
|
1387
|
-
const a = l * this.stride, c =
|
|
1388
|
-
let
|
|
1393
|
+
const a = l * this.stride, c = r[a + x] > 1;
|
|
1394
|
+
let p, u, f;
|
|
1389
1395
|
if (c)
|
|
1390
|
-
|
|
1396
|
+
p = it(r, a, this.clusterProps), u = r[a], f = r[a + 1];
|
|
1391
1397
|
else {
|
|
1392
|
-
const
|
|
1393
|
-
|
|
1394
|
-
const [g, v] =
|
|
1395
|
-
u =
|
|
1398
|
+
const d = this.points[r[a + j]];
|
|
1399
|
+
p = d.properties;
|
|
1400
|
+
const [g, v] = d.geometry.coordinates;
|
|
1401
|
+
u = ae(g), f = ie(v);
|
|
1396
1402
|
}
|
|
1397
1403
|
const m = {
|
|
1398
1404
|
type: 1,
|
|
@@ -1400,49 +1406,49 @@ class Qe {
|
|
|
1400
1406
|
Math.round(this.options.extent * (u * o - n)),
|
|
1401
1407
|
Math.round(this.options.extent * (f * o - s))
|
|
1402
1408
|
]],
|
|
1403
|
-
tags:
|
|
1409
|
+
tags: p
|
|
1404
1410
|
};
|
|
1405
1411
|
let h;
|
|
1406
|
-
c || this.options.generateId ? h =
|
|
1412
|
+
c || this.options.generateId ? h = r[a + j] : h = this.points[r[a + j]].id, h !== void 0 && (m.id = h), i.features.push(m);
|
|
1407
1413
|
}
|
|
1408
1414
|
}
|
|
1409
1415
|
_limitZoom(e) {
|
|
1410
1416
|
return Math.max(this.options.minZoom, Math.min(Math.floor(+e), this.options.maxZoom + 1));
|
|
1411
1417
|
}
|
|
1412
|
-
_cluster(e,
|
|
1413
|
-
const { radius: n, extent: s, reduce: o, minPoints: i } = this.options, l = n / (s * Math.pow(2,
|
|
1414
|
-
for (let u = 0; u < a.length; u +=
|
|
1415
|
-
if (a[u + N] <=
|
|
1418
|
+
_cluster(e, r) {
|
|
1419
|
+
const { radius: n, extent: s, reduce: o, minPoints: i } = this.options, l = n / (s * Math.pow(2, r)), a = e.data, c = [], p = this.stride;
|
|
1420
|
+
for (let u = 0; u < a.length; u += p) {
|
|
1421
|
+
if (a[u + N] <= r)
|
|
1416
1422
|
continue;
|
|
1417
|
-
a[u + N] =
|
|
1418
|
-
const f = a[u], m = a[u + 1], h = e.within(a[u], a[u + 1], l),
|
|
1419
|
-
let g =
|
|
1423
|
+
a[u + N] = r;
|
|
1424
|
+
const f = a[u], m = a[u + 1], h = e.within(a[u], a[u + 1], l), d = a[u + x];
|
|
1425
|
+
let g = d;
|
|
1420
1426
|
for (const v of h) {
|
|
1421
|
-
const
|
|
1422
|
-
a[
|
|
1427
|
+
const y = v * p;
|
|
1428
|
+
a[y + N] > r && (g += a[y + x]);
|
|
1423
1429
|
}
|
|
1424
|
-
if (g >
|
|
1425
|
-
let v = f *
|
|
1426
|
-
const
|
|
1427
|
-
for (const
|
|
1428
|
-
const
|
|
1429
|
-
if (a[
|
|
1430
|
+
if (g > d && g >= i) {
|
|
1431
|
+
let v = f * d, y = m * d, w, P = -1;
|
|
1432
|
+
const O = ((u / p | 0) << 5) + (r + 1) + this.points.length;
|
|
1433
|
+
for (const E of h) {
|
|
1434
|
+
const k = E * p;
|
|
1435
|
+
if (a[k + N] <= r)
|
|
1430
1436
|
continue;
|
|
1431
|
-
a[
|
|
1432
|
-
const
|
|
1433
|
-
v += a[
|
|
1437
|
+
a[k + N] = r;
|
|
1438
|
+
const M = a[k + x];
|
|
1439
|
+
v += a[k] * M, y += a[k + 1] * M, a[k + ge] = O, o && (w || (w = this._map(a, u, !0), P = this.clusterProps.length, this.clusterProps.push(w)), o(w, this._map(a, k)));
|
|
1434
1440
|
}
|
|
1435
|
-
a[u +
|
|
1441
|
+
a[u + ge] = O, c.push(v / g, y / g, 1 / 0, O, -1, g), o && c.push(P);
|
|
1436
1442
|
} else {
|
|
1437
|
-
for (let v = 0; v <
|
|
1443
|
+
for (let v = 0; v < p; v++)
|
|
1438
1444
|
c.push(a[u + v]);
|
|
1439
1445
|
if (g > 1)
|
|
1440
1446
|
for (const v of h) {
|
|
1441
|
-
const
|
|
1442
|
-
if (!(a[
|
|
1443
|
-
a[
|
|
1444
|
-
for (let
|
|
1445
|
-
c.push(a[
|
|
1447
|
+
const y = v * p;
|
|
1448
|
+
if (!(a[y + N] <= r)) {
|
|
1449
|
+
a[y + N] = r;
|
|
1450
|
+
for (let w = 0; w < p; w++)
|
|
1451
|
+
c.push(a[y + w]);
|
|
1446
1452
|
}
|
|
1447
1453
|
}
|
|
1448
1454
|
}
|
|
@@ -1457,67 +1463,67 @@ class Qe {
|
|
|
1457
1463
|
_getOriginZoom(e) {
|
|
1458
1464
|
return (e - this.points.length) % 32;
|
|
1459
1465
|
}
|
|
1460
|
-
_map(e,
|
|
1461
|
-
if (e[
|
|
1462
|
-
const i = this.clusterProps[e[
|
|
1466
|
+
_map(e, r, n) {
|
|
1467
|
+
if (e[r + x] > 1) {
|
|
1468
|
+
const i = this.clusterProps[e[r + ot]];
|
|
1463
1469
|
return n ? Object.assign({}, i) : i;
|
|
1464
1470
|
}
|
|
1465
|
-
const s = this.points[e[
|
|
1471
|
+
const s = this.points[e[r + j]].properties, o = this.options.map(s);
|
|
1466
1472
|
return n && o === s ? Object.assign({}, o) : o;
|
|
1467
1473
|
}
|
|
1468
1474
|
}
|
|
1469
|
-
function
|
|
1475
|
+
function Xe(t, e, r) {
|
|
1470
1476
|
return {
|
|
1471
1477
|
type: "Feature",
|
|
1472
|
-
id:
|
|
1473
|
-
properties:
|
|
1478
|
+
id: t[e + j],
|
|
1479
|
+
properties: it(t, e, r),
|
|
1474
1480
|
geometry: {
|
|
1475
1481
|
type: "Point",
|
|
1476
|
-
coordinates: [
|
|
1482
|
+
coordinates: [br(t[e]), Cr(t[e + 1])]
|
|
1477
1483
|
}
|
|
1478
1484
|
};
|
|
1479
1485
|
}
|
|
1480
|
-
function
|
|
1481
|
-
const n =
|
|
1486
|
+
function it(t, e, r) {
|
|
1487
|
+
const n = t[e + x], s = n >= 1e4 ? `${Math.round(n / 1e3)}k` : n >= 1e3 ? `${Math.round(n / 100) / 10}k` : n, o = t[e + ot], i = o === -1 ? {} : Object.assign({}, r[o]);
|
|
1482
1488
|
return Object.assign(i, {
|
|
1483
1489
|
cluster: !0,
|
|
1484
|
-
cluster_id:
|
|
1490
|
+
cluster_id: t[e + j],
|
|
1485
1491
|
point_count: n,
|
|
1486
1492
|
point_count_abbreviated: s
|
|
1487
1493
|
});
|
|
1488
1494
|
}
|
|
1489
|
-
function
|
|
1490
|
-
return
|
|
1495
|
+
function ae(t) {
|
|
1496
|
+
return t / 360 + 0.5;
|
|
1491
1497
|
}
|
|
1492
|
-
function
|
|
1493
|
-
const e = Math.sin(
|
|
1494
|
-
return
|
|
1498
|
+
function ie(t) {
|
|
1499
|
+
const e = Math.sin(t * Math.PI / 180), r = 0.5 - 0.25 * Math.log((1 + e) / (1 - e)) / Math.PI;
|
|
1500
|
+
return r < 0 ? 0 : r > 1 ? 1 : r;
|
|
1495
1501
|
}
|
|
1496
|
-
function
|
|
1497
|
-
return (
|
|
1502
|
+
function br(t) {
|
|
1503
|
+
return (t - 0.5) * 360;
|
|
1498
1504
|
}
|
|
1499
|
-
function
|
|
1500
|
-
const e = (180 -
|
|
1505
|
+
function Cr(t) {
|
|
1506
|
+
const e = (180 - t * 360) * Math.PI / 180;
|
|
1501
1507
|
return 360 * Math.atan(Math.exp(e)) / Math.PI - 90;
|
|
1502
1508
|
}
|
|
1503
|
-
function
|
|
1504
|
-
var
|
|
1505
|
-
for (var n in
|
|
1506
|
-
Object.prototype.hasOwnProperty.call(
|
|
1507
|
-
if (
|
|
1508
|
-
for (var s = 0, n = Object.getOwnPropertySymbols(
|
|
1509
|
-
e.indexOf(n[s]) < 0 && Object.prototype.propertyIsEnumerable.call(
|
|
1510
|
-
return
|
|
1509
|
+
function Te(t, e) {
|
|
1510
|
+
var r = {};
|
|
1511
|
+
for (var n in t)
|
|
1512
|
+
Object.prototype.hasOwnProperty.call(t, n) && e.indexOf(n) < 0 && (r[n] = t[n]);
|
|
1513
|
+
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
1514
|
+
for (var s = 0, n = Object.getOwnPropertySymbols(t); s < n.length; s++)
|
|
1515
|
+
e.indexOf(n[s]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[s]) && (r[n[s]] = t[n[s]]);
|
|
1516
|
+
return r;
|
|
1511
1517
|
}
|
|
1512
|
-
class
|
|
1518
|
+
class b {
|
|
1513
1519
|
static isAdvancedMarkerAvailable(e) {
|
|
1514
1520
|
return google.maps.marker && e.getMapCapabilities().isAdvancedMarkersAvailable === !0;
|
|
1515
1521
|
}
|
|
1516
1522
|
static isAdvancedMarker(e) {
|
|
1517
1523
|
return google.maps.marker && e instanceof google.maps.marker.AdvancedMarkerElement;
|
|
1518
1524
|
}
|
|
1519
|
-
static setMap(e,
|
|
1520
|
-
this.isAdvancedMarker(e) ? e.map =
|
|
1525
|
+
static setMap(e, r) {
|
|
1526
|
+
this.isAdvancedMarker(e) ? e.map = r : e.setMap(r);
|
|
1521
1527
|
}
|
|
1522
1528
|
static getPosition(e) {
|
|
1523
1529
|
if (this.isAdvancedMarker(e)) {
|
|
@@ -1535,16 +1541,16 @@ class w {
|
|
|
1535
1541
|
return this.isAdvancedMarker(e) ? !0 : e.getVisible();
|
|
1536
1542
|
}
|
|
1537
1543
|
}
|
|
1538
|
-
class
|
|
1539
|
-
constructor({ markers: e, position:
|
|
1540
|
-
this.markers = [], e && (this.markers = e),
|
|
1544
|
+
class te {
|
|
1545
|
+
constructor({ markers: e, position: r }) {
|
|
1546
|
+
this.markers = [], e && (this.markers = e), r && (r instanceof google.maps.LatLng ? this._position = r : this._position = new google.maps.LatLng(r));
|
|
1541
1547
|
}
|
|
1542
1548
|
get bounds() {
|
|
1543
1549
|
if (this.markers.length === 0 && !this._position)
|
|
1544
1550
|
return;
|
|
1545
1551
|
const e = new google.maps.LatLngBounds(this._position, this._position);
|
|
1546
|
-
for (const
|
|
1547
|
-
e.extend(
|
|
1552
|
+
for (const r of this.markers)
|
|
1553
|
+
e.extend(b.getPosition(r));
|
|
1548
1554
|
return e;
|
|
1549
1555
|
}
|
|
1550
1556
|
get position() {
|
|
@@ -1554,7 +1560,7 @@ class ee {
|
|
|
1554
1560
|
* Get the count of **visible** markers.
|
|
1555
1561
|
*/
|
|
1556
1562
|
get count() {
|
|
1557
|
-
return this.markers.filter((e) =>
|
|
1563
|
+
return this.markers.filter((e) => b.getVisible(e)).length;
|
|
1558
1564
|
}
|
|
1559
1565
|
/**
|
|
1560
1566
|
* Add a marker to the cluster.
|
|
@@ -1566,32 +1572,32 @@ class ee {
|
|
|
1566
1572
|
* Cleanup references and remove marker from map.
|
|
1567
1573
|
*/
|
|
1568
1574
|
delete() {
|
|
1569
|
-
this.marker && (
|
|
1575
|
+
this.marker && (b.setMap(this.marker, null), this.marker = void 0), this.markers.length = 0;
|
|
1570
1576
|
}
|
|
1571
1577
|
}
|
|
1572
|
-
function
|
|
1573
|
-
if (
|
|
1578
|
+
function q(t, e = "assertion failed") {
|
|
1579
|
+
if (t == null)
|
|
1574
1580
|
throw Error(e);
|
|
1575
1581
|
}
|
|
1576
|
-
const
|
|
1577
|
-
const s =
|
|
1578
|
-
|
|
1579
|
-
const o =
|
|
1580
|
-
return
|
|
1581
|
-
},
|
|
1582
|
-
const { northEast: n, southWest: s } =
|
|
1583
|
-
return
|
|
1584
|
-
},
|
|
1585
|
-
const n =
|
|
1582
|
+
const Or = (t, e, r, n) => {
|
|
1583
|
+
const s = t.getBounds();
|
|
1584
|
+
q(s);
|
|
1585
|
+
const o = lt(s, e, n);
|
|
1586
|
+
return r.filter((i) => o.contains(b.getPosition(i)));
|
|
1587
|
+
}, lt = (t, e, r) => {
|
|
1588
|
+
const { northEast: n, southWest: s } = Sr(t, e), o = Tr({ northEast: n, southWest: s }, r);
|
|
1589
|
+
return Pr(o, e);
|
|
1590
|
+
}, Mr = (t, e, r) => {
|
|
1591
|
+
const n = lt(t, e, r), s = n.getNorthEast(), o = n.getSouthWest();
|
|
1586
1592
|
return [o.lng(), o.lat(), s.lng(), s.lat()];
|
|
1587
|
-
},
|
|
1588
|
-
const
|
|
1589
|
-
return
|
|
1590
|
-
},
|
|
1591
|
-
const n =
|
|
1593
|
+
}, Sr = (t, e) => {
|
|
1594
|
+
const r = e.fromLatLngToDivPixel(t.getNorthEast()), n = e.fromLatLngToDivPixel(t.getSouthWest());
|
|
1595
|
+
return q(r), q(n), { northEast: r, southWest: n };
|
|
1596
|
+
}, Tr = ({ northEast: t, southWest: e }, r) => (t.x += r, t.y -= r, e.x -= r, e.y += r, { northEast: t, southWest: e }), Pr = ({ northEast: t, southWest: e }, r) => {
|
|
1597
|
+
const n = r.fromDivPixelToLatLng(e), s = r.fromDivPixelToLatLng(t);
|
|
1592
1598
|
return new google.maps.LatLngBounds(n, s);
|
|
1593
1599
|
};
|
|
1594
|
-
class
|
|
1600
|
+
class ut {
|
|
1595
1601
|
constructor({ maxZoom: e = 16 }) {
|
|
1596
1602
|
this.maxZoom = e;
|
|
1597
1603
|
}
|
|
@@ -1608,47 +1614,47 @@ class rt {
|
|
|
1608
1614
|
* ```
|
|
1609
1615
|
*/
|
|
1610
1616
|
noop({ markers: e }) {
|
|
1611
|
-
return
|
|
1617
|
+
return qr(e);
|
|
1612
1618
|
}
|
|
1613
1619
|
}
|
|
1614
|
-
class
|
|
1620
|
+
class Ar extends ut {
|
|
1615
1621
|
constructor(e) {
|
|
1616
|
-
var { viewportPadding:
|
|
1617
|
-
super(n), this.viewportPadding = 60, this.viewportPadding =
|
|
1622
|
+
var { viewportPadding: r = 60 } = e, n = Te(e, ["viewportPadding"]);
|
|
1623
|
+
super(n), this.viewportPadding = 60, this.viewportPadding = r;
|
|
1618
1624
|
}
|
|
1619
|
-
calculate({ markers: e, map:
|
|
1620
|
-
const s =
|
|
1621
|
-
return
|
|
1625
|
+
calculate({ markers: e, map: r, mapCanvasProjection: n }) {
|
|
1626
|
+
const s = r.getZoom();
|
|
1627
|
+
return q(s), s >= this.maxZoom ? {
|
|
1622
1628
|
clusters: this.noop({
|
|
1623
1629
|
markers: e
|
|
1624
1630
|
}),
|
|
1625
1631
|
changed: !1
|
|
1626
1632
|
} : {
|
|
1627
1633
|
clusters: this.cluster({
|
|
1628
|
-
markers:
|
|
1629
|
-
map:
|
|
1634
|
+
markers: Or(r, n, e, this.viewportPadding),
|
|
1635
|
+
map: r,
|
|
1630
1636
|
mapCanvasProjection: n
|
|
1631
1637
|
})
|
|
1632
1638
|
};
|
|
1633
1639
|
}
|
|
1634
1640
|
}
|
|
1635
|
-
const
|
|
1636
|
-
position:
|
|
1637
|
-
markers: [
|
|
1641
|
+
const qr = (t) => t.map((r) => new te({
|
|
1642
|
+
position: b.getPosition(r),
|
|
1643
|
+
markers: [r]
|
|
1638
1644
|
}));
|
|
1639
|
-
class
|
|
1645
|
+
class Lr extends ut {
|
|
1640
1646
|
constructor(e) {
|
|
1641
|
-
var { maxZoom:
|
|
1642
|
-
super({ maxZoom:
|
|
1647
|
+
var { maxZoom: r, radius: n = 60 } = e, s = Te(e, ["maxZoom", "radius"]);
|
|
1648
|
+
super({ maxZoom: r }), this.markers = [], this.clusters = [], this.state = { zoom: -1 }, this.superCluster = new at(Object.assign({ maxZoom: this.maxZoom, radius: n }, s));
|
|
1643
1649
|
}
|
|
1644
1650
|
calculate(e) {
|
|
1645
|
-
let
|
|
1646
|
-
|
|
1651
|
+
let r = !1, n = e.map.getZoom();
|
|
1652
|
+
q(n), n = Math.round(n);
|
|
1647
1653
|
const s = { zoom: n };
|
|
1648
|
-
if (!
|
|
1649
|
-
|
|
1654
|
+
if (!le(e.markers, this.markers)) {
|
|
1655
|
+
r = !0, this.markers = [...e.markers];
|
|
1650
1656
|
const o = this.markers.map((i) => {
|
|
1651
|
-
const l =
|
|
1657
|
+
const l = b.getPosition(i);
|
|
1652
1658
|
return {
|
|
1653
1659
|
type: "Feature",
|
|
1654
1660
|
geometry: { type: "Point", coordinates: [l.lng(), l.lat()] },
|
|
@@ -1657,37 +1663,37 @@ class Cr extends rt {
|
|
|
1657
1663
|
});
|
|
1658
1664
|
this.superCluster.load(o);
|
|
1659
1665
|
}
|
|
1660
|
-
return
|
|
1666
|
+
return r || (this.state.zoom <= this.maxZoom || s.zoom <= this.maxZoom) && (r = !le(this.state, s)), this.state = s, e.markers.length === 0 ? (this.clusters = [], { clusters: this.clusters, changed: r }) : (r && (this.clusters = this.cluster(e)), { clusters: this.clusters, changed: r });
|
|
1661
1667
|
}
|
|
1662
1668
|
cluster({ map: e }) {
|
|
1663
|
-
const
|
|
1664
|
-
return
|
|
1669
|
+
const r = e.getZoom();
|
|
1670
|
+
return q(r), this.superCluster.getClusters([-180, -90, 180, 90], Math.round(r)).map((n) => this.transformCluster(n));
|
|
1665
1671
|
}
|
|
1666
|
-
transformCluster({ geometry: { coordinates: [e,
|
|
1672
|
+
transformCluster({ geometry: { coordinates: [e, r] }, properties: n }) {
|
|
1667
1673
|
if (n.cluster)
|
|
1668
|
-
return new
|
|
1674
|
+
return new te({
|
|
1669
1675
|
markers: this.superCluster.getLeaves(n.cluster_id, 1 / 0).map((o) => o.properties.marker),
|
|
1670
|
-
position: { lat:
|
|
1676
|
+
position: { lat: r, lng: e }
|
|
1671
1677
|
});
|
|
1672
1678
|
const s = n.marker;
|
|
1673
|
-
return new
|
|
1679
|
+
return new te({
|
|
1674
1680
|
markers: [s],
|
|
1675
|
-
position:
|
|
1681
|
+
position: b.getPosition(s)
|
|
1676
1682
|
});
|
|
1677
1683
|
}
|
|
1678
1684
|
}
|
|
1679
|
-
class
|
|
1685
|
+
class xr extends Ar {
|
|
1680
1686
|
constructor(e) {
|
|
1681
|
-
var { maxZoom:
|
|
1682
|
-
super({ maxZoom:
|
|
1687
|
+
var { maxZoom: r, radius: n = 60, viewportPadding: s = 60 } = e, o = Te(e, ["maxZoom", "radius", "viewportPadding"]);
|
|
1688
|
+
super({ maxZoom: r, viewportPadding: s }), this.markers = [], this.clusters = [], this.superCluster = new at(Object.assign({ maxZoom: this.maxZoom, radius: n }, o)), this.state = { zoom: -1, view: [0, 0, 0, 0] };
|
|
1683
1689
|
}
|
|
1684
1690
|
calculate(e) {
|
|
1685
|
-
const
|
|
1686
|
-
let n = !
|
|
1687
|
-
if (!
|
|
1691
|
+
const r = this.getViewportState(e);
|
|
1692
|
+
let n = !le(this.state, r);
|
|
1693
|
+
if (!le(e.markers, this.markers)) {
|
|
1688
1694
|
n = !0, this.markers = [...e.markers];
|
|
1689
1695
|
const s = this.markers.map((o) => {
|
|
1690
|
-
const i =
|
|
1696
|
+
const i = b.getPosition(o);
|
|
1691
1697
|
return {
|
|
1692
1698
|
type: "Feature",
|
|
1693
1699
|
geometry: {
|
|
@@ -1699,40 +1705,40 @@ class Or extends wr {
|
|
|
1699
1705
|
});
|
|
1700
1706
|
this.superCluster.load(s);
|
|
1701
1707
|
}
|
|
1702
|
-
return n && (this.clusters = this.cluster(e), this.state =
|
|
1708
|
+
return n && (this.clusters = this.cluster(e), this.state = r), { clusters: this.clusters, changed: n };
|
|
1703
1709
|
}
|
|
1704
1710
|
cluster(e) {
|
|
1705
|
-
const
|
|
1706
|
-
return this.superCluster.getClusters(
|
|
1711
|
+
const r = this.getViewportState(e);
|
|
1712
|
+
return this.superCluster.getClusters(r.view, r.zoom).map((n) => this.transformCluster(n));
|
|
1707
1713
|
}
|
|
1708
|
-
transformCluster({ geometry: { coordinates: [e,
|
|
1714
|
+
transformCluster({ geometry: { coordinates: [e, r] }, properties: n }) {
|
|
1709
1715
|
if (n.cluster)
|
|
1710
|
-
return new
|
|
1716
|
+
return new te({
|
|
1711
1717
|
markers: this.superCluster.getLeaves(n.cluster_id, 1 / 0).map((o) => o.properties.marker),
|
|
1712
|
-
position: { lat:
|
|
1718
|
+
position: { lat: r, lng: e }
|
|
1713
1719
|
});
|
|
1714
1720
|
const s = n.marker;
|
|
1715
|
-
return new
|
|
1721
|
+
return new te({
|
|
1716
1722
|
markers: [s],
|
|
1717
|
-
position:
|
|
1723
|
+
position: b.getPosition(s)
|
|
1718
1724
|
});
|
|
1719
1725
|
}
|
|
1720
1726
|
getViewportState(e) {
|
|
1721
|
-
const
|
|
1722
|
-
return
|
|
1723
|
-
zoom: Math.round(
|
|
1724
|
-
view:
|
|
1727
|
+
const r = e.map.getZoom(), n = e.map.getBounds();
|
|
1728
|
+
return q(r), q(n), {
|
|
1729
|
+
zoom: Math.round(r),
|
|
1730
|
+
view: Mr(n, e.mapCanvasProjection, this.viewportPadding)
|
|
1725
1731
|
};
|
|
1726
1732
|
}
|
|
1727
1733
|
}
|
|
1728
|
-
class
|
|
1729
|
-
constructor(e,
|
|
1734
|
+
class jr {
|
|
1735
|
+
constructor(e, r) {
|
|
1730
1736
|
this.markers = { sum: e.length };
|
|
1731
|
-
const n =
|
|
1737
|
+
const n = r.map((o) => o.count), s = n.reduce((o, i) => o + i, 0);
|
|
1732
1738
|
this.clusters = {
|
|
1733
|
-
count:
|
|
1739
|
+
count: r.length,
|
|
1734
1740
|
markers: {
|
|
1735
|
-
mean: s /
|
|
1741
|
+
mean: s / r.length,
|
|
1736
1742
|
sum: s,
|
|
1737
1743
|
min: Math.min(...n),
|
|
1738
1744
|
max: Math.max(...n)
|
|
@@ -1740,7 +1746,7 @@ class Mr {
|
|
|
1740
1746
|
};
|
|
1741
1747
|
}
|
|
1742
1748
|
}
|
|
1743
|
-
class
|
|
1749
|
+
class Ir {
|
|
1744
1750
|
/**
|
|
1745
1751
|
* The default render function for the library used by {@link MarkerClusterer}.
|
|
1746
1752
|
*
|
|
@@ -1779,19 +1785,19 @@ class Pr {
|
|
|
1779
1785
|
* });
|
|
1780
1786
|
* ```
|
|
1781
1787
|
*/
|
|
1782
|
-
render({ count: e, position:
|
|
1788
|
+
render({ count: e, position: r }, n, s) {
|
|
1783
1789
|
const i = `<svg fill="${e > Math.max(10, n.clusters.markers.mean) ? "#ff0000" : "#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">
|
|
1784
1790
|
<circle cx="120" cy="120" opacity=".6" r="70" />
|
|
1785
1791
|
<circle cx="120" cy="120" opacity=".3" r="90" />
|
|
1786
1792
|
<circle cx="120" cy="120" opacity=".2" r="110" />
|
|
1787
1793
|
<text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-family="roboto,arial,sans-serif">${e}</text>
|
|
1788
1794
|
</svg>`, l = `Cluster of ${e} markers`, a = Number(google.maps.Marker.MAX_ZINDEX) + e;
|
|
1789
|
-
if (
|
|
1795
|
+
if (b.isAdvancedMarkerAvailable(s)) {
|
|
1790
1796
|
const u = new DOMParser().parseFromString(i, "image/svg+xml").documentElement;
|
|
1791
1797
|
u.setAttribute("transform", "translate(0 25)");
|
|
1792
1798
|
const f = {
|
|
1793
1799
|
map: s,
|
|
1794
|
-
position:
|
|
1800
|
+
position: r,
|
|
1795
1801
|
zIndex: a,
|
|
1796
1802
|
title: l,
|
|
1797
1803
|
content: u
|
|
@@ -1799,7 +1805,7 @@ class Pr {
|
|
|
1799
1805
|
return new google.maps.marker.AdvancedMarkerElement(f);
|
|
1800
1806
|
}
|
|
1801
1807
|
const c = {
|
|
1802
|
-
position:
|
|
1808
|
+
position: r,
|
|
1803
1809
|
zIndex: a,
|
|
1804
1810
|
title: l,
|
|
1805
1811
|
icon: {
|
|
@@ -1810,43 +1816,43 @@ class Pr {
|
|
|
1810
1816
|
return new google.maps.Marker(c);
|
|
1811
1817
|
}
|
|
1812
1818
|
}
|
|
1813
|
-
function
|
|
1814
|
-
for (let
|
|
1815
|
-
|
|
1819
|
+
function Rr(t, e) {
|
|
1820
|
+
for (let r in e.prototype)
|
|
1821
|
+
t.prototype[r] = e.prototype[r];
|
|
1816
1822
|
}
|
|
1817
|
-
class
|
|
1823
|
+
class Pe {
|
|
1818
1824
|
constructor() {
|
|
1819
|
-
|
|
1825
|
+
Rr(Pe, google.maps.OverlayView);
|
|
1820
1826
|
}
|
|
1821
1827
|
}
|
|
1822
1828
|
var I;
|
|
1823
|
-
(function(
|
|
1824
|
-
|
|
1829
|
+
(function(t) {
|
|
1830
|
+
t.CLUSTERING_BEGIN = "clusteringbegin", t.CLUSTERING_END = "clusteringend", t.CLUSTER_CLICK = "click", t.GMP_CLICK = "gmp-click";
|
|
1825
1831
|
})(I || (I = {}));
|
|
1826
|
-
const
|
|
1827
|
-
e.bounds &&
|
|
1832
|
+
const $r = (t, e, r) => {
|
|
1833
|
+
e.bounds && r.fitBounds(e.bounds);
|
|
1828
1834
|
};
|
|
1829
|
-
class
|
|
1830
|
-
constructor({ map: e, markers:
|
|
1831
|
-
super(), this.map = null, this.idleListener = null, this.markers = [...
|
|
1835
|
+
class Nr extends Pe {
|
|
1836
|
+
constructor({ map: e, markers: r = [], algorithmOptions: n = {}, algorithm: s = new Lr(n), renderer: o = new Ir(), onClusterClick: i = $r }) {
|
|
1837
|
+
super(), this.map = null, this.idleListener = null, this.markers = [...r], this.clusters = [], this.algorithm = s, this.renderer = o, this.onClusterClick = i, e && this.setMap(e);
|
|
1832
1838
|
}
|
|
1833
|
-
addMarker(e,
|
|
1834
|
-
this.markers.includes(e) || (this.markers.push(e),
|
|
1839
|
+
addMarker(e, r) {
|
|
1840
|
+
this.markers.includes(e) || (this.markers.push(e), r || this.render());
|
|
1835
1841
|
}
|
|
1836
|
-
addMarkers(e,
|
|
1842
|
+
addMarkers(e, r) {
|
|
1837
1843
|
e.forEach((n) => {
|
|
1838
1844
|
this.addMarker(n, !0);
|
|
1839
|
-
}),
|
|
1845
|
+
}), r || this.render();
|
|
1840
1846
|
}
|
|
1841
|
-
removeMarker(e,
|
|
1847
|
+
removeMarker(e, r) {
|
|
1842
1848
|
const n = this.markers.indexOf(e);
|
|
1843
|
-
return n === -1 ? !1 : (
|
|
1849
|
+
return n === -1 ? !1 : (b.setMap(e, null), this.markers.splice(n, 1), r || this.render(), !0);
|
|
1844
1850
|
}
|
|
1845
|
-
removeMarkers(e,
|
|
1851
|
+
removeMarkers(e, r) {
|
|
1846
1852
|
let n = !1;
|
|
1847
1853
|
return e.forEach((s) => {
|
|
1848
1854
|
n = this.removeMarker(s, !0) || n;
|
|
1849
|
-
}), n && !
|
|
1855
|
+
}), n && !r && this.render(), n;
|
|
1850
1856
|
}
|
|
1851
1857
|
clearMarkers(e) {
|
|
1852
1858
|
this.markers.length = 0, e || this.render();
|
|
@@ -1858,75 +1864,233 @@ class Ar extends Me {
|
|
|
1858
1864
|
const e = this.getMap();
|
|
1859
1865
|
if (e instanceof google.maps.Map && e.getProjection()) {
|
|
1860
1866
|
google.maps.event.trigger(this, I.CLUSTERING_BEGIN, this);
|
|
1861
|
-
const { clusters:
|
|
1867
|
+
const { clusters: r, changed: n } = this.algorithm.calculate({
|
|
1862
1868
|
markers: this.markers,
|
|
1863
1869
|
map: e,
|
|
1864
1870
|
mapCanvasProjection: this.getProjection()
|
|
1865
1871
|
});
|
|
1866
1872
|
if (n || n == null) {
|
|
1867
1873
|
const s = /* @__PURE__ */ new Set();
|
|
1868
|
-
for (const i of
|
|
1874
|
+
for (const i of r)
|
|
1869
1875
|
i.markers.length == 1 && s.add(i.markers[0]);
|
|
1870
1876
|
const o = [];
|
|
1871
1877
|
for (const i of this.clusters)
|
|
1872
|
-
i.marker != null && (i.markers.length == 1 ? s.has(i.marker) ||
|
|
1873
|
-
this.clusters =
|
|
1878
|
+
i.marker != null && (i.markers.length == 1 ? s.has(i.marker) || b.setMap(i.marker, null) : o.push(i.marker));
|
|
1879
|
+
this.clusters = r, this.renderClusters(), requestAnimationFrame(() => o.forEach((i) => b.setMap(i, null)));
|
|
1874
1880
|
}
|
|
1875
1881
|
google.maps.event.trigger(this, I.CLUSTERING_END, this);
|
|
1876
1882
|
}
|
|
1877
1883
|
}
|
|
1878
1884
|
onAdd() {
|
|
1879
1885
|
const e = this.getMap();
|
|
1880
|
-
|
|
1886
|
+
q(e), this.idleListener = e.addListener("idle", this.render.bind(this)), this.render();
|
|
1881
1887
|
}
|
|
1882
1888
|
onRemove() {
|
|
1883
1889
|
this.idleListener && google.maps.event.removeListener(this.idleListener), this.reset();
|
|
1884
1890
|
}
|
|
1885
1891
|
reset() {
|
|
1886
|
-
this.markers.forEach((e) =>
|
|
1892
|
+
this.markers.forEach((e) => b.setMap(e, null)), this.clusters.forEach((e) => e.delete()), this.clusters = [];
|
|
1887
1893
|
}
|
|
1888
1894
|
renderClusters() {
|
|
1889
|
-
const e = new
|
|
1895
|
+
const e = new jr(this.markers, this.clusters), r = this.getMap();
|
|
1890
1896
|
this.clusters.forEach((n) => {
|
|
1891
1897
|
if (n.markers.length === 1)
|
|
1892
1898
|
n.marker = n.markers[0];
|
|
1893
|
-
else if (n.marker = this.renderer.render(n, e,
|
|
1894
|
-
const s =
|
|
1899
|
+
else if (n.marker = this.renderer.render(n, e, r), n.markers.forEach((s) => b.setMap(s, null)), this.onClusterClick) {
|
|
1900
|
+
const s = b.isAdvancedMarker(n.marker) ? I.GMP_CLICK : I.CLUSTER_CLICK;
|
|
1895
1901
|
n.marker.addListener(
|
|
1896
1902
|
s,
|
|
1897
1903
|
/* istanbul ignore next */
|
|
1898
1904
|
(o) => {
|
|
1899
|
-
google.maps.event.trigger(this, I.CLUSTER_CLICK, n), this.onClusterClick(o, n,
|
|
1905
|
+
google.maps.event.trigger(this, I.CLUSTER_CLICK, n), this.onClusterClick(o, n, r);
|
|
1900
1906
|
}
|
|
1901
1907
|
);
|
|
1902
1908
|
}
|
|
1903
|
-
|
|
1909
|
+
b.setMap(n.marker, r);
|
|
1904
1910
|
});
|
|
1905
1911
|
}
|
|
1906
1912
|
}
|
|
1907
|
-
|
|
1913
|
+
function Ee(t) {
|
|
1914
|
+
var e = typeof t;
|
|
1915
|
+
return t != null && (e == "object" || e == "function");
|
|
1916
|
+
}
|
|
1917
|
+
var Br = typeof global == "object" && global && global.Object === Object && global;
|
|
1918
|
+
const Dr = Br;
|
|
1919
|
+
var Zr = typeof self == "object" && self && self.Object === Object && self, Gr = Dr || Zr || Function("return this")();
|
|
1920
|
+
const ct = Gr;
|
|
1921
|
+
var Ur = function() {
|
|
1922
|
+
return ct.Date.now();
|
|
1923
|
+
};
|
|
1924
|
+
const ve = Ur;
|
|
1925
|
+
var Fr = /\s/;
|
|
1926
|
+
function Vr(t) {
|
|
1927
|
+
for (var e = t.length; e-- && Fr.test(t.charAt(e)); )
|
|
1928
|
+
;
|
|
1929
|
+
return e;
|
|
1930
|
+
}
|
|
1931
|
+
var zr = /^\s+/;
|
|
1932
|
+
function Wr(t) {
|
|
1933
|
+
return t && t.slice(0, Vr(t) + 1).replace(zr, "");
|
|
1934
|
+
}
|
|
1935
|
+
var Hr = ct.Symbol;
|
|
1936
|
+
const ue = Hr;
|
|
1937
|
+
var dt = Object.prototype, Kr = dt.hasOwnProperty, Xr = dt.toString, Q = ue ? ue.toStringTag : void 0;
|
|
1938
|
+
function Yr(t) {
|
|
1939
|
+
var e = Kr.call(t, Q), r = t[Q];
|
|
1940
|
+
try {
|
|
1941
|
+
t[Q] = void 0;
|
|
1942
|
+
var n = !0;
|
|
1943
|
+
} catch {
|
|
1944
|
+
}
|
|
1945
|
+
var s = Xr.call(t);
|
|
1946
|
+
return n && (e ? t[Q] = r : delete t[Q]), s;
|
|
1947
|
+
}
|
|
1948
|
+
var Jr = Object.prototype, Qr = Jr.toString;
|
|
1949
|
+
function en(t) {
|
|
1950
|
+
return Qr.call(t);
|
|
1951
|
+
}
|
|
1952
|
+
var tn = "[object Null]", rn = "[object Undefined]", Ye = ue ? ue.toStringTag : void 0;
|
|
1953
|
+
function nn(t) {
|
|
1954
|
+
return t == null ? t === void 0 ? rn : tn : Ye && Ye in Object(t) ? Yr(t) : en(t);
|
|
1955
|
+
}
|
|
1956
|
+
function sn(t) {
|
|
1957
|
+
return t != null && typeof t == "object";
|
|
1958
|
+
}
|
|
1959
|
+
var on = "[object Symbol]";
|
|
1960
|
+
function an(t) {
|
|
1961
|
+
return typeof t == "symbol" || sn(t) && nn(t) == on;
|
|
1962
|
+
}
|
|
1963
|
+
var Je = 0 / 0, ln = /^[-+]0x[0-9a-f]+$/i, un = /^0b[01]+$/i, cn = /^0o[0-7]+$/i, dn = parseInt;
|
|
1964
|
+
function Qe(t) {
|
|
1965
|
+
if (typeof t == "number")
|
|
1966
|
+
return t;
|
|
1967
|
+
if (an(t))
|
|
1968
|
+
return Je;
|
|
1969
|
+
if (Ee(t)) {
|
|
1970
|
+
var e = typeof t.valueOf == "function" ? t.valueOf() : t;
|
|
1971
|
+
t = Ee(e) ? e + "" : e;
|
|
1972
|
+
}
|
|
1973
|
+
if (typeof t != "string")
|
|
1974
|
+
return t === 0 ? t : +t;
|
|
1975
|
+
t = Wr(t);
|
|
1976
|
+
var r = un.test(t);
|
|
1977
|
+
return r || cn.test(t) ? dn(t.slice(2), r ? 2 : 8) : ln.test(t) ? Je : +t;
|
|
1978
|
+
}
|
|
1979
|
+
var pn = "Expected a function", fn = Math.max, mn = Math.min;
|
|
1980
|
+
function hn(t, e, r) {
|
|
1981
|
+
var n, s, o, i, l, a, c = 0, p = !1, u = !1, f = !0;
|
|
1982
|
+
if (typeof t != "function")
|
|
1983
|
+
throw new TypeError(pn);
|
|
1984
|
+
e = Qe(e) || 0, Ee(r) && (p = !!r.leading, u = "maxWait" in r, o = u ? fn(Qe(r.maxWait) || 0, e) : o, f = "trailing" in r ? !!r.trailing : f);
|
|
1985
|
+
function m(E) {
|
|
1986
|
+
var k = n, M = s;
|
|
1987
|
+
return n = s = void 0, c = E, i = t.apply(M, k), i;
|
|
1988
|
+
}
|
|
1989
|
+
function h(E) {
|
|
1990
|
+
return c = E, l = setTimeout(v, e), p ? m(E) : i;
|
|
1991
|
+
}
|
|
1992
|
+
function d(E) {
|
|
1993
|
+
var k = E - a, M = E - c, L = e - k;
|
|
1994
|
+
return u ? mn(L, o - M) : L;
|
|
1995
|
+
}
|
|
1996
|
+
function g(E) {
|
|
1997
|
+
var k = E - a, M = E - c;
|
|
1998
|
+
return a === void 0 || k >= e || k < 0 || u && M >= o;
|
|
1999
|
+
}
|
|
2000
|
+
function v() {
|
|
2001
|
+
var E = ve();
|
|
2002
|
+
if (g(E))
|
|
2003
|
+
return y(E);
|
|
2004
|
+
l = setTimeout(v, d(E));
|
|
2005
|
+
}
|
|
2006
|
+
function y(E) {
|
|
2007
|
+
return l = void 0, f && n ? m(E) : (n = s = void 0, i);
|
|
2008
|
+
}
|
|
2009
|
+
function w() {
|
|
2010
|
+
l !== void 0 && clearTimeout(l), c = 0, n = a = s = l = void 0;
|
|
2011
|
+
}
|
|
2012
|
+
function P() {
|
|
2013
|
+
return l === void 0 ? i : y(ve());
|
|
2014
|
+
}
|
|
2015
|
+
function O() {
|
|
2016
|
+
var E = ve(), k = g(E);
|
|
2017
|
+
if (n = arguments, s = this, a = E, k) {
|
|
2018
|
+
if (l === void 0)
|
|
2019
|
+
return h(a);
|
|
2020
|
+
if (u)
|
|
2021
|
+
return clearTimeout(l), l = setTimeout(v, e), m(a);
|
|
2022
|
+
}
|
|
2023
|
+
return l === void 0 && (l = setTimeout(v, e)), i;
|
|
2024
|
+
}
|
|
2025
|
+
return O.cancel = w, O.flush = P, O;
|
|
2026
|
+
}
|
|
2027
|
+
class gn extends Nr {
|
|
2028
|
+
constructor(r, n = 10) {
|
|
2029
|
+
super(r);
|
|
2030
|
+
se(this, "debouncedRender");
|
|
2031
|
+
this.debouncedRender = hn(
|
|
2032
|
+
() => {
|
|
2033
|
+
super.render();
|
|
2034
|
+
},
|
|
2035
|
+
n,
|
|
2036
|
+
{ leading: !0, trailing: !0 }
|
|
2037
|
+
);
|
|
2038
|
+
}
|
|
2039
|
+
addMarker(r, n) {
|
|
2040
|
+
super.addMarker(r, !0), n || this.debouncedRender();
|
|
2041
|
+
}
|
|
2042
|
+
removeMarker(r, n) {
|
|
2043
|
+
const s = super.removeMarker(r, !0);
|
|
2044
|
+
return n || this.debouncedRender(), s;
|
|
2045
|
+
}
|
|
2046
|
+
addMarkers(r, n) {
|
|
2047
|
+
super.addMarkers(r, !0), n || this.debouncedRender();
|
|
2048
|
+
}
|
|
2049
|
+
removeMarkers(r, n) {
|
|
2050
|
+
const s = super.removeMarkers(r, !0);
|
|
2051
|
+
return n || this.debouncedRender(), s;
|
|
2052
|
+
}
|
|
2053
|
+
clearMarkers(r) {
|
|
2054
|
+
super.clearMarkers(!0), r || this.debouncedRender();
|
|
2055
|
+
}
|
|
2056
|
+
/** Renders immediately, canceling any pending debounced render. */
|
|
2057
|
+
render() {
|
|
2058
|
+
this.debouncedRender.cancel(), super.render();
|
|
2059
|
+
}
|
|
2060
|
+
destroy() {
|
|
2061
|
+
this.debouncedRender.cancel();
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
const et = Object.values(I), Ln = T({
|
|
1908
2065
|
name: "MarkerCluster",
|
|
1909
2066
|
props: {
|
|
1910
2067
|
options: {
|
|
1911
2068
|
type: Object,
|
|
1912
2069
|
default: () => ({})
|
|
2070
|
+
},
|
|
2071
|
+
renderDebounceDelay: {
|
|
2072
|
+
type: Number,
|
|
2073
|
+
default: 10
|
|
1913
2074
|
}
|
|
1914
2075
|
},
|
|
1915
|
-
emits:
|
|
1916
|
-
setup(
|
|
1917
|
-
const s =
|
|
1918
|
-
return U(
|
|
2076
|
+
emits: et,
|
|
2077
|
+
setup(t, { emit: e, expose: r, slots: n }) {
|
|
2078
|
+
const s = _(), o = C(D, _()), i = C(Z, _());
|
|
2079
|
+
return U(Oe, s), S(
|
|
1919
2080
|
o,
|
|
1920
2081
|
() => {
|
|
1921
|
-
o.value && (s.value =
|
|
1922
|
-
new
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
2082
|
+
o.value && (s.value = A(
|
|
2083
|
+
new gn(
|
|
2084
|
+
{
|
|
2085
|
+
map: o.value,
|
|
2086
|
+
// Better perf than the default `SuperClusterAlgorithm`. See:
|
|
2087
|
+
// https://github.com/googlemaps/js-markerclusterer/pull/640
|
|
2088
|
+
algorithm: new xr(t.options.algorithmOptions ?? {}),
|
|
2089
|
+
...t.options
|
|
2090
|
+
},
|
|
2091
|
+
t.renderDebounceDelay
|
|
2092
|
+
)
|
|
2093
|
+
), et.forEach((l) => {
|
|
1930
2094
|
var a;
|
|
1931
2095
|
(a = s.value) == null || a.addListener(l, (c) => e(l, c));
|
|
1932
2096
|
}));
|
|
@@ -1934,15 +2098,15 @@ const We = Object.values(I), Fr = O({
|
|
|
1934
2098
|
{
|
|
1935
2099
|
immediate: !0
|
|
1936
2100
|
}
|
|
1937
|
-
),
|
|
2101
|
+
), B(() => {
|
|
1938
2102
|
var l;
|
|
1939
|
-
s.value && ((l = i.value) == null || l.event.clearInstanceListeners(s.value), s.value.clearMarkers(), s.value.setMap(null));
|
|
1940
|
-
}),
|
|
2103
|
+
s.value && ((l = i.value) == null || l.event.clearInstanceListeners(s.value), s.value.clearMarkers(!0), s.value.setMap(null), s.value.destroy());
|
|
2104
|
+
}), r({ markerCluster: s }), () => {
|
|
1941
2105
|
var l;
|
|
1942
2106
|
return (l = n.default) == null ? void 0 : l.call(n);
|
|
1943
2107
|
};
|
|
1944
2108
|
}
|
|
1945
|
-
}),
|
|
2109
|
+
}), vn = T({
|
|
1946
2110
|
inheritAttrs: !1,
|
|
1947
2111
|
props: {
|
|
1948
2112
|
options: {
|
|
@@ -1950,34 +2114,34 @@ const We = Object.values(I), Fr = O({
|
|
|
1950
2114
|
required: !0
|
|
1951
2115
|
}
|
|
1952
2116
|
},
|
|
1953
|
-
setup(
|
|
1954
|
-
const s =
|
|
2117
|
+
setup(t, { slots: e, emit: r, expose: n }) {
|
|
2118
|
+
const s = _(), o = W(() => {
|
|
1955
2119
|
var a;
|
|
1956
|
-
return (a = e.default) == null ? void 0 : a.call(e).some((c) => c.type !==
|
|
1957
|
-
}), i =
|
|
1958
|
-
...
|
|
2120
|
+
return (a = e.default) == null ? void 0 : a.call(e).some((c) => c.type !== we);
|
|
2121
|
+
}), i = W(() => ({
|
|
2122
|
+
...t.options,
|
|
1959
2123
|
element: s.value
|
|
1960
|
-
})), l =
|
|
2124
|
+
})), l = K(de, [], i, r);
|
|
1961
2125
|
return n({
|
|
1962
2126
|
customMarker: l
|
|
1963
2127
|
}), { customMarkerRef: s, customMarker: l, hasSlotContent: o };
|
|
1964
2128
|
}
|
|
1965
2129
|
});
|
|
1966
|
-
const
|
|
2130
|
+
const yn = {
|
|
1967
2131
|
key: 0,
|
|
1968
2132
|
class: "custom-marker-wrapper"
|
|
1969
2133
|
};
|
|
1970
|
-
function
|
|
1971
|
-
return
|
|
1972
|
-
|
|
2134
|
+
function _n(t, e, r, n, s, o) {
|
|
2135
|
+
return t.hasSlotContent ? (F(), V("div", yn, [
|
|
2136
|
+
ce("div", ke({
|
|
1973
2137
|
ref: "customMarkerRef",
|
|
1974
|
-
style: { cursor:
|
|
1975
|
-
},
|
|
1976
|
-
|
|
2138
|
+
style: { cursor: t.$attrs.onClick ? "pointer" : void 0 }
|
|
2139
|
+
}, t.$attrs), [
|
|
2140
|
+
z(t.$slots, "default", {}, void 0, !0)
|
|
1977
2141
|
], 16)
|
|
1978
|
-
])) :
|
|
2142
|
+
])) : be("", !0);
|
|
1979
2143
|
}
|
|
1980
|
-
const
|
|
2144
|
+
const xn = /* @__PURE__ */ re(vn, [["render", _n], ["__scopeId", "data-v-2d2d343a"]]), jn = T({
|
|
1981
2145
|
name: "HeatmapLayer",
|
|
1982
2146
|
props: {
|
|
1983
2147
|
options: {
|
|
@@ -1985,51 +2149,51 @@ const zr = /* @__PURE__ */ te(qr, [["render", Lr], ["__scopeId", "data-v-2d2d343
|
|
|
1985
2149
|
default: () => ({})
|
|
1986
2150
|
}
|
|
1987
2151
|
},
|
|
1988
|
-
setup(
|
|
1989
|
-
const e =
|
|
1990
|
-
return
|
|
1991
|
-
[
|
|
2152
|
+
setup(t) {
|
|
2153
|
+
const e = _(), r = C(D, _()), n = C(Z, _());
|
|
2154
|
+
return S(
|
|
2155
|
+
[r, () => t.options],
|
|
1992
2156
|
([s, o], [i, l]) => {
|
|
1993
|
-
const a = !
|
|
1994
|
-
if (
|
|
2157
|
+
const a = !ee(o, l) || r.value !== i;
|
|
2158
|
+
if (r.value && n.value && a) {
|
|
1995
2159
|
let c;
|
|
1996
2160
|
if (o.data && !(o.data instanceof n.value.MVCArray)) {
|
|
1997
|
-
const
|
|
2161
|
+
const p = n.value.LatLng, u = o.data.map((f) => f instanceof p || "location" in f && (f.location instanceof p || f.location === null) ? f : "location" in f ? { ...f, location: new p(f.location) } : new p(f));
|
|
1998
2162
|
c = {
|
|
1999
2163
|
...o,
|
|
2000
2164
|
data: u
|
|
2001
2165
|
};
|
|
2002
2166
|
} else
|
|
2003
2167
|
c = o;
|
|
2004
|
-
e.value ? e.value.setOptions(c) : e.value =
|
|
2168
|
+
e.value ? e.value.setOptions(c) : e.value = A(
|
|
2005
2169
|
new n.value.visualization.HeatmapLayer({
|
|
2006
2170
|
...c,
|
|
2007
|
-
map:
|
|
2171
|
+
map: r.value
|
|
2008
2172
|
})
|
|
2009
2173
|
);
|
|
2010
2174
|
}
|
|
2011
2175
|
},
|
|
2012
2176
|
{ immediate: !0 }
|
|
2013
|
-
),
|
|
2177
|
+
), B(() => {
|
|
2014
2178
|
e.value && e.value.setMap(null);
|
|
2015
2179
|
}), { heatmapLayer: e };
|
|
2016
2180
|
},
|
|
2017
2181
|
render: () => null
|
|
2018
2182
|
});
|
|
2019
2183
|
export {
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2184
|
+
Cn as AdvancedMarker,
|
|
2185
|
+
Pn as Circle,
|
|
2186
|
+
An as CustomControl,
|
|
2187
|
+
xn as CustomMarker,
|
|
2188
|
+
bn as GoogleMap,
|
|
2189
|
+
jn as HeatmapLayer,
|
|
2190
|
+
qn as InfoWindow,
|
|
2191
|
+
On as Marker,
|
|
2192
|
+
Ln as MarkerCluster,
|
|
2193
|
+
Sn as Polygon,
|
|
2194
|
+
Mn as Polyline,
|
|
2195
|
+
Tn as Rectangle,
|
|
2196
|
+
Z as apiSymbol,
|
|
2197
|
+
D as mapSymbol,
|
|
2198
|
+
rt as mapTilesLoadedSymbol
|
|
2035
2199
|
};
|