vue3-google-map 0.25.1 → 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 +24 -0
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +885 -727
- package/dist/index.umd.js +3 -3
- 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
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
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
import { defineComponent as
|
|
6
|
-
const
|
|
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
|
-
|
|
28
|
-
|
|
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,132 +356,132 @@ 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
|
|
368
|
+
const m = (d) => {
|
|
369
369
|
var g;
|
|
370
|
-
return
|
|
371
|
-
},
|
|
372
|
-
scaleControlOptions:
|
|
373
|
-
panControlOptions:
|
|
374
|
-
zoomControlOptions:
|
|
375
|
-
rotateControlOptions:
|
|
376
|
-
streetViewControlOptions:
|
|
377
|
-
fullscreenControlOptions:
|
|
378
|
-
cameraControlOptions:
|
|
379
|
-
disableDefaultUI:
|
|
370
|
+
return d ? { position: (g = o.value) == null ? void 0 : g.ControlPosition[d] } : {};
|
|
371
|
+
}, h = {
|
|
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
|
-
return { ...u, ...
|
|
382
|
-
}, a =
|
|
381
|
+
return { ...u, ...h };
|
|
382
|
+
}, a = S(
|
|
383
383
|
[o, s],
|
|
384
384
|
([u, f]) => {
|
|
385
|
-
const
|
|
386
|
-
|
|
385
|
+
const m = u, h = f;
|
|
386
|
+
m && h && (m.event.addListenerOnce(h, "tilesloaded", () => {
|
|
387
387
|
i.value = !0;
|
|
388
388
|
}), setTimeout(a, 0));
|
|
389
389
|
},
|
|
390
390
|
{ immediate: !0 }
|
|
391
391
|
), c = () => {
|
|
392
|
-
const { apiKey: u, region: f, version:
|
|
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
|
|
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
|
|
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 =
|
|
499
|
-
var
|
|
500
|
-
return (
|
|
501
|
-
}), i = R(
|
|
502
|
-
() => !!(u.value &&
|
|
496
|
+
emits: Le,
|
|
497
|
+
setup(t, { emit: e, expose: r, slots: n }) {
|
|
498
|
+
const s = _(), o = W(() => {
|
|
499
|
+
var m;
|
|
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 (
|
|
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
|
-
),
|
|
530
|
-
var
|
|
531
|
-
a.value && ((
|
|
532
|
-
}), U(
|
|
529
|
+
), B(() => {
|
|
530
|
+
var m, h;
|
|
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
|
|
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
|
-
n.value.controls[u].forEach((f,
|
|
714
|
-
f ===
|
|
715
|
-
}),
|
|
713
|
+
n.value.controls[u].forEach((f, m) => {
|
|
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,257 +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
|
-
},
|
|
768
|
-
s.value && (s.value.open({ map: i.value, anchor: a.value, ...
|
|
769
|
-
},
|
|
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
|
+
}, 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 ||
|
|
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
|
-
var
|
|
788
|
-
(
|
|
789
|
-
}), (
|
|
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))));
|
|
790
790
|
},
|
|
791
791
|
{
|
|
792
792
|
immediate: !0,
|
|
793
793
|
flush: "post"
|
|
794
794
|
}
|
|
795
|
-
),
|
|
795
|
+
), S(
|
|
796
796
|
a,
|
|
797
|
-
(
|
|
798
|
-
!s.value ||
|
|
797
|
+
(d, g) => {
|
|
798
|
+
!s.value || d === g || (c && (c.remove(), c = void 0), d && (c = d.addListener("click", () => m())));
|
|
799
799
|
},
|
|
800
800
|
{
|
|
801
801
|
flush: "post"
|
|
802
802
|
}
|
|
803
|
-
),
|
|
804
|
-
() =>
|
|
805
|
-
(
|
|
806
|
-
|
|
803
|
+
), S(
|
|
804
|
+
() => t.modelValue,
|
|
805
|
+
(d) => {
|
|
806
|
+
d !== p && (d ? m() : h());
|
|
807
807
|
}
|
|
808
808
|
);
|
|
809
|
-
}),
|
|
810
|
-
var
|
|
811
|
-
c && c.remove(), s.value && ((
|
|
812
|
-
}), n({ infoWindow: s, open:
|
|
809
|
+
}), B(() => {
|
|
810
|
+
var d;
|
|
811
|
+
c && c.remove(), s.value && ((d = l.value) == null || d.event.clearInstanceListeners(s.value), h());
|
|
812
|
+
}), n({ infoWindow: s, open: m, close: h }), { infoWindow: s, infoWindowRef: o, hasSlotContent: u, open: m, close: h };
|
|
813
813
|
}
|
|
814
814
|
});
|
|
815
|
-
const
|
|
815
|
+
const Dt = {
|
|
816
816
|
key: 0,
|
|
817
817
|
class: "info-window-wrapper"
|
|
818
818
|
};
|
|
819
|
-
function
|
|
820
|
-
return
|
|
821
|
-
|
|
822
|
-
|
|
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)
|
|
823
823
|
], 16)
|
|
824
|
-
])) :
|
|
824
|
+
])) : be("", !0);
|
|
825
825
|
}
|
|
826
|
-
const
|
|
827
|
-
var
|
|
828
|
-
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) {
|
|
829
829
|
return function(n, s, o) {
|
|
830
|
-
return
|
|
830
|
+
return t(n, s, o) && e(n, s, o);
|
|
831
831
|
};
|
|
832
832
|
}
|
|
833
|
-
function
|
|
834
|
-
return function(
|
|
835
|
-
if (!
|
|
836
|
-
return r
|
|
837
|
-
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);
|
|
838
838
|
if (i && l)
|
|
839
|
-
return i === n && l ===
|
|
840
|
-
o.set(
|
|
841
|
-
var a = r
|
|
842
|
-
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;
|
|
843
843
|
};
|
|
844
844
|
}
|
|
845
|
-
function
|
|
846
|
-
return
|
|
845
|
+
function De(t) {
|
|
846
|
+
return Gt(t).concat(Ut(t));
|
|
847
847
|
}
|
|
848
|
-
var
|
|
849
|
-
return
|
|
848
|
+
var Vt = Object.hasOwn || function(t, e) {
|
|
849
|
+
return Ft.call(t, e);
|
|
850
850
|
};
|
|
851
|
-
function
|
|
852
|
-
return
|
|
851
|
+
function G(t, e) {
|
|
852
|
+
return t === e || !t && !e && t !== t && e !== e;
|
|
853
853
|
}
|
|
854
|
-
var
|
|
855
|
-
function
|
|
856
|
-
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;
|
|
857
857
|
if (e.length !== n)
|
|
858
858
|
return !1;
|
|
859
859
|
for (; n-- > 0; )
|
|
860
|
-
if (!
|
|
860
|
+
if (!r.equals(t[n], e[n], n, n, t, e, r))
|
|
861
861
|
return !1;
|
|
862
862
|
return !0;
|
|
863
863
|
}
|
|
864
|
-
function
|
|
865
|
-
return
|
|
864
|
+
function Xt(t, e) {
|
|
865
|
+
return G(t.getTime(), e.getTime());
|
|
866
866
|
}
|
|
867
|
-
function
|
|
868
|
-
return
|
|
867
|
+
function Yt(t, e) {
|
|
868
|
+
return t.name === e.name && t.message === e.message && t.cause === e.cause && t.stack === e.stack;
|
|
869
869
|
}
|
|
870
|
-
function
|
|
871
|
-
return
|
|
870
|
+
function Jt(t, e) {
|
|
871
|
+
return t === e;
|
|
872
872
|
}
|
|
873
|
-
function
|
|
874
|
-
var n =
|
|
873
|
+
function Ue(t, e, r) {
|
|
874
|
+
var n = t.size;
|
|
875
875
|
if (n !== e.size)
|
|
876
876
|
return !1;
|
|
877
877
|
if (!n)
|
|
878
878
|
return !0;
|
|
879
|
-
for (var s = new Array(n), o =
|
|
880
|
-
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; ) {
|
|
881
881
|
if (s[u]) {
|
|
882
882
|
u++;
|
|
883
883
|
continue;
|
|
884
884
|
}
|
|
885
|
-
var f = i.value,
|
|
886
|
-
if (
|
|
887
|
-
|
|
885
|
+
var f = i.value, m = l.value;
|
|
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;
|
|
888
888
|
break;
|
|
889
889
|
}
|
|
890
890
|
u++;
|
|
891
891
|
}
|
|
892
|
-
if (!
|
|
892
|
+
if (!p)
|
|
893
893
|
return !1;
|
|
894
894
|
a++;
|
|
895
895
|
}
|
|
896
896
|
return !0;
|
|
897
897
|
}
|
|
898
|
-
var
|
|
899
|
-
function
|
|
900
|
-
var n =
|
|
901
|
-
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)
|
|
902
902
|
return !1;
|
|
903
903
|
for (; s-- > 0; )
|
|
904
|
-
if (!
|
|
904
|
+
if (!nt(t, e, r, n[s]))
|
|
905
905
|
return !1;
|
|
906
906
|
return !0;
|
|
907
907
|
}
|
|
908
|
-
function
|
|
909
|
-
var n =
|
|
910
|
-
if (
|
|
908
|
+
function X(t, e, r) {
|
|
909
|
+
var n = De(t), s = n.length;
|
|
910
|
+
if (De(e).length !== s)
|
|
911
911
|
return !1;
|
|
912
912
|
for (var o, i, l; s-- > 0; )
|
|
913
|
-
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)))
|
|
914
914
|
return !1;
|
|
915
915
|
return !0;
|
|
916
916
|
}
|
|
917
|
-
function
|
|
918
|
-
return
|
|
917
|
+
function tr(t, e) {
|
|
918
|
+
return G(t.valueOf(), e.valueOf());
|
|
919
919
|
}
|
|
920
|
-
function
|
|
921
|
-
return
|
|
920
|
+
function rr(t, e) {
|
|
921
|
+
return t.source === e.source && t.flags === e.flags;
|
|
922
922
|
}
|
|
923
|
-
function
|
|
924
|
-
var n =
|
|
923
|
+
function Fe(t, e, r) {
|
|
924
|
+
var n = t.size;
|
|
925
925
|
if (n !== e.size)
|
|
926
926
|
return !1;
|
|
927
927
|
if (!n)
|
|
928
928
|
return !0;
|
|
929
|
-
for (var s = new Array(n), o =
|
|
930
|
-
for (var a = e.values(), c = !1,
|
|
931
|
-
if (!s[
|
|
932
|
-
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;
|
|
933
933
|
break;
|
|
934
934
|
}
|
|
935
|
-
|
|
935
|
+
p++;
|
|
936
936
|
}
|
|
937
937
|
if (!c)
|
|
938
938
|
return !1;
|
|
939
939
|
}
|
|
940
940
|
return !0;
|
|
941
941
|
}
|
|
942
|
-
function
|
|
943
|
-
var
|
|
944
|
-
if (e.length !==
|
|
942
|
+
function nr(t, e) {
|
|
943
|
+
var r = t.length;
|
|
944
|
+
if (e.length !== r)
|
|
945
945
|
return !1;
|
|
946
|
-
for (;
|
|
947
|
-
if (r
|
|
946
|
+
for (; r-- > 0; )
|
|
947
|
+
if (t[r] !== e[r])
|
|
948
948
|
return !1;
|
|
949
949
|
return !0;
|
|
950
950
|
}
|
|
951
|
-
function
|
|
952
|
-
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;
|
|
953
953
|
}
|
|
954
|
-
function
|
|
955
|
-
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);
|
|
956
956
|
}
|
|
957
|
-
var
|
|
958
|
-
function
|
|
959
|
-
var e =
|
|
960
|
-
return function(
|
|
961
|
-
if (
|
|
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)
|
|
962
962
|
return !0;
|
|
963
|
-
if (
|
|
963
|
+
if (h == null || d == null)
|
|
964
964
|
return !1;
|
|
965
|
-
var v = typeof
|
|
966
|
-
if (v !== typeof
|
|
965
|
+
var v = typeof h;
|
|
966
|
+
if (v !== typeof d)
|
|
967
967
|
return !1;
|
|
968
968
|
if (v !== "object")
|
|
969
|
-
return v === "number" ? i(
|
|
970
|
-
var
|
|
971
|
-
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)
|
|
972
972
|
return !1;
|
|
973
|
-
if (
|
|
974
|
-
return l(
|
|
975
|
-
if (
|
|
976
|
-
return e(
|
|
977
|
-
if (
|
|
978
|
-
return u(
|
|
979
|
-
if (
|
|
980
|
-
return
|
|
981
|
-
if (
|
|
982
|
-
return c(
|
|
983
|
-
if (
|
|
984
|
-
return o(
|
|
985
|
-
if (
|
|
986
|
-
return
|
|
987
|
-
var
|
|
988
|
-
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;
|
|
989
989
|
};
|
|
990
990
|
}
|
|
991
|
-
function
|
|
992
|
-
var e =
|
|
993
|
-
areArraysEqual: n ?
|
|
994
|
-
areDatesEqual:
|
|
995
|
-
areErrorsEqual:
|
|
996
|
-
areFunctionsEqual:
|
|
997
|
-
areMapsEqual: n ?
|
|
998
|
-
areNumbersEqual:
|
|
999
|
-
areObjectsEqual: n ?
|
|
1000
|
-
arePrimitiveWrappersEqual:
|
|
1001
|
-
areRegExpsEqual:
|
|
1002
|
-
areSetsEqual: n ?
|
|
1003
|
-
areTypedArraysEqual: n ?
|
|
1004
|
-
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
|
|
1005
1005
|
};
|
|
1006
|
-
if (
|
|
1007
|
-
var o =
|
|
1008
|
-
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, {
|
|
1009
1009
|
areArraysEqual: o,
|
|
1010
1010
|
areMapsEqual: i,
|
|
1011
1011
|
areObjectsEqual: l,
|
|
@@ -1014,26 +1014,26 @@ function cr(r) {
|
|
|
1014
1014
|
}
|
|
1015
1015
|
return s;
|
|
1016
1016
|
}
|
|
1017
|
-
function
|
|
1018
|
-
return function(e,
|
|
1019
|
-
return
|
|
1017
|
+
function Er(t) {
|
|
1018
|
+
return function(e, r, n, s, o, i, l) {
|
|
1019
|
+
return t(e, r, l);
|
|
1020
1020
|
};
|
|
1021
1021
|
}
|
|
1022
|
-
function
|
|
1023
|
-
var e =
|
|
1022
|
+
function wr(t) {
|
|
1023
|
+
var e = t.circular, r = t.comparator, n = t.createState, s = t.equals, o = t.strict;
|
|
1024
1024
|
if (n)
|
|
1025
1025
|
return function(a, c) {
|
|
1026
|
-
var
|
|
1027
|
-
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, {
|
|
1028
1028
|
cache: f,
|
|
1029
1029
|
equals: s,
|
|
1030
|
-
meta:
|
|
1030
|
+
meta: m,
|
|
1031
1031
|
strict: o
|
|
1032
1032
|
});
|
|
1033
1033
|
};
|
|
1034
1034
|
if (e)
|
|
1035
1035
|
return function(a, c) {
|
|
1036
|
-
return
|
|
1036
|
+
return r(a, c, {
|
|
1037
1037
|
cache: /* @__PURE__ */ new WeakMap(),
|
|
1038
1038
|
equals: s,
|
|
1039
1039
|
meta: void 0,
|
|
@@ -1047,46 +1047,46 @@ function dr(r) {
|
|
|
1047
1047
|
strict: o
|
|
1048
1048
|
};
|
|
1049
1049
|
return function(a, c) {
|
|
1050
|
-
return
|
|
1050
|
+
return r(a, c, i);
|
|
1051
1051
|
};
|
|
1052
1052
|
}
|
|
1053
|
-
var
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1053
|
+
var le = $();
|
|
1054
|
+
$({ strict: !0 });
|
|
1055
|
+
$({ circular: !0 });
|
|
1056
|
+
$({
|
|
1057
1057
|
circular: !0,
|
|
1058
1058
|
strict: !0
|
|
1059
1059
|
});
|
|
1060
|
-
|
|
1060
|
+
$({
|
|
1061
1061
|
createInternalComparator: function() {
|
|
1062
|
-
return
|
|
1062
|
+
return G;
|
|
1063
1063
|
}
|
|
1064
1064
|
});
|
|
1065
|
-
|
|
1065
|
+
$({
|
|
1066
1066
|
strict: !0,
|
|
1067
1067
|
createInternalComparator: function() {
|
|
1068
|
-
return
|
|
1068
|
+
return G;
|
|
1069
1069
|
}
|
|
1070
1070
|
});
|
|
1071
|
-
|
|
1071
|
+
$({
|
|
1072
1072
|
circular: !0,
|
|
1073
1073
|
createInternalComparator: function() {
|
|
1074
|
-
return
|
|
1074
|
+
return G;
|
|
1075
1075
|
}
|
|
1076
1076
|
});
|
|
1077
|
-
|
|
1077
|
+
$({
|
|
1078
1078
|
circular: !0,
|
|
1079
1079
|
createInternalComparator: function() {
|
|
1080
|
-
return
|
|
1080
|
+
return G;
|
|
1081
1081
|
},
|
|
1082
1082
|
strict: !0
|
|
1083
1083
|
});
|
|
1084
|
-
function
|
|
1085
|
-
|
|
1086
|
-
var e =
|
|
1087
|
-
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 });
|
|
1088
1088
|
}
|
|
1089
|
-
const
|
|
1089
|
+
const We = [
|
|
1090
1090
|
Int8Array,
|
|
1091
1091
|
Uint8Array,
|
|
1092
1092
|
Uint8ClampedArray,
|
|
@@ -1096,8 +1096,8 @@ const Ge = [
|
|
|
1096
1096
|
Uint32Array,
|
|
1097
1097
|
Float32Array,
|
|
1098
1098
|
Float64Array
|
|
1099
|
-
],
|
|
1100
|
-
class
|
|
1099
|
+
], me = 1, Y = 8;
|
|
1100
|
+
class Se {
|
|
1101
1101
|
/**
|
|
1102
1102
|
* Creates an index from raw `ArrayBuffer` data.
|
|
1103
1103
|
* @param {ArrayBuffer} data
|
|
@@ -1105,17 +1105,17 @@ class Ce {
|
|
|
1105
1105
|
static from(e) {
|
|
1106
1106
|
if (!(e instanceof ArrayBuffer))
|
|
1107
1107
|
throw new Error("Data must be an instance of ArrayBuffer.");
|
|
1108
|
-
const [
|
|
1109
|
-
if (
|
|
1108
|
+
const [r, n] = new Uint8Array(e, 0, 2);
|
|
1109
|
+
if (r !== 219)
|
|
1110
1110
|
throw new Error("Data does not appear to be in a KDBush format.");
|
|
1111
1111
|
const s = n >> 4;
|
|
1112
|
-
if (s !==
|
|
1113
|
-
throw new Error(`Got v${s} data when expected v${
|
|
1114
|
-
const o =
|
|
1112
|
+
if (s !== me)
|
|
1113
|
+
throw new Error(`Got v${s} data when expected v${me}.`);
|
|
1114
|
+
const o = We[n & 15];
|
|
1115
1115
|
if (!o)
|
|
1116
1116
|
throw new Error("Unrecognized array type.");
|
|
1117
1117
|
const [i] = new Uint16Array(e, 2, 1), [l] = new Uint32Array(e, 4, 1);
|
|
1118
|
-
return new
|
|
1118
|
+
return new Se(l, i, o, e);
|
|
1119
1119
|
}
|
|
1120
1120
|
/**
|
|
1121
1121
|
* Creates an index that will hold a given number of items.
|
|
@@ -1124,14 +1124,14 @@ class Ce {
|
|
|
1124
1124
|
* @param {TypedArrayConstructor} [ArrayType=Float64Array] The array type used for coordinates storage (`Float64Array` by default).
|
|
1125
1125
|
* @param {ArrayBuffer} [data] (For internal use only)
|
|
1126
1126
|
*/
|
|
1127
|
-
constructor(e,
|
|
1127
|
+
constructor(e, r = 64, n = Float64Array, s) {
|
|
1128
1128
|
if (isNaN(e) || e < 0)
|
|
1129
1129
|
throw new Error(`Unpexpected numItems value: ${e}.`);
|
|
1130
|
-
this.numItems = +e, this.nodeSize = Math.min(Math.max(+
|
|
1131
|
-
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;
|
|
1132
1132
|
if (o < 0)
|
|
1133
1133
|
throw new Error(`Unexpected typed array class: ${n}.`);
|
|
1134
|
-
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);
|
|
1135
1135
|
}
|
|
1136
1136
|
/**
|
|
1137
1137
|
* Add a point to the index.
|
|
@@ -1139,9 +1139,9 @@ class Ce {
|
|
|
1139
1139
|
* @param {number} y
|
|
1140
1140
|
* @returns {number} An incremental index associated with the added item (starting from `0`).
|
|
1141
1141
|
*/
|
|
1142
|
-
add(e,
|
|
1142
|
+
add(e, r) {
|
|
1143
1143
|
const n = this._pos >> 1;
|
|
1144
|
-
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;
|
|
1145
1145
|
}
|
|
1146
1146
|
/**
|
|
1147
1147
|
* Perform indexing of the added points.
|
|
@@ -1150,7 +1150,7 @@ class Ce {
|
|
|
1150
1150
|
const e = this._pos >> 1;
|
|
1151
1151
|
if (e !== this.numItems)
|
|
1152
1152
|
throw new Error(`Added ${e} items when expected ${this.numItems}.`);
|
|
1153
|
-
return
|
|
1153
|
+
return _e(this.ids, this.coords, this.nodeSize, 0, this.numItems - 1, 0), this._finished = !0, this;
|
|
1154
1154
|
}
|
|
1155
1155
|
/**
|
|
1156
1156
|
* Search the index for items within a given bounding box.
|
|
@@ -1160,21 +1160,21 @@ class Ce {
|
|
|
1160
1160
|
* @param {number} maxY
|
|
1161
1161
|
* @returns {number[]} An array of indices correponding to the found items.
|
|
1162
1162
|
*/
|
|
1163
|
-
range(e,
|
|
1163
|
+
range(e, r, n, s) {
|
|
1164
1164
|
if (!this._finished)
|
|
1165
1165
|
throw new Error("Data not yet indexed - call index.finish().");
|
|
1166
1166
|
const { ids: o, coords: i, nodeSize: l } = this, a = [0, o.length - 1, 0], c = [];
|
|
1167
1167
|
for (; a.length; ) {
|
|
1168
|
-
const
|
|
1168
|
+
const p = a.pop() || 0, u = a.pop() || 0, f = a.pop() || 0;
|
|
1169
1169
|
if (u - f <= l) {
|
|
1170
1170
|
for (let g = f; g <= u; g++) {
|
|
1171
|
-
const v = i[2 * g],
|
|
1172
|
-
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]);
|
|
1173
1173
|
}
|
|
1174
1174
|
continue;
|
|
1175
1175
|
}
|
|
1176
|
-
const
|
|
1177
|
-
|
|
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));
|
|
1178
1178
|
}
|
|
1179
1179
|
return c;
|
|
1180
1180
|
}
|
|
@@ -1185,58 +1185,58 @@ class Ce {
|
|
|
1185
1185
|
* @param {number} r Query radius.
|
|
1186
1186
|
* @returns {number[]} An array of indices correponding to the found items.
|
|
1187
1187
|
*/
|
|
1188
|
-
within(e,
|
|
1188
|
+
within(e, r, n) {
|
|
1189
1189
|
if (!this._finished)
|
|
1190
1190
|
throw new Error("Data not yet indexed - call index.finish().");
|
|
1191
1191
|
const { ids: s, coords: o, nodeSize: i } = this, l = [0, s.length - 1, 0], a = [], c = n * n;
|
|
1192
1192
|
for (; l.length; ) {
|
|
1193
|
-
const
|
|
1193
|
+
const p = l.pop() || 0, u = l.pop() || 0, f = l.pop() || 0;
|
|
1194
1194
|
if (u - f <= i) {
|
|
1195
1195
|
for (let g = f; g <= u; g++)
|
|
1196
|
-
|
|
1196
|
+
He(o[2 * g], o[2 * g + 1], e, r) <= c && a.push(s[g]);
|
|
1197
1197
|
continue;
|
|
1198
1198
|
}
|
|
1199
|
-
const
|
|
1200
|
-
|
|
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));
|
|
1201
1201
|
}
|
|
1202
1202
|
return a;
|
|
1203
1203
|
}
|
|
1204
1204
|
}
|
|
1205
|
-
function
|
|
1206
|
-
if (s - n <=
|
|
1205
|
+
function _e(t, e, r, n, s, o) {
|
|
1206
|
+
if (s - n <= r)
|
|
1207
1207
|
return;
|
|
1208
1208
|
const i = n + s >> 1;
|
|
1209
|
-
|
|
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);
|
|
1210
1210
|
}
|
|
1211
|
-
function
|
|
1211
|
+
function st(t, e, r, n, s, o) {
|
|
1212
1212
|
for (; s > n; ) {
|
|
1213
1213
|
if (s - n > 600) {
|
|
1214
|
-
const c = s - n + 1,
|
|
1215
|
-
|
|
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);
|
|
1216
1216
|
}
|
|
1217
|
-
const i = e[2 *
|
|
1217
|
+
const i = e[2 * r + o];
|
|
1218
1218
|
let l = n, a = s;
|
|
1219
|
-
for (
|
|
1220
|
-
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; )
|
|
1221
1221
|
l++;
|
|
1222
1222
|
for (; e[2 * a + o] > i; )
|
|
1223
1223
|
a--;
|
|
1224
1224
|
}
|
|
1225
|
-
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);
|
|
1226
1226
|
}
|
|
1227
1227
|
}
|
|
1228
|
-
function
|
|
1229
|
-
|
|
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);
|
|
1230
1230
|
}
|
|
1231
|
-
function
|
|
1232
|
-
const n =
|
|
1233
|
-
|
|
1231
|
+
function he(t, e, r) {
|
|
1232
|
+
const n = t[e];
|
|
1233
|
+
t[e] = t[r], t[r] = n;
|
|
1234
1234
|
}
|
|
1235
|
-
function
|
|
1236
|
-
const s =
|
|
1235
|
+
function He(t, e, r, n) {
|
|
1236
|
+
const s = t - r, o = e - n;
|
|
1237
1237
|
return s * s + o * o;
|
|
1238
1238
|
}
|
|
1239
|
-
const
|
|
1239
|
+
const kr = {
|
|
1240
1240
|
minZoom: 0,
|
|
1241
1241
|
// min zoom to generate clusters on
|
|
1242
1242
|
maxZoom: 16,
|
|
@@ -1257,27 +1257,27 @@ const fr = {
|
|
|
1257
1257
|
reduce: null,
|
|
1258
1258
|
// (accumulated, props) => { accumulated.sum += props.sum; }
|
|
1259
1259
|
// properties to use for individual points when running the reducer
|
|
1260
|
-
map: (
|
|
1260
|
+
map: (t) => t
|
|
1261
1261
|
// props => ({sum: props.my_value})
|
|
1262
|
-
},
|
|
1263
|
-
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 {
|
|
1264
1264
|
constructor(e) {
|
|
1265
|
-
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 = [];
|
|
1266
1266
|
}
|
|
1267
1267
|
load(e) {
|
|
1268
|
-
const { log:
|
|
1269
|
-
|
|
1268
|
+
const { log: r, minZoom: n, maxZoom: s } = this.options;
|
|
1269
|
+
r && console.time("total time");
|
|
1270
1270
|
const o = `prepare ${e.length} points`;
|
|
1271
|
-
|
|
1271
|
+
r && console.time(o), this.points = e;
|
|
1272
1272
|
const i = [];
|
|
1273
1273
|
for (let a = 0; a < e.length; a++) {
|
|
1274
1274
|
const c = e[a];
|
|
1275
1275
|
if (!c.geometry)
|
|
1276
1276
|
continue;
|
|
1277
|
-
const [
|
|
1277
|
+
const [p, u] = c.geometry.coordinates, f = Ke(ae(p)), m = Ke(ie(u));
|
|
1278
1278
|
i.push(
|
|
1279
1279
|
f,
|
|
1280
|
-
|
|
1280
|
+
m,
|
|
1281
1281
|
// projected point coordinates
|
|
1282
1282
|
1 / 0,
|
|
1283
1283
|
// the last zoom the point was processed at
|
|
@@ -1290,14 +1290,14 @@ class Qe {
|
|
|
1290
1290
|
), this.options.reduce && i.push(0);
|
|
1291
1291
|
}
|
|
1292
1292
|
let l = this.trees[s + 1] = this._createTree(i);
|
|
1293
|
-
|
|
1293
|
+
r && console.timeEnd(o);
|
|
1294
1294
|
for (let a = s; a >= n; a--) {
|
|
1295
1295
|
const c = +Date.now();
|
|
1296
|
-
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);
|
|
1297
1297
|
}
|
|
1298
|
-
return
|
|
1298
|
+
return r && console.timeEnd("total time"), this;
|
|
1299
1299
|
}
|
|
1300
|
-
getClusters(e,
|
|
1300
|
+
getClusters(e, r) {
|
|
1301
1301
|
let n = ((e[0] + 180) % 360 + 360) % 360 - 180;
|
|
1302
1302
|
const s = Math.max(-90, Math.min(90, e[1]));
|
|
1303
1303
|
let o = e[2] === 180 ? 180 : ((e[2] + 180) % 360 + 360) % 360 - 180;
|
|
@@ -1305,57 +1305,57 @@ class Qe {
|
|
|
1305
1305
|
if (e[2] - e[0] >= 360)
|
|
1306
1306
|
n = -180, o = 180;
|
|
1307
1307
|
else if (n > o) {
|
|
1308
|
-
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);
|
|
1309
1309
|
return u.concat(f);
|
|
1310
1310
|
}
|
|
1311
|
-
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 = [];
|
|
1312
1312
|
for (const u of a) {
|
|
1313
1313
|
const f = this.stride * u;
|
|
1314
|
-
|
|
1314
|
+
p.push(c[f + x] > 1 ? Xe(c, f, this.clusterProps) : this.points[c[f + j]]);
|
|
1315
1315
|
}
|
|
1316
|
-
return
|
|
1316
|
+
return p;
|
|
1317
1317
|
}
|
|
1318
1318
|
getChildren(e) {
|
|
1319
|
-
const
|
|
1319
|
+
const r = this._getOriginId(e), n = this._getOriginZoom(e), s = "No cluster with the specified id.", o = this.trees[n];
|
|
1320
1320
|
if (!o)
|
|
1321
1321
|
throw new Error(s);
|
|
1322
1322
|
const i = o.data;
|
|
1323
|
-
if (
|
|
1323
|
+
if (r * this.stride >= i.length)
|
|
1324
1324
|
throw new Error(s);
|
|
1325
|
-
const l = this.options.radius / (this.options.extent * Math.pow(2, n - 1)), a = i[
|
|
1326
|
-
for (const f of
|
|
1327
|
-
const
|
|
1328
|
-
i[
|
|
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) {
|
|
1327
|
+
const m = f * this.stride;
|
|
1328
|
+
i[m + ge] === e && u.push(i[m + x] > 1 ? Xe(i, m, this.clusterProps) : this.points[i[m + j]]);
|
|
1329
1329
|
}
|
|
1330
1330
|
if (u.length === 0)
|
|
1331
1331
|
throw new Error(s);
|
|
1332
1332
|
return u;
|
|
1333
1333
|
}
|
|
1334
|
-
getLeaves(e,
|
|
1335
|
-
|
|
1334
|
+
getLeaves(e, r, n) {
|
|
1335
|
+
r = r || 10, n = n || 0;
|
|
1336
1336
|
const s = [];
|
|
1337
|
-
return this._appendLeaves(s, e,
|
|
1337
|
+
return this._appendLeaves(s, e, r, n, 0), s;
|
|
1338
1338
|
}
|
|
1339
|
-
getTile(e,
|
|
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,
|
|
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 = {
|
|
1341
1341
|
features: []
|
|
1342
1342
|
};
|
|
1343
1343
|
return this._addTileFeatures(
|
|
1344
|
-
s.range((
|
|
1344
|
+
s.range((r - a) / o, c, (r + 1 + a) / o, p),
|
|
1345
1345
|
s.data,
|
|
1346
|
-
|
|
1346
|
+
r,
|
|
1347
1347
|
n,
|
|
1348
1348
|
o,
|
|
1349
1349
|
u
|
|
1350
|
-
),
|
|
1351
|
-
s.range(1 - a / o, c, 1,
|
|
1350
|
+
), r === 0 && this._addTileFeatures(
|
|
1351
|
+
s.range(1 - a / o, c, 1, p),
|
|
1352
1352
|
s.data,
|
|
1353
1353
|
o,
|
|
1354
1354
|
n,
|
|
1355
1355
|
o,
|
|
1356
1356
|
u
|
|
1357
|
-
),
|
|
1358
|
-
s.range(0, c, a / o,
|
|
1357
|
+
), r === o - 1 && this._addTileFeatures(
|
|
1358
|
+
s.range(0, c, a / o, p),
|
|
1359
1359
|
s.data,
|
|
1360
1360
|
-1,
|
|
1361
1361
|
n,
|
|
@@ -1364,17 +1364,17 @@ class Qe {
|
|
|
1364
1364
|
), u.features.length ? u : null;
|
|
1365
1365
|
}
|
|
1366
1366
|
getClusterExpansionZoom(e) {
|
|
1367
|
-
let
|
|
1368
|
-
for (;
|
|
1367
|
+
let r = this._getOriginZoom(e) - 1;
|
|
1368
|
+
for (; r <= this.options.maxZoom; ) {
|
|
1369
1369
|
const n = this.getChildren(e);
|
|
1370
|
-
if (
|
|
1370
|
+
if (r++, n.length !== 1)
|
|
1371
1371
|
break;
|
|
1372
1372
|
e = n[0].properties.cluster_id;
|
|
1373
1373
|
}
|
|
1374
|
-
return
|
|
1374
|
+
return r;
|
|
1375
1375
|
}
|
|
1376
|
-
_appendLeaves(e,
|
|
1377
|
-
const i = this.getChildren(
|
|
1376
|
+
_appendLeaves(e, r, n, s, o) {
|
|
1377
|
+
const i = this.getChildren(r);
|
|
1378
1378
|
for (const l of i) {
|
|
1379
1379
|
const a = l.properties;
|
|
1380
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)
|
|
@@ -1383,72 +1383,72 @@ class Qe {
|
|
|
1383
1383
|
return o;
|
|
1384
1384
|
}
|
|
1385
1385
|
_createTree(e) {
|
|
1386
|
-
const
|
|
1386
|
+
const r = new Se(e.length / this.stride | 0, this.options.nodeSize, Float32Array);
|
|
1387
1387
|
for (let n = 0; n < e.length; n += this.stride)
|
|
1388
|
-
|
|
1389
|
-
return
|
|
1388
|
+
r.add(e[n], e[n + 1]);
|
|
1389
|
+
return r.finish(), r.data = e, r;
|
|
1390
1390
|
}
|
|
1391
|
-
_addTileFeatures(e,
|
|
1391
|
+
_addTileFeatures(e, r, n, s, o, i) {
|
|
1392
1392
|
for (const l of e) {
|
|
1393
|
-
const a = l * this.stride, c =
|
|
1394
|
-
let
|
|
1393
|
+
const a = l * this.stride, c = r[a + x] > 1;
|
|
1394
|
+
let p, u, f;
|
|
1395
1395
|
if (c)
|
|
1396
|
-
|
|
1396
|
+
p = it(r, a, this.clusterProps), u = r[a], f = r[a + 1];
|
|
1397
1397
|
else {
|
|
1398
|
-
const
|
|
1399
|
-
|
|
1400
|
-
const [g, v] =
|
|
1401
|
-
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);
|
|
1402
1402
|
}
|
|
1403
|
-
const
|
|
1403
|
+
const m = {
|
|
1404
1404
|
type: 1,
|
|
1405
1405
|
geometry: [[
|
|
1406
1406
|
Math.round(this.options.extent * (u * o - n)),
|
|
1407
1407
|
Math.round(this.options.extent * (f * o - s))
|
|
1408
1408
|
]],
|
|
1409
|
-
tags:
|
|
1409
|
+
tags: p
|
|
1410
1410
|
};
|
|
1411
|
-
let
|
|
1412
|
-
c || this.options.generateId ?
|
|
1411
|
+
let 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);
|
|
1413
1413
|
}
|
|
1414
1414
|
}
|
|
1415
1415
|
_limitZoom(e) {
|
|
1416
1416
|
return Math.max(this.options.minZoom, Math.min(Math.floor(+e), this.options.maxZoom + 1));
|
|
1417
1417
|
}
|
|
1418
|
-
_cluster(e,
|
|
1419
|
-
const { radius: n, extent: s, reduce: o, minPoints: i } = this.options, l = n / (s * Math.pow(2,
|
|
1420
|
-
for (let u = 0; u < a.length; u +=
|
|
1421
|
-
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)
|
|
1422
1422
|
continue;
|
|
1423
|
-
a[u + N] =
|
|
1424
|
-
const f = a[u],
|
|
1425
|
-
let g =
|
|
1426
|
-
for (const v of
|
|
1427
|
-
const
|
|
1428
|
-
a[
|
|
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;
|
|
1426
|
+
for (const v of h) {
|
|
1427
|
+
const y = v * p;
|
|
1428
|
+
a[y + N] > r && (g += a[y + x]);
|
|
1429
1429
|
}
|
|
1430
|
-
if (g >
|
|
1431
|
-
let v = f *
|
|
1432
|
-
const
|
|
1433
|
-
for (const
|
|
1434
|
-
const
|
|
1435
|
-
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)
|
|
1436
1436
|
continue;
|
|
1437
|
-
a[
|
|
1438
|
-
const
|
|
1439
|
-
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)));
|
|
1440
1440
|
}
|
|
1441
|
-
a[u +
|
|
1441
|
+
a[u + ge] = O, c.push(v / g, y / g, 1 / 0, O, -1, g), o && c.push(P);
|
|
1442
1442
|
} else {
|
|
1443
|
-
for (let v = 0; v <
|
|
1443
|
+
for (let v = 0; v < p; v++)
|
|
1444
1444
|
c.push(a[u + v]);
|
|
1445
1445
|
if (g > 1)
|
|
1446
|
-
for (const v of
|
|
1447
|
-
const
|
|
1448
|
-
if (!(a[
|
|
1449
|
-
a[
|
|
1450
|
-
for (let
|
|
1451
|
-
c.push(a[
|
|
1446
|
+
for (const v of h) {
|
|
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]);
|
|
1452
1452
|
}
|
|
1453
1453
|
}
|
|
1454
1454
|
}
|
|
@@ -1463,67 +1463,67 @@ class Qe {
|
|
|
1463
1463
|
_getOriginZoom(e) {
|
|
1464
1464
|
return (e - this.points.length) % 32;
|
|
1465
1465
|
}
|
|
1466
|
-
_map(e,
|
|
1467
|
-
if (e[
|
|
1468
|
-
const i = this.clusterProps[e[
|
|
1466
|
+
_map(e, r, n) {
|
|
1467
|
+
if (e[r + x] > 1) {
|
|
1468
|
+
const i = this.clusterProps[e[r + ot]];
|
|
1469
1469
|
return n ? Object.assign({}, i) : i;
|
|
1470
1470
|
}
|
|
1471
|
-
const s = this.points[e[
|
|
1471
|
+
const s = this.points[e[r + j]].properties, o = this.options.map(s);
|
|
1472
1472
|
return n && o === s ? Object.assign({}, o) : o;
|
|
1473
1473
|
}
|
|
1474
1474
|
}
|
|
1475
|
-
function
|
|
1475
|
+
function Xe(t, e, r) {
|
|
1476
1476
|
return {
|
|
1477
1477
|
type: "Feature",
|
|
1478
|
-
id:
|
|
1479
|
-
properties:
|
|
1478
|
+
id: t[e + j],
|
|
1479
|
+
properties: it(t, e, r),
|
|
1480
1480
|
geometry: {
|
|
1481
1481
|
type: "Point",
|
|
1482
|
-
coordinates: [
|
|
1482
|
+
coordinates: [br(t[e]), Cr(t[e + 1])]
|
|
1483
1483
|
}
|
|
1484
1484
|
};
|
|
1485
1485
|
}
|
|
1486
|
-
function
|
|
1487
|
-
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]);
|
|
1488
1488
|
return Object.assign(i, {
|
|
1489
1489
|
cluster: !0,
|
|
1490
|
-
cluster_id:
|
|
1490
|
+
cluster_id: t[e + j],
|
|
1491
1491
|
point_count: n,
|
|
1492
1492
|
point_count_abbreviated: s
|
|
1493
1493
|
});
|
|
1494
1494
|
}
|
|
1495
|
-
function
|
|
1496
|
-
return
|
|
1495
|
+
function ae(t) {
|
|
1496
|
+
return t / 360 + 0.5;
|
|
1497
1497
|
}
|
|
1498
|
-
function
|
|
1499
|
-
const e = Math.sin(
|
|
1500
|
-
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;
|
|
1501
1501
|
}
|
|
1502
|
-
function
|
|
1503
|
-
return (
|
|
1502
|
+
function br(t) {
|
|
1503
|
+
return (t - 0.5) * 360;
|
|
1504
1504
|
}
|
|
1505
|
-
function
|
|
1506
|
-
const e = (180 -
|
|
1505
|
+
function Cr(t) {
|
|
1506
|
+
const e = (180 - t * 360) * Math.PI / 180;
|
|
1507
1507
|
return 360 * Math.atan(Math.exp(e)) / Math.PI - 90;
|
|
1508
1508
|
}
|
|
1509
|
-
function
|
|
1510
|
-
var
|
|
1511
|
-
for (var n in
|
|
1512
|
-
Object.prototype.hasOwnProperty.call(
|
|
1513
|
-
if (
|
|
1514
|
-
for (var s = 0, n = Object.getOwnPropertySymbols(
|
|
1515
|
-
e.indexOf(n[s]) < 0 && Object.prototype.propertyIsEnumerable.call(
|
|
1516
|
-
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;
|
|
1517
1517
|
}
|
|
1518
|
-
class
|
|
1518
|
+
class b {
|
|
1519
1519
|
static isAdvancedMarkerAvailable(e) {
|
|
1520
1520
|
return google.maps.marker && e.getMapCapabilities().isAdvancedMarkersAvailable === !0;
|
|
1521
1521
|
}
|
|
1522
1522
|
static isAdvancedMarker(e) {
|
|
1523
1523
|
return google.maps.marker && e instanceof google.maps.marker.AdvancedMarkerElement;
|
|
1524
1524
|
}
|
|
1525
|
-
static setMap(e,
|
|
1526
|
-
this.isAdvancedMarker(e) ? e.map =
|
|
1525
|
+
static setMap(e, r) {
|
|
1526
|
+
this.isAdvancedMarker(e) ? e.map = r : e.setMap(r);
|
|
1527
1527
|
}
|
|
1528
1528
|
static getPosition(e) {
|
|
1529
1529
|
if (this.isAdvancedMarker(e)) {
|
|
@@ -1541,16 +1541,16 @@ class w {
|
|
|
1541
1541
|
return this.isAdvancedMarker(e) ? !0 : e.getVisible();
|
|
1542
1542
|
}
|
|
1543
1543
|
}
|
|
1544
|
-
class
|
|
1545
|
-
constructor({ markers: e, position:
|
|
1546
|
-
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));
|
|
1547
1547
|
}
|
|
1548
1548
|
get bounds() {
|
|
1549
1549
|
if (this.markers.length === 0 && !this._position)
|
|
1550
1550
|
return;
|
|
1551
1551
|
const e = new google.maps.LatLngBounds(this._position, this._position);
|
|
1552
|
-
for (const
|
|
1553
|
-
e.extend(
|
|
1552
|
+
for (const r of this.markers)
|
|
1553
|
+
e.extend(b.getPosition(r));
|
|
1554
1554
|
return e;
|
|
1555
1555
|
}
|
|
1556
1556
|
get position() {
|
|
@@ -1560,7 +1560,7 @@ class ee {
|
|
|
1560
1560
|
* Get the count of **visible** markers.
|
|
1561
1561
|
*/
|
|
1562
1562
|
get count() {
|
|
1563
|
-
return this.markers.filter((e) =>
|
|
1563
|
+
return this.markers.filter((e) => b.getVisible(e)).length;
|
|
1564
1564
|
}
|
|
1565
1565
|
/**
|
|
1566
1566
|
* Add a marker to the cluster.
|
|
@@ -1572,32 +1572,32 @@ class ee {
|
|
|
1572
1572
|
* Cleanup references and remove marker from map.
|
|
1573
1573
|
*/
|
|
1574
1574
|
delete() {
|
|
1575
|
-
this.marker && (
|
|
1575
|
+
this.marker && (b.setMap(this.marker, null), this.marker = void 0), this.markers.length = 0;
|
|
1576
1576
|
}
|
|
1577
1577
|
}
|
|
1578
|
-
function
|
|
1579
|
-
if (
|
|
1578
|
+
function q(t, e = "assertion failed") {
|
|
1579
|
+
if (t == null)
|
|
1580
1580
|
throw Error(e);
|
|
1581
1581
|
}
|
|
1582
|
-
const
|
|
1583
|
-
const s =
|
|
1584
|
-
|
|
1585
|
-
const o =
|
|
1586
|
-
return
|
|
1587
|
-
},
|
|
1588
|
-
const { northEast: n, southWest: s } =
|
|
1589
|
-
return
|
|
1590
|
-
},
|
|
1591
|
-
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();
|
|
1592
1592
|
return [o.lng(), o.lat(), s.lng(), s.lat()];
|
|
1593
|
-
},
|
|
1594
|
-
const
|
|
1595
|
-
return
|
|
1596
|
-
},
|
|
1597
|
-
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);
|
|
1598
1598
|
return new google.maps.LatLngBounds(n, s);
|
|
1599
1599
|
};
|
|
1600
|
-
class
|
|
1600
|
+
class ut {
|
|
1601
1601
|
constructor({ maxZoom: e = 16 }) {
|
|
1602
1602
|
this.maxZoom = e;
|
|
1603
1603
|
}
|
|
@@ -1614,47 +1614,47 @@ class rt {
|
|
|
1614
1614
|
* ```
|
|
1615
1615
|
*/
|
|
1616
1616
|
noop({ markers: e }) {
|
|
1617
|
-
return
|
|
1617
|
+
return qr(e);
|
|
1618
1618
|
}
|
|
1619
1619
|
}
|
|
1620
|
-
class
|
|
1620
|
+
class Ar extends ut {
|
|
1621
1621
|
constructor(e) {
|
|
1622
|
-
var { viewportPadding:
|
|
1623
|
-
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;
|
|
1624
1624
|
}
|
|
1625
|
-
calculate({ markers: e, map:
|
|
1626
|
-
const s =
|
|
1627
|
-
return
|
|
1625
|
+
calculate({ markers: e, map: r, mapCanvasProjection: n }) {
|
|
1626
|
+
const s = r.getZoom();
|
|
1627
|
+
return q(s), s >= this.maxZoom ? {
|
|
1628
1628
|
clusters: this.noop({
|
|
1629
1629
|
markers: e
|
|
1630
1630
|
}),
|
|
1631
1631
|
changed: !1
|
|
1632
1632
|
} : {
|
|
1633
1633
|
clusters: this.cluster({
|
|
1634
|
-
markers:
|
|
1635
|
-
map:
|
|
1634
|
+
markers: Or(r, n, e, this.viewportPadding),
|
|
1635
|
+
map: r,
|
|
1636
1636
|
mapCanvasProjection: n
|
|
1637
1637
|
})
|
|
1638
1638
|
};
|
|
1639
1639
|
}
|
|
1640
1640
|
}
|
|
1641
|
-
const
|
|
1642
|
-
position:
|
|
1643
|
-
markers: [
|
|
1641
|
+
const qr = (t) => t.map((r) => new te({
|
|
1642
|
+
position: b.getPosition(r),
|
|
1643
|
+
markers: [r]
|
|
1644
1644
|
}));
|
|
1645
|
-
class
|
|
1645
|
+
class Lr extends ut {
|
|
1646
1646
|
constructor(e) {
|
|
1647
|
-
var { maxZoom:
|
|
1648
|
-
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));
|
|
1649
1649
|
}
|
|
1650
1650
|
calculate(e) {
|
|
1651
|
-
let
|
|
1652
|
-
|
|
1651
|
+
let r = !1, n = e.map.getZoom();
|
|
1652
|
+
q(n), n = Math.round(n);
|
|
1653
1653
|
const s = { zoom: n };
|
|
1654
|
-
if (!
|
|
1655
|
-
|
|
1654
|
+
if (!le(e.markers, this.markers)) {
|
|
1655
|
+
r = !0, this.markers = [...e.markers];
|
|
1656
1656
|
const o = this.markers.map((i) => {
|
|
1657
|
-
const l =
|
|
1657
|
+
const l = b.getPosition(i);
|
|
1658
1658
|
return {
|
|
1659
1659
|
type: "Feature",
|
|
1660
1660
|
geometry: { type: "Point", coordinates: [l.lng(), l.lat()] },
|
|
@@ -1663,37 +1663,37 @@ class Cr extends rt {
|
|
|
1663
1663
|
});
|
|
1664
1664
|
this.superCluster.load(o);
|
|
1665
1665
|
}
|
|
1666
|
-
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 });
|
|
1667
1667
|
}
|
|
1668
1668
|
cluster({ map: e }) {
|
|
1669
|
-
const
|
|
1670
|
-
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));
|
|
1671
1671
|
}
|
|
1672
|
-
transformCluster({ geometry: { coordinates: [e,
|
|
1672
|
+
transformCluster({ geometry: { coordinates: [e, r] }, properties: n }) {
|
|
1673
1673
|
if (n.cluster)
|
|
1674
|
-
return new
|
|
1674
|
+
return new te({
|
|
1675
1675
|
markers: this.superCluster.getLeaves(n.cluster_id, 1 / 0).map((o) => o.properties.marker),
|
|
1676
|
-
position: { lat:
|
|
1676
|
+
position: { lat: r, lng: e }
|
|
1677
1677
|
});
|
|
1678
1678
|
const s = n.marker;
|
|
1679
|
-
return new
|
|
1679
|
+
return new te({
|
|
1680
1680
|
markers: [s],
|
|
1681
|
-
position:
|
|
1681
|
+
position: b.getPosition(s)
|
|
1682
1682
|
});
|
|
1683
1683
|
}
|
|
1684
1684
|
}
|
|
1685
|
-
class
|
|
1685
|
+
class xr extends Ar {
|
|
1686
1686
|
constructor(e) {
|
|
1687
|
-
var { maxZoom:
|
|
1688
|
-
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] };
|
|
1689
1689
|
}
|
|
1690
1690
|
calculate(e) {
|
|
1691
|
-
const
|
|
1692
|
-
let n = !
|
|
1693
|
-
if (!
|
|
1691
|
+
const r = this.getViewportState(e);
|
|
1692
|
+
let n = !le(this.state, r);
|
|
1693
|
+
if (!le(e.markers, this.markers)) {
|
|
1694
1694
|
n = !0, this.markers = [...e.markers];
|
|
1695
1695
|
const s = this.markers.map((o) => {
|
|
1696
|
-
const i =
|
|
1696
|
+
const i = b.getPosition(o);
|
|
1697
1697
|
return {
|
|
1698
1698
|
type: "Feature",
|
|
1699
1699
|
geometry: {
|
|
@@ -1705,40 +1705,40 @@ class Or extends wr {
|
|
|
1705
1705
|
});
|
|
1706
1706
|
this.superCluster.load(s);
|
|
1707
1707
|
}
|
|
1708
|
-
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 };
|
|
1709
1709
|
}
|
|
1710
1710
|
cluster(e) {
|
|
1711
|
-
const
|
|
1712
|
-
return this.superCluster.getClusters(
|
|
1711
|
+
const r = this.getViewportState(e);
|
|
1712
|
+
return this.superCluster.getClusters(r.view, r.zoom).map((n) => this.transformCluster(n));
|
|
1713
1713
|
}
|
|
1714
|
-
transformCluster({ geometry: { coordinates: [e,
|
|
1714
|
+
transformCluster({ geometry: { coordinates: [e, r] }, properties: n }) {
|
|
1715
1715
|
if (n.cluster)
|
|
1716
|
-
return new
|
|
1716
|
+
return new te({
|
|
1717
1717
|
markers: this.superCluster.getLeaves(n.cluster_id, 1 / 0).map((o) => o.properties.marker),
|
|
1718
|
-
position: { lat:
|
|
1718
|
+
position: { lat: r, lng: e }
|
|
1719
1719
|
});
|
|
1720
1720
|
const s = n.marker;
|
|
1721
|
-
return new
|
|
1721
|
+
return new te({
|
|
1722
1722
|
markers: [s],
|
|
1723
|
-
position:
|
|
1723
|
+
position: b.getPosition(s)
|
|
1724
1724
|
});
|
|
1725
1725
|
}
|
|
1726
1726
|
getViewportState(e) {
|
|
1727
|
-
const
|
|
1728
|
-
return
|
|
1729
|
-
zoom: Math.round(
|
|
1730
|
-
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)
|
|
1731
1731
|
};
|
|
1732
1732
|
}
|
|
1733
1733
|
}
|
|
1734
|
-
class
|
|
1735
|
-
constructor(e,
|
|
1734
|
+
class jr {
|
|
1735
|
+
constructor(e, r) {
|
|
1736
1736
|
this.markers = { sum: e.length };
|
|
1737
|
-
const n =
|
|
1737
|
+
const n = r.map((o) => o.count), s = n.reduce((o, i) => o + i, 0);
|
|
1738
1738
|
this.clusters = {
|
|
1739
|
-
count:
|
|
1739
|
+
count: r.length,
|
|
1740
1740
|
markers: {
|
|
1741
|
-
mean: s /
|
|
1741
|
+
mean: s / r.length,
|
|
1742
1742
|
sum: s,
|
|
1743
1743
|
min: Math.min(...n),
|
|
1744
1744
|
max: Math.max(...n)
|
|
@@ -1746,7 +1746,7 @@ class Mr {
|
|
|
1746
1746
|
};
|
|
1747
1747
|
}
|
|
1748
1748
|
}
|
|
1749
|
-
class
|
|
1749
|
+
class Ir {
|
|
1750
1750
|
/**
|
|
1751
1751
|
* The default render function for the library used by {@link MarkerClusterer}.
|
|
1752
1752
|
*
|
|
@@ -1785,19 +1785,19 @@ class Pr {
|
|
|
1785
1785
|
* });
|
|
1786
1786
|
* ```
|
|
1787
1787
|
*/
|
|
1788
|
-
render({ count: e, position:
|
|
1788
|
+
render({ count: e, position: r }, n, s) {
|
|
1789
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">
|
|
1790
1790
|
<circle cx="120" cy="120" opacity=".6" r="70" />
|
|
1791
1791
|
<circle cx="120" cy="120" opacity=".3" r="90" />
|
|
1792
1792
|
<circle cx="120" cy="120" opacity=".2" r="110" />
|
|
1793
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>
|
|
1794
1794
|
</svg>`, l = `Cluster of ${e} markers`, a = Number(google.maps.Marker.MAX_ZINDEX) + e;
|
|
1795
|
-
if (
|
|
1795
|
+
if (b.isAdvancedMarkerAvailable(s)) {
|
|
1796
1796
|
const u = new DOMParser().parseFromString(i, "image/svg+xml").documentElement;
|
|
1797
1797
|
u.setAttribute("transform", "translate(0 25)");
|
|
1798
1798
|
const f = {
|
|
1799
1799
|
map: s,
|
|
1800
|
-
position:
|
|
1800
|
+
position: r,
|
|
1801
1801
|
zIndex: a,
|
|
1802
1802
|
title: l,
|
|
1803
1803
|
content: u
|
|
@@ -1805,7 +1805,7 @@ class Pr {
|
|
|
1805
1805
|
return new google.maps.marker.AdvancedMarkerElement(f);
|
|
1806
1806
|
}
|
|
1807
1807
|
const c = {
|
|
1808
|
-
position:
|
|
1808
|
+
position: r,
|
|
1809
1809
|
zIndex: a,
|
|
1810
1810
|
title: l,
|
|
1811
1811
|
icon: {
|
|
@@ -1816,43 +1816,43 @@ class Pr {
|
|
|
1816
1816
|
return new google.maps.Marker(c);
|
|
1817
1817
|
}
|
|
1818
1818
|
}
|
|
1819
|
-
function
|
|
1820
|
-
for (let
|
|
1821
|
-
|
|
1819
|
+
function Rr(t, e) {
|
|
1820
|
+
for (let r in e.prototype)
|
|
1821
|
+
t.prototype[r] = e.prototype[r];
|
|
1822
1822
|
}
|
|
1823
|
-
class
|
|
1823
|
+
class Pe {
|
|
1824
1824
|
constructor() {
|
|
1825
|
-
|
|
1825
|
+
Rr(Pe, google.maps.OverlayView);
|
|
1826
1826
|
}
|
|
1827
1827
|
}
|
|
1828
1828
|
var I;
|
|
1829
|
-
(function(
|
|
1830
|
-
|
|
1829
|
+
(function(t) {
|
|
1830
|
+
t.CLUSTERING_BEGIN = "clusteringbegin", t.CLUSTERING_END = "clusteringend", t.CLUSTER_CLICK = "click", t.GMP_CLICK = "gmp-click";
|
|
1831
1831
|
})(I || (I = {}));
|
|
1832
|
-
const
|
|
1833
|
-
e.bounds &&
|
|
1832
|
+
const $r = (t, e, r) => {
|
|
1833
|
+
e.bounds && r.fitBounds(e.bounds);
|
|
1834
1834
|
};
|
|
1835
|
-
class
|
|
1836
|
-
constructor({ map: e, markers:
|
|
1837
|
-
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);
|
|
1838
1838
|
}
|
|
1839
|
-
addMarker(e,
|
|
1840
|
-
this.markers.includes(e) || (this.markers.push(e),
|
|
1839
|
+
addMarker(e, r) {
|
|
1840
|
+
this.markers.includes(e) || (this.markers.push(e), r || this.render());
|
|
1841
1841
|
}
|
|
1842
|
-
addMarkers(e,
|
|
1842
|
+
addMarkers(e, r) {
|
|
1843
1843
|
e.forEach((n) => {
|
|
1844
1844
|
this.addMarker(n, !0);
|
|
1845
|
-
}),
|
|
1845
|
+
}), r || this.render();
|
|
1846
1846
|
}
|
|
1847
|
-
removeMarker(e,
|
|
1847
|
+
removeMarker(e, r) {
|
|
1848
1848
|
const n = this.markers.indexOf(e);
|
|
1849
|
-
return n === -1 ? !1 : (
|
|
1849
|
+
return n === -1 ? !1 : (b.setMap(e, null), this.markers.splice(n, 1), r || this.render(), !0);
|
|
1850
1850
|
}
|
|
1851
|
-
removeMarkers(e,
|
|
1851
|
+
removeMarkers(e, r) {
|
|
1852
1852
|
let n = !1;
|
|
1853
1853
|
return e.forEach((s) => {
|
|
1854
1854
|
n = this.removeMarker(s, !0) || n;
|
|
1855
|
-
}), n && !
|
|
1855
|
+
}), n && !r && this.render(), n;
|
|
1856
1856
|
}
|
|
1857
1857
|
clearMarkers(e) {
|
|
1858
1858
|
this.markers.length = 0, e || this.render();
|
|
@@ -1864,75 +1864,233 @@ class Ar extends Me {
|
|
|
1864
1864
|
const e = this.getMap();
|
|
1865
1865
|
if (e instanceof google.maps.Map && e.getProjection()) {
|
|
1866
1866
|
google.maps.event.trigger(this, I.CLUSTERING_BEGIN, this);
|
|
1867
|
-
const { clusters:
|
|
1867
|
+
const { clusters: r, changed: n } = this.algorithm.calculate({
|
|
1868
1868
|
markers: this.markers,
|
|
1869
1869
|
map: e,
|
|
1870
1870
|
mapCanvasProjection: this.getProjection()
|
|
1871
1871
|
});
|
|
1872
1872
|
if (n || n == null) {
|
|
1873
1873
|
const s = /* @__PURE__ */ new Set();
|
|
1874
|
-
for (const i of
|
|
1874
|
+
for (const i of r)
|
|
1875
1875
|
i.markers.length == 1 && s.add(i.markers[0]);
|
|
1876
1876
|
const o = [];
|
|
1877
1877
|
for (const i of this.clusters)
|
|
1878
|
-
i.marker != null && (i.markers.length == 1 ? s.has(i.marker) ||
|
|
1879
|
-
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)));
|
|
1880
1880
|
}
|
|
1881
1881
|
google.maps.event.trigger(this, I.CLUSTERING_END, this);
|
|
1882
1882
|
}
|
|
1883
1883
|
}
|
|
1884
1884
|
onAdd() {
|
|
1885
1885
|
const e = this.getMap();
|
|
1886
|
-
|
|
1886
|
+
q(e), this.idleListener = e.addListener("idle", this.render.bind(this)), this.render();
|
|
1887
1887
|
}
|
|
1888
1888
|
onRemove() {
|
|
1889
1889
|
this.idleListener && google.maps.event.removeListener(this.idleListener), this.reset();
|
|
1890
1890
|
}
|
|
1891
1891
|
reset() {
|
|
1892
|
-
this.markers.forEach((e) =>
|
|
1892
|
+
this.markers.forEach((e) => b.setMap(e, null)), this.clusters.forEach((e) => e.delete()), this.clusters = [];
|
|
1893
1893
|
}
|
|
1894
1894
|
renderClusters() {
|
|
1895
|
-
const e = new
|
|
1895
|
+
const e = new jr(this.markers, this.clusters), r = this.getMap();
|
|
1896
1896
|
this.clusters.forEach((n) => {
|
|
1897
1897
|
if (n.markers.length === 1)
|
|
1898
1898
|
n.marker = n.markers[0];
|
|
1899
|
-
else if (n.marker = this.renderer.render(n, e,
|
|
1900
|
-
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;
|
|
1901
1901
|
n.marker.addListener(
|
|
1902
1902
|
s,
|
|
1903
1903
|
/* istanbul ignore next */
|
|
1904
1904
|
(o) => {
|
|
1905
|
-
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);
|
|
1906
1906
|
}
|
|
1907
1907
|
);
|
|
1908
1908
|
}
|
|
1909
|
-
|
|
1909
|
+
b.setMap(n.marker, r);
|
|
1910
1910
|
});
|
|
1911
1911
|
}
|
|
1912
1912
|
}
|
|
1913
|
-
|
|
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({
|
|
1914
2065
|
name: "MarkerCluster",
|
|
1915
2066
|
props: {
|
|
1916
2067
|
options: {
|
|
1917
2068
|
type: Object,
|
|
1918
2069
|
default: () => ({})
|
|
2070
|
+
},
|
|
2071
|
+
renderDebounceDelay: {
|
|
2072
|
+
type: Number,
|
|
2073
|
+
default: 10
|
|
1919
2074
|
}
|
|
1920
2075
|
},
|
|
1921
|
-
emits:
|
|
1922
|
-
setup(
|
|
1923
|
-
const s =
|
|
1924
|
-
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(
|
|
1925
2080
|
o,
|
|
1926
2081
|
() => {
|
|
1927
|
-
o.value && (s.value =
|
|
1928
|
-
new
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
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) => {
|
|
1936
2094
|
var a;
|
|
1937
2095
|
(a = s.value) == null || a.addListener(l, (c) => e(l, c));
|
|
1938
2096
|
}));
|
|
@@ -1940,15 +2098,15 @@ const We = Object.values(I), Fr = M({
|
|
|
1940
2098
|
{
|
|
1941
2099
|
immediate: !0
|
|
1942
2100
|
}
|
|
1943
|
-
),
|
|
2101
|
+
), B(() => {
|
|
1944
2102
|
var l;
|
|
1945
|
-
s.value && ((l = i.value) == null || l.event.clearInstanceListeners(s.value), s.value.clearMarkers(), s.value.setMap(null));
|
|
1946
|
-
}),
|
|
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 }), () => {
|
|
1947
2105
|
var l;
|
|
1948
2106
|
return (l = n.default) == null ? void 0 : l.call(n);
|
|
1949
2107
|
};
|
|
1950
2108
|
}
|
|
1951
|
-
}),
|
|
2109
|
+
}), vn = T({
|
|
1952
2110
|
inheritAttrs: !1,
|
|
1953
2111
|
props: {
|
|
1954
2112
|
options: {
|
|
@@ -1956,34 +2114,34 @@ const We = Object.values(I), Fr = M({
|
|
|
1956
2114
|
required: !0
|
|
1957
2115
|
}
|
|
1958
2116
|
},
|
|
1959
|
-
setup(
|
|
1960
|
-
const s =
|
|
2117
|
+
setup(t, { slots: e, emit: r, expose: n }) {
|
|
2118
|
+
const s = _(), o = W(() => {
|
|
1961
2119
|
var a;
|
|
1962
|
-
return (a = e.default) == null ? void 0 : a.call(e).some((c) => c.type !==
|
|
1963
|
-
}), i =
|
|
1964
|
-
...
|
|
2120
|
+
return (a = e.default) == null ? void 0 : a.call(e).some((c) => c.type !== we);
|
|
2121
|
+
}), i = W(() => ({
|
|
2122
|
+
...t.options,
|
|
1965
2123
|
element: s.value
|
|
1966
|
-
})), l =
|
|
2124
|
+
})), l = K(de, [], i, r);
|
|
1967
2125
|
return n({
|
|
1968
2126
|
customMarker: l
|
|
1969
2127
|
}), { customMarkerRef: s, customMarker: l, hasSlotContent: o };
|
|
1970
2128
|
}
|
|
1971
2129
|
});
|
|
1972
|
-
const
|
|
2130
|
+
const yn = {
|
|
1973
2131
|
key: 0,
|
|
1974
2132
|
class: "custom-marker-wrapper"
|
|
1975
2133
|
};
|
|
1976
|
-
function
|
|
1977
|
-
return
|
|
1978
|
-
|
|
2134
|
+
function _n(t, e, r, n, s, o) {
|
|
2135
|
+
return t.hasSlotContent ? (F(), V("div", yn, [
|
|
2136
|
+
ce("div", ke({
|
|
1979
2137
|
ref: "customMarkerRef",
|
|
1980
|
-
style: { cursor:
|
|
1981
|
-
},
|
|
1982
|
-
|
|
2138
|
+
style: { cursor: t.$attrs.onClick ? "pointer" : void 0 }
|
|
2139
|
+
}, t.$attrs), [
|
|
2140
|
+
z(t.$slots, "default", {}, void 0, !0)
|
|
1983
2141
|
], 16)
|
|
1984
|
-
])) :
|
|
2142
|
+
])) : be("", !0);
|
|
1985
2143
|
}
|
|
1986
|
-
const
|
|
2144
|
+
const xn = /* @__PURE__ */ re(vn, [["render", _n], ["__scopeId", "data-v-2d2d343a"]]), jn = T({
|
|
1987
2145
|
name: "HeatmapLayer",
|
|
1988
2146
|
props: {
|
|
1989
2147
|
options: {
|
|
@@ -1991,51 +2149,51 @@ const zr = /* @__PURE__ */ te(qr, [["render", Lr], ["__scopeId", "data-v-2d2d343
|
|
|
1991
2149
|
default: () => ({})
|
|
1992
2150
|
}
|
|
1993
2151
|
},
|
|
1994
|
-
setup(
|
|
1995
|
-
const e =
|
|
1996
|
-
return
|
|
1997
|
-
[
|
|
2152
|
+
setup(t) {
|
|
2153
|
+
const e = _(), r = C(D, _()), n = C(Z, _());
|
|
2154
|
+
return S(
|
|
2155
|
+
[r, () => t.options],
|
|
1998
2156
|
([s, o], [i, l]) => {
|
|
1999
|
-
const a = !
|
|
2000
|
-
if (
|
|
2157
|
+
const a = !ee(o, l) || r.value !== i;
|
|
2158
|
+
if (r.value && n.value && a) {
|
|
2001
2159
|
let c;
|
|
2002
2160
|
if (o.data && !(o.data instanceof n.value.MVCArray)) {
|
|
2003
|
-
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));
|
|
2004
2162
|
c = {
|
|
2005
2163
|
...o,
|
|
2006
2164
|
data: u
|
|
2007
2165
|
};
|
|
2008
2166
|
} else
|
|
2009
2167
|
c = o;
|
|
2010
|
-
e.value ? e.value.setOptions(c) : e.value =
|
|
2168
|
+
e.value ? e.value.setOptions(c) : e.value = A(
|
|
2011
2169
|
new n.value.visualization.HeatmapLayer({
|
|
2012
2170
|
...c,
|
|
2013
|
-
map:
|
|
2171
|
+
map: r.value
|
|
2014
2172
|
})
|
|
2015
2173
|
);
|
|
2016
2174
|
}
|
|
2017
2175
|
},
|
|
2018
2176
|
{ immediate: !0 }
|
|
2019
|
-
),
|
|
2177
|
+
), B(() => {
|
|
2020
2178
|
e.value && e.value.setMap(null);
|
|
2021
2179
|
}), { heatmapLayer: e };
|
|
2022
2180
|
},
|
|
2023
2181
|
render: () => null
|
|
2024
2182
|
});
|
|
2025
2183
|
export {
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
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
|
|
2041
2199
|
};
|