vue3-google-map 0.21.1 → 0.23.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 +84 -7
- package/dist/index.cjs +5 -5
- package/dist/index.mjs +528 -496
- package/dist/index.umd.js +5 -5
- package/dist/types/components/{AdvancedMarker.d.ts → AdvancedMarker.vue.d.ts} +4 -3
- package/dist/types/components/CustomControl.vue.d.ts +2 -2
- package/dist/types/components/GoogleMap.vue.d.ts +37 -10
- package/dist/types/components/HeatmapLayer.d.ts +5 -0
- package/dist/types/components/Marker.d.ts +6 -0
- package/dist/types/components/index.d.ts +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode(".mapdiv[data-v-
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
import { defineComponent as P, ref as
|
|
6
|
-
const B = Symbol("map"), Z = Symbol("api"),
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode(".mapdiv[data-v-e7ebb206]{width:100%;height:100%}.advanced-marker-wrapper{display:none}.mapdiv .advanced-marker-wrapper{display:inline-block}.custom-control-wrapper[data-v-d099a3a6]{display:none}.mapdiv .custom-control-wrapper[data-v-d099a3a6]{display:inline-block}.info-window-wrapper[data-v-cbe1707b]{display:none}.mapdiv .info-window-wrapper[data-v-cbe1707b]{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(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
+
var Ne = Object.defineProperty;
|
|
3
|
+
var De = (n, e, t) => e in n ? Ne(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
4
|
+
var oe = (n, e, t) => (De(n, typeof e != "symbol" ? e + "" : e, t), t);
|
|
5
|
+
import { defineComponent as P, ref as v, provide as D, watch as S, onMounted as Ie, onBeforeUnmount as j, markRaw as x, toRef as $, openBlock as U, createElementBlock as V, createElementVNode as se, renderSlot as z, normalizeProps as Fe, guardReactiveProps as Ue, computed as G, Comment as ue, inject as C, Fragment as Ve, mergeProps as de, createCommentVNode as he } from "vue";
|
|
6
|
+
const B = Symbol("map"), Z = Symbol("api"), pe = Symbol("marker"), fe = Symbol("markerCluster"), re = Symbol("CustomMarker"), Te = Symbol("mapTilesLoaded"), H = [
|
|
7
7
|
"click",
|
|
8
8
|
"dblclick",
|
|
9
9
|
"drag",
|
|
@@ -30,34 +30,34 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
30
30
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
31
31
|
PERFORMANCE OF THIS SOFTWARE.
|
|
32
32
|
***************************************************************************** */
|
|
33
|
-
function
|
|
33
|
+
function ze(n, e, t, s) {
|
|
34
34
|
function r(o) {
|
|
35
|
-
return o instanceof t ? o : new t(function(
|
|
36
|
-
|
|
35
|
+
return o instanceof t ? o : new t(function(a) {
|
|
36
|
+
a(o);
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
-
return new (t || (t = Promise))(function(o,
|
|
40
|
-
function
|
|
39
|
+
return new (t || (t = Promise))(function(o, a) {
|
|
40
|
+
function l(u) {
|
|
41
41
|
try {
|
|
42
42
|
d(s.next(u));
|
|
43
|
-
} catch (
|
|
44
|
-
|
|
43
|
+
} catch (c) {
|
|
44
|
+
a(c);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function i(u) {
|
|
48
48
|
try {
|
|
49
49
|
d(s.throw(u));
|
|
50
|
-
} catch (
|
|
51
|
-
|
|
50
|
+
} catch (c) {
|
|
51
|
+
a(c);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
function d(u) {
|
|
55
|
-
u.done ? o(u.value) : r(u.value).then(
|
|
55
|
+
u.done ? o(u.value) : r(u.value).then(l, i);
|
|
56
56
|
}
|
|
57
57
|
d((s = s.apply(n, e || [])).next());
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
|
-
var
|
|
60
|
+
var Ge = function n(e, t) {
|
|
61
61
|
if (e === t)
|
|
62
62
|
return !0;
|
|
63
63
|
if (e && t && typeof e == "object" && typeof t == "object") {
|
|
@@ -84,20 +84,20 @@ var Fe = function n(e, t) {
|
|
|
84
84
|
if (!Object.prototype.hasOwnProperty.call(t, o[r]))
|
|
85
85
|
return !1;
|
|
86
86
|
for (r = s; r-- !== 0; ) {
|
|
87
|
-
var
|
|
88
|
-
if (!n(e[
|
|
87
|
+
var a = o[r];
|
|
88
|
+
if (!n(e[a], t[a]))
|
|
89
89
|
return !1;
|
|
90
90
|
}
|
|
91
91
|
return !0;
|
|
92
92
|
}
|
|
93
93
|
return e !== e && t !== t;
|
|
94
94
|
};
|
|
95
|
-
const
|
|
95
|
+
const ye = "__googleMapsScriptId";
|
|
96
96
|
var N;
|
|
97
97
|
(function(n) {
|
|
98
98
|
n[n.INITIALIZED = 0] = "INITIALIZED", n[n.LOADING = 1] = "LOADING", n[n.SUCCESS = 2] = "SUCCESS", n[n.FAILURE = 3] = "FAILURE";
|
|
99
99
|
})(N || (N = {}));
|
|
100
|
-
class
|
|
100
|
+
class q {
|
|
101
101
|
/**
|
|
102
102
|
* Creates an instance of Loader using [[LoaderOptions]]. No defaults are set
|
|
103
103
|
* using this library, instead the defaults are set by the Google Maps
|
|
@@ -107,13 +107,13 @@ class j {
|
|
|
107
107
|
* const loader = Loader({apiKey, version: 'weekly', libraries: ['places']});
|
|
108
108
|
* ```
|
|
109
109
|
*/
|
|
110
|
-
constructor({ apiKey: e, authReferrerPolicy: t, channel: s, client: r, id: o =
|
|
111
|
-
if (this.callbacks = [], this.done = !1, this.loading = !1, this.errors = [], this.apiKey = e, this.authReferrerPolicy = t, this.channel = s, this.client = r, this.id = o ||
|
|
112
|
-
if (!
|
|
113
|
-
throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(
|
|
114
|
-
return
|
|
110
|
+
constructor({ apiKey: e, authReferrerPolicy: t, channel: s, client: r, id: o = ye, language: a, libraries: l = [], mapIds: i, nonce: d, region: u, retries: c = 3, url: h = "https://maps.googleapis.com/maps/api/js", version: p }) {
|
|
111
|
+
if (this.callbacks = [], this.done = !1, this.loading = !1, this.errors = [], this.apiKey = e, this.authReferrerPolicy = t, this.channel = s, this.client = r, this.id = o || ye, this.language = a, this.libraries = l, this.mapIds = i, this.nonce = d, this.region = u, this.retries = c, this.url = h, this.version = p, q.instance) {
|
|
112
|
+
if (!Ge(this.options, q.instance.options))
|
|
113
|
+
throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(q.instance.options)}`);
|
|
114
|
+
return q.instance;
|
|
115
115
|
}
|
|
116
|
-
|
|
116
|
+
q.instance = this;
|
|
117
117
|
}
|
|
118
118
|
get options() {
|
|
119
119
|
return {
|
|
@@ -205,24 +205,24 @@ class j {
|
|
|
205
205
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
206
206
|
(o) => !s[o] && delete s[o]
|
|
207
207
|
), !((t = (e = window == null ? void 0 : window.google) === null || e === void 0 ? void 0 : e.maps) === null || t === void 0) && t.importLibrary || ((o) => {
|
|
208
|
-
let
|
|
209
|
-
|
|
210
|
-
const
|
|
208
|
+
let a, l, i, d = "The Google Maps JavaScript API", u = "google", c = "importLibrary", h = "__ib__", p = document, f = window;
|
|
209
|
+
f = f[u] || (f[u] = {});
|
|
210
|
+
const m = f.maps || (f.maps = {}), g = /* @__PURE__ */ new Set(), y = new URLSearchParams(), _ = () => (
|
|
211
211
|
// @ts-ignore
|
|
212
|
-
|
|
213
|
-
var
|
|
214
|
-
yield
|
|
215
|
-
for (
|
|
216
|
-
|
|
217
|
-
|
|
212
|
+
a || (a = new Promise((w, O) => ze(this, void 0, void 0, function* () {
|
|
213
|
+
var b;
|
|
214
|
+
yield l = p.createElement("script"), l.id = this.id, y.set("libraries", [...g] + "");
|
|
215
|
+
for (i in o)
|
|
216
|
+
y.set(i.replace(/[A-Z]/g, (E) => "_" + E[0].toLowerCase()), o[i]);
|
|
217
|
+
y.set("callback", u + ".maps." + h), l.src = this.url + "?" + y, m[h] = w, l.onerror = () => a = O(Error(d + " could not load.")), l.nonce = this.nonce || ((b = p.querySelector("script[nonce]")) === null || b === void 0 ? void 0 : b.nonce) || "", p.head.append(l);
|
|
218
218
|
})))
|
|
219
219
|
);
|
|
220
|
-
|
|
220
|
+
m[c] ? console.warn(d + " only loads once. Ignoring:", o) : m[c] = (w, ...O) => g.add(w) && _().then(() => m[c](w, ...O));
|
|
221
221
|
})(s);
|
|
222
222
|
const r = this.libraries.map((o) => this.importLibrary(o));
|
|
223
223
|
r.length || r.push(this.importLibrary("core")), Promise.all(r).then(() => this.callback(), (o) => {
|
|
224
|
-
const
|
|
225
|
-
this.loadErrorCallback(
|
|
224
|
+
const a = new ErrorEvent("error", { error: o });
|
|
225
|
+
this.loadErrorCallback(a);
|
|
226
226
|
});
|
|
227
227
|
}
|
|
228
228
|
/**
|
|
@@ -260,12 +260,12 @@ class j {
|
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
|
-
function
|
|
263
|
+
function He(n) {
|
|
264
264
|
return class extends n.OverlayView {
|
|
265
265
|
constructor(s) {
|
|
266
266
|
super();
|
|
267
|
-
|
|
268
|
-
|
|
267
|
+
oe(this, "element");
|
|
268
|
+
oe(this, "opts");
|
|
269
269
|
const { element: r, ...o } = s;
|
|
270
270
|
this.element = r, this.opts = o, this.opts.map && this.setMap(this.opts.map);
|
|
271
271
|
}
|
|
@@ -290,37 +290,37 @@ function Ve(n) {
|
|
|
290
290
|
const s = this.getProjection(), r = s == null ? void 0 : s.fromLatLngToDivPixel(this.getPosition());
|
|
291
291
|
if (r) {
|
|
292
292
|
this.element.style.position = "absolute";
|
|
293
|
-
let o,
|
|
293
|
+
let o, a;
|
|
294
294
|
switch (this.opts.anchorPoint) {
|
|
295
295
|
case "TOP_CENTER":
|
|
296
|
-
o = "-50%",
|
|
296
|
+
o = "-50%", a = "-100%";
|
|
297
297
|
break;
|
|
298
298
|
case "BOTTOM_CENTER":
|
|
299
|
-
o = "-50%",
|
|
299
|
+
o = "-50%", a = "0";
|
|
300
300
|
break;
|
|
301
301
|
case "LEFT_CENTER":
|
|
302
|
-
o = "-100%",
|
|
302
|
+
o = "-100%", a = "-50%";
|
|
303
303
|
break;
|
|
304
304
|
case "RIGHT_CENTER":
|
|
305
|
-
o = "0",
|
|
305
|
+
o = "0", a = "-50%";
|
|
306
306
|
break;
|
|
307
307
|
case "TOP_LEFT":
|
|
308
|
-
o = "-100%",
|
|
308
|
+
o = "-100%", a = "-100%";
|
|
309
309
|
break;
|
|
310
310
|
case "TOP_RIGHT":
|
|
311
|
-
o = "0",
|
|
311
|
+
o = "0", a = "-100%";
|
|
312
312
|
break;
|
|
313
313
|
case "BOTTOM_LEFT":
|
|
314
|
-
o = "-100%",
|
|
314
|
+
o = "-100%", a = "0";
|
|
315
315
|
break;
|
|
316
316
|
case "BOTTOM_RIGHT":
|
|
317
|
-
o = "0",
|
|
317
|
+
o = "0", a = "0";
|
|
318
318
|
break;
|
|
319
319
|
default:
|
|
320
|
-
o = "-50%",
|
|
320
|
+
o = "-50%", a = "-50%";
|
|
321
321
|
}
|
|
322
|
-
const
|
|
323
|
-
this.element.style.transform = `translateX(${o}) translateX(${
|
|
322
|
+
const l = r.x + (this.opts.offsetX || 0) + "px", i = r.y + (this.opts.offsetY || 0) + "px";
|
|
323
|
+
this.element.style.transform = `translateX(${o}) translateX(${l}) translateY(${a}) translateY(${i})`, this.opts.zIndex && (this.element.style.zIndex = this.opts.zIndex.toString());
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
326
|
onRemove() {
|
|
@@ -332,8 +332,8 @@ function Ve(n) {
|
|
|
332
332
|
}
|
|
333
333
|
};
|
|
334
334
|
}
|
|
335
|
-
let
|
|
336
|
-
const
|
|
335
|
+
let _e;
|
|
336
|
+
const we = [
|
|
337
337
|
"bounds_changed",
|
|
338
338
|
"center_changed",
|
|
339
339
|
"click",
|
|
@@ -356,7 +356,7 @@ const me = [
|
|
|
356
356
|
"tilesloaded",
|
|
357
357
|
"tilt_changed",
|
|
358
358
|
"zoom_changed"
|
|
359
|
-
],
|
|
359
|
+
], We = P({
|
|
360
360
|
props: {
|
|
361
361
|
apiPromise: {
|
|
362
362
|
type: Promise
|
|
@@ -394,6 +394,10 @@ const me = [
|
|
|
394
394
|
required: !1,
|
|
395
395
|
default: void 0
|
|
396
396
|
},
|
|
397
|
+
colorScheme: {
|
|
398
|
+
type: String,
|
|
399
|
+
required: !1
|
|
400
|
+
},
|
|
397
401
|
controlSize: {
|
|
398
402
|
type: Number,
|
|
399
403
|
required: !1
|
|
@@ -548,98 +552,108 @@ const me = [
|
|
|
548
552
|
type: String,
|
|
549
553
|
required: !1
|
|
550
554
|
},
|
|
555
|
+
cameraControl: {
|
|
556
|
+
type: Boolean,
|
|
557
|
+
required: !1,
|
|
558
|
+
default: void 0
|
|
559
|
+
},
|
|
560
|
+
cameraControlPosition: {
|
|
561
|
+
type: String,
|
|
562
|
+
required: !1
|
|
563
|
+
},
|
|
551
564
|
nonce: {
|
|
552
565
|
type: String,
|
|
553
566
|
default: ""
|
|
554
567
|
}
|
|
555
568
|
},
|
|
556
|
-
emits:
|
|
569
|
+
emits: we,
|
|
557
570
|
setup(n, { emit: e }) {
|
|
558
|
-
const t =
|
|
559
|
-
|
|
560
|
-
const
|
|
561
|
-
const
|
|
562
|
-
Object.keys(
|
|
563
|
-
|
|
571
|
+
const t = v(), s = v(!1), r = v(), o = v(), a = v(!1);
|
|
572
|
+
D(B, r), D(Z, o), D(Te, a);
|
|
573
|
+
const l = () => {
|
|
574
|
+
const c = { ...n };
|
|
575
|
+
Object.keys(c).forEach((m) => {
|
|
576
|
+
c[m] === void 0 && delete c[m];
|
|
564
577
|
});
|
|
565
|
-
const p = (
|
|
578
|
+
const p = (m) => {
|
|
566
579
|
var g;
|
|
567
|
-
return
|
|
568
|
-
},
|
|
580
|
+
return m ? { position: (g = o.value) == null ? void 0 : g.ControlPosition[m] } : {};
|
|
581
|
+
}, f = {
|
|
569
582
|
scaleControlOptions: n.scaleControlStyle ? { style: n.scaleControlStyle } : {},
|
|
570
583
|
panControlOptions: p(n.panControlPosition),
|
|
571
584
|
zoomControlOptions: p(n.zoomControlPosition),
|
|
572
585
|
rotateControlOptions: p(n.rotateControlPosition),
|
|
573
586
|
streetViewControlOptions: p(n.streetViewControlPosition),
|
|
574
587
|
fullscreenControlOptions: p(n.fullscreenControlPosition),
|
|
588
|
+
cameraControlOptions: p(n.cameraControlPosition),
|
|
575
589
|
disableDefaultUI: n.disableDefaultUi
|
|
576
590
|
};
|
|
577
|
-
return { ...
|
|
578
|
-
},
|
|
591
|
+
return { ...c, ...f };
|
|
592
|
+
}, i = S(
|
|
579
593
|
[o, r],
|
|
580
|
-
([
|
|
581
|
-
const p =
|
|
582
|
-
p &&
|
|
583
|
-
|
|
584
|
-
}), setTimeout(
|
|
594
|
+
([c, h]) => {
|
|
595
|
+
const p = c, f = h;
|
|
596
|
+
p && f && (p.event.addListenerOnce(f, "tilesloaded", () => {
|
|
597
|
+
a.value = !0;
|
|
598
|
+
}), setTimeout(i, 0));
|
|
585
599
|
},
|
|
586
600
|
{ immediate: !0 }
|
|
587
601
|
), d = () => {
|
|
588
602
|
try {
|
|
589
|
-
const { apiKey:
|
|
590
|
-
|
|
591
|
-
} catch (
|
|
592
|
-
console.error(
|
|
603
|
+
const { apiKey: c, region: h, version: p, language: f, libraries: m, nonce: g } = n;
|
|
604
|
+
_e = new q({ apiKey: c, region: h, version: p, language: f, libraries: m, nonce: g });
|
|
605
|
+
} catch (c) {
|
|
606
|
+
console.error(c);
|
|
593
607
|
}
|
|
594
|
-
}, u = (
|
|
595
|
-
o.value = x(
|
|
596
|
-
const h =
|
|
597
|
-
o.value[
|
|
598
|
-
var
|
|
599
|
-
(
|
|
608
|
+
}, u = (c) => {
|
|
609
|
+
o.value = x(c.maps), r.value = x(new c.maps.Map(t.value, l()));
|
|
610
|
+
const h = He(o.value);
|
|
611
|
+
o.value[re] = h, we.forEach((f) => {
|
|
612
|
+
var m;
|
|
613
|
+
(m = r.value) == null || m.addListener(f, (g) => e(f, g));
|
|
600
614
|
}), s.value = !0;
|
|
601
615
|
const p = Object.keys(n).filter(
|
|
602
|
-
(
|
|
603
|
-
).map((
|
|
604
|
-
|
|
616
|
+
(f) => !["apiPromise", "apiKey", "version", "libraries", "region", "language", "center", "zoom", "nonce"].includes(f)
|
|
617
|
+
).map((f) => $(n, f));
|
|
618
|
+
S(
|
|
605
619
|
[() => n.center, () => n.zoom, ...p],
|
|
606
|
-
([
|
|
607
|
-
var E,
|
|
608
|
-
const { center:
|
|
609
|
-
(E = r.value) == null || E.setOptions(O),
|
|
610
|
-
const
|
|
611
|
-
|
|
620
|
+
([f, m], [g, y]) => {
|
|
621
|
+
var E, M, L;
|
|
622
|
+
const { center: _, zoom: w, ...O } = l();
|
|
623
|
+
(E = r.value) == null || E.setOptions(O), m !== void 0 && m !== y && ((M = r.value) == null || M.setZoom(m));
|
|
624
|
+
const b = !g || f.lng !== g.lng || f.lat !== g.lat;
|
|
625
|
+
f && b && ((L = r.value) == null || L.panTo(f));
|
|
612
626
|
}
|
|
613
627
|
);
|
|
614
628
|
};
|
|
615
|
-
return
|
|
616
|
-
n.apiPromise && n.apiPromise instanceof Promise ? n.apiPromise.then(u) : (d(),
|
|
617
|
-
}),
|
|
618
|
-
var
|
|
619
|
-
|
|
620
|
-
}), { mapRef: t, ready: s, map: r, api: o, mapTilesLoaded:
|
|
629
|
+
return Ie(() => {
|
|
630
|
+
n.apiPromise && n.apiPromise instanceof Promise ? n.apiPromise.then(u) : (d(), _e.load().then(u));
|
|
631
|
+
}), j(() => {
|
|
632
|
+
var c;
|
|
633
|
+
a.value = !1, r.value && ((c = o.value) == null || c.event.clearInstanceListeners(r.value));
|
|
634
|
+
}), { mapRef: t, ready: s, map: r, api: o, mapTilesLoaded: a };
|
|
621
635
|
}
|
|
622
636
|
});
|
|
623
|
-
const
|
|
637
|
+
const X = (n, e) => {
|
|
624
638
|
const t = n.__vccOpts || n;
|
|
625
639
|
for (const [s, r] of e)
|
|
626
640
|
t[s] = r;
|
|
627
641
|
return t;
|
|
628
|
-
},
|
|
642
|
+
}, Ke = {
|
|
629
643
|
ref: "mapRef",
|
|
630
644
|
class: "mapdiv"
|
|
631
645
|
};
|
|
632
|
-
function
|
|
633
|
-
return
|
|
634
|
-
|
|
635
|
-
|
|
646
|
+
function Ye(n, e, t, s, r, o) {
|
|
647
|
+
return U(), V("div", null, [
|
|
648
|
+
se("div", Ke, null, 512),
|
|
649
|
+
z(n.$slots, "default", Fe(Ue({ ready: n.ready, map: n.map, api: n.api, mapTilesLoaded: n.mapTilesLoaded })), void 0, !0)
|
|
636
650
|
]);
|
|
637
651
|
}
|
|
638
|
-
const
|
|
639
|
-
function
|
|
652
|
+
const It = /* @__PURE__ */ X(We, [["render", Ye], ["__scopeId", "data-v-e7ebb206"]]);
|
|
653
|
+
function Je(n) {
|
|
640
654
|
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
641
655
|
}
|
|
642
|
-
var
|
|
656
|
+
var Xe = function n(e, t) {
|
|
643
657
|
if (e === t)
|
|
644
658
|
return !0;
|
|
645
659
|
if (e && t && typeof e == "object" && typeof t == "object") {
|
|
@@ -666,15 +680,15 @@ var Ke = function n(e, t) {
|
|
|
666
680
|
if (!Object.prototype.hasOwnProperty.call(t, o[r]))
|
|
667
681
|
return !1;
|
|
668
682
|
for (r = s; r-- !== 0; ) {
|
|
669
|
-
var
|
|
670
|
-
if (!n(e[
|
|
683
|
+
var a = o[r];
|
|
684
|
+
if (!n(e[a], t[a]))
|
|
671
685
|
return !1;
|
|
672
686
|
}
|
|
673
687
|
return !0;
|
|
674
688
|
}
|
|
675
689
|
return e !== e && t !== t;
|
|
676
690
|
};
|
|
677
|
-
const A = /* @__PURE__ */
|
|
691
|
+
const A = /* @__PURE__ */ Je(Xe), ke = ["click", "drag", "dragend", "dragstart", "gmp-click"], Qe = P({
|
|
678
692
|
name: "AdvancedMarker",
|
|
679
693
|
props: {
|
|
680
694
|
options: {
|
|
@@ -686,73 +700,88 @@ const A = /* @__PURE__ */ We(Ke), ge = ["click", "drag", "dragend", "dragstart",
|
|
|
686
700
|
required: !1
|
|
687
701
|
}
|
|
688
702
|
},
|
|
689
|
-
emits:
|
|
703
|
+
emits: ke,
|
|
690
704
|
setup(n, { emit: e, expose: t, slots: s }) {
|
|
691
|
-
const r =
|
|
692
|
-
|
|
705
|
+
const r = v(), o = G(() => {
|
|
706
|
+
var p;
|
|
707
|
+
return (p = s.content) == null ? void 0 : p.call(s).some((f) => f.type !== ue);
|
|
708
|
+
}), a = $(n, "options"), l = $(n, "pinOptions"), i = v(), d = C(B, v()), u = C(Z, v()), c = C(fe, v()), h = G(
|
|
709
|
+
() => !!(c.value && u.value && i.value instanceof google.maps.marker.AdvancedMarkerElement)
|
|
693
710
|
);
|
|
694
|
-
return
|
|
695
|
-
[
|
|
696
|
-
async (
|
|
697
|
-
var
|
|
698
|
-
const
|
|
699
|
-
if (!
|
|
711
|
+
return S(
|
|
712
|
+
[d, a, l],
|
|
713
|
+
async (p, [f, m, g]) => {
|
|
714
|
+
var b, E, M;
|
|
715
|
+
const _ = !A(a.value, m) || !A(l.value, g) || d.value !== f;
|
|
716
|
+
if (!d.value || !u.value || !_)
|
|
700
717
|
return;
|
|
701
|
-
const { AdvancedMarkerElement:
|
|
718
|
+
const { AdvancedMarkerElement: w, PinElement: O } = u.value.marker;
|
|
702
719
|
if (i.value) {
|
|
703
|
-
const { map:
|
|
720
|
+
const { map: L, content: Q, ...ne } = a.value;
|
|
704
721
|
Object.assign(i.value, {
|
|
705
|
-
content: o.value ? new
|
|
706
|
-
...
|
|
707
|
-
}),
|
|
722
|
+
content: o.value ? r.value : l.value ? new O(l.value).element : Q,
|
|
723
|
+
...ne
|
|
724
|
+
}), h.value && ((b = c.value) == null || b.removeMarker(i.value), (E = c.value) == null || E.addMarker(i.value));
|
|
708
725
|
} else
|
|
709
|
-
o.value && (
|
|
710
|
-
var
|
|
711
|
-
(
|
|
726
|
+
o.value ? a.value.content = r.value : l.value && (a.value.content = new O(l.value).element), i.value = x(new w(a.value)), h.value ? (M = c.value) == null || M.addMarker(i.value) : i.value.map = d.value, ke.forEach((L) => {
|
|
727
|
+
var Q;
|
|
728
|
+
(Q = i.value) == null || Q.addListener(L, (ne) => e(L, ne));
|
|
712
729
|
});
|
|
713
730
|
},
|
|
714
731
|
{
|
|
715
732
|
immediate: !0
|
|
716
733
|
}
|
|
717
|
-
),
|
|
718
|
-
var
|
|
719
|
-
i.value && ((
|
|
720
|
-
}),
|
|
721
|
-
var l;
|
|
722
|
-
return (l = s.default) == null ? void 0 : l.call(s);
|
|
723
|
-
};
|
|
734
|
+
), j(() => {
|
|
735
|
+
var p, f;
|
|
736
|
+
i.value && ((p = u.value) == null || p.event.clearInstanceListeners(i.value), h.value ? (f = c.value) == null || f.removeMarker(i.value) : i.value.map = null);
|
|
737
|
+
}), D(pe, i), t({ marker: i }), { hasCustomSlotContent: o, markerRef: r };
|
|
724
738
|
}
|
|
725
|
-
})
|
|
726
|
-
|
|
727
|
-
|
|
739
|
+
});
|
|
740
|
+
const et = {
|
|
741
|
+
key: 0,
|
|
742
|
+
class: "advanced-marker-wrapper"
|
|
743
|
+
};
|
|
744
|
+
function tt(n, e, t, s, r, o) {
|
|
745
|
+
return U(), V(Ve, null, [
|
|
746
|
+
n.hasCustomSlotContent ? (U(), V("div", et, [
|
|
747
|
+
se("div", de({ ref: "markerRef" }, n.$attrs), [
|
|
748
|
+
z(n.$slots, "content")
|
|
749
|
+
], 16)
|
|
750
|
+
])) : he("", !0),
|
|
751
|
+
z(n.$slots, "default")
|
|
752
|
+
], 64);
|
|
753
|
+
}
|
|
754
|
+
const Tt = /* @__PURE__ */ X(Qe, [["render", tt]]), st = (n) => n === "Marker", rt = (n) => n === re, W = (n, e, t, s) => {
|
|
755
|
+
const r = v(), o = C(B, v()), a = C(Z, v()), l = C(fe, v()), i = G(
|
|
756
|
+
() => !!(l.value && a.value && (r.value instanceof a.value.Marker || r.value instanceof a.value[re]))
|
|
728
757
|
);
|
|
729
|
-
return
|
|
758
|
+
return S(
|
|
730
759
|
[o, t],
|
|
731
|
-
(d, [u,
|
|
732
|
-
var p,
|
|
733
|
-
const h = !A(t.value,
|
|
734
|
-
!o.value || !
|
|
735
|
-
new
|
|
736
|
-
) :
|
|
737
|
-
new
|
|
760
|
+
(d, [u, c]) => {
|
|
761
|
+
var p, f, m;
|
|
762
|
+
const h = !A(t.value, c) || o.value !== u;
|
|
763
|
+
!o.value || !a.value || !h || (r.value ? (r.value.setOptions(t.value), i.value && ((p = l.value) == null || p.removeMarker(r.value), (f = l.value) == null || f.addMarker(r.value))) : (st(n) ? r.value = x(
|
|
764
|
+
new a.value[n](t.value)
|
|
765
|
+
) : rt(n) ? r.value = x(
|
|
766
|
+
new a.value[n](t.value)
|
|
738
767
|
) : r.value = x(
|
|
739
|
-
new
|
|
768
|
+
new a.value[n]({
|
|
740
769
|
...t.value,
|
|
741
770
|
map: o.value
|
|
742
771
|
})
|
|
743
|
-
),
|
|
744
|
-
var
|
|
745
|
-
(
|
|
772
|
+
), i.value ? (m = l.value) == null || m.addMarker(r.value) : r.value.setMap(o.value), e.forEach((g) => {
|
|
773
|
+
var y;
|
|
774
|
+
(y = r.value) == null || y.addListener(g, (_) => s(g, _));
|
|
746
775
|
})));
|
|
747
776
|
},
|
|
748
777
|
{
|
|
749
778
|
immediate: !0
|
|
750
779
|
}
|
|
751
|
-
),
|
|
780
|
+
), j(() => {
|
|
752
781
|
var d, u;
|
|
753
|
-
r.value && ((d =
|
|
782
|
+
r.value && ((d = a.value) == null || d.event.clearInstanceListeners(r.value), i.value ? (u = l.value) == null || u.removeMarker(r.value) : r.value.setMap(null));
|
|
754
783
|
}), r;
|
|
755
|
-
},
|
|
784
|
+
}, Ce = [
|
|
756
785
|
"animation_changed",
|
|
757
786
|
"click",
|
|
758
787
|
"dblclick",
|
|
@@ -776,7 +805,7 @@ const A = /* @__PURE__ */ We(Ke), ge = ["click", "drag", "dragend", "dragstart",
|
|
|
776
805
|
"shape_changed",
|
|
777
806
|
"title_changed",
|
|
778
807
|
"visible_changed"
|
|
779
|
-
],
|
|
808
|
+
], $t = P({
|
|
780
809
|
name: "Marker",
|
|
781
810
|
props: {
|
|
782
811
|
options: {
|
|
@@ -784,15 +813,15 @@ const A = /* @__PURE__ */ We(Ke), ge = ["click", "drag", "dragend", "dragstart",
|
|
|
784
813
|
required: !0
|
|
785
814
|
}
|
|
786
815
|
},
|
|
787
|
-
emits:
|
|
816
|
+
emits: Ce,
|
|
788
817
|
setup(n, { emit: e, expose: t, slots: s }) {
|
|
789
|
-
const r = $(n, "options"), o =
|
|
790
|
-
return
|
|
791
|
-
var
|
|
792
|
-
return (
|
|
818
|
+
const r = $(n, "options"), o = W("Marker", Ce, r, e);
|
|
819
|
+
return D(pe, o), t({ marker: o }), () => {
|
|
820
|
+
var a;
|
|
821
|
+
return (a = s.default) == null ? void 0 : a.call(s);
|
|
793
822
|
};
|
|
794
823
|
}
|
|
795
|
-
}),
|
|
824
|
+
}), Rt = P({
|
|
796
825
|
name: "Polyline",
|
|
797
826
|
props: {
|
|
798
827
|
options: {
|
|
@@ -800,13 +829,13 @@ const A = /* @__PURE__ */ We(Ke), ge = ["click", "drag", "dragend", "dragstart",
|
|
|
800
829
|
required: !0
|
|
801
830
|
}
|
|
802
831
|
},
|
|
803
|
-
emits:
|
|
832
|
+
emits: H,
|
|
804
833
|
setup(n, { emit: e }) {
|
|
805
834
|
const t = $(n, "options");
|
|
806
|
-
return { polyline:
|
|
835
|
+
return { polyline: W("Polyline", H, t, e) };
|
|
807
836
|
},
|
|
808
837
|
render: () => null
|
|
809
|
-
}),
|
|
838
|
+
}), qt = P({
|
|
810
839
|
name: "Polygon",
|
|
811
840
|
props: {
|
|
812
841
|
options: {
|
|
@@ -814,13 +843,13 @@ const A = /* @__PURE__ */ We(Ke), ge = ["click", "drag", "dragend", "dragstart",
|
|
|
814
843
|
required: !0
|
|
815
844
|
}
|
|
816
845
|
},
|
|
817
|
-
emits:
|
|
846
|
+
emits: H,
|
|
818
847
|
setup(n, { emit: e }) {
|
|
819
848
|
const t = $(n, "options");
|
|
820
|
-
return { polygon:
|
|
849
|
+
return { polygon: W("Polygon", H, t, e) };
|
|
821
850
|
},
|
|
822
851
|
render: () => null
|
|
823
|
-
}),
|
|
852
|
+
}), be = H.concat(["bounds_changed"]), jt = P({
|
|
824
853
|
name: "Rectangle",
|
|
825
854
|
props: {
|
|
826
855
|
options: {
|
|
@@ -828,13 +857,13 @@ const A = /* @__PURE__ */ We(Ke), ge = ["click", "drag", "dragend", "dragstart",
|
|
|
828
857
|
required: !0
|
|
829
858
|
}
|
|
830
859
|
},
|
|
831
|
-
emits:
|
|
860
|
+
emits: be,
|
|
832
861
|
setup(n, { emit: e }) {
|
|
833
862
|
const t = $(n, "options");
|
|
834
|
-
return { rectangle:
|
|
863
|
+
return { rectangle: W("Rectangle", be, t, e) };
|
|
835
864
|
},
|
|
836
865
|
render: () => null
|
|
837
|
-
}),
|
|
866
|
+
}), Me = H.concat(["center_changed", "radius_changed"]), Bt = P({
|
|
838
867
|
name: "Circle",
|
|
839
868
|
props: {
|
|
840
869
|
options: {
|
|
@@ -842,13 +871,13 @@ const A = /* @__PURE__ */ We(Ke), ge = ["click", "drag", "dragend", "dragstart",
|
|
|
842
871
|
required: !0
|
|
843
872
|
}
|
|
844
873
|
},
|
|
845
|
-
emits:
|
|
874
|
+
emits: Me,
|
|
846
875
|
setup(n, { emit: e }) {
|
|
847
876
|
const t = $(n, "options");
|
|
848
|
-
return { circle:
|
|
877
|
+
return { circle: W("Circle", Me, t, e) };
|
|
849
878
|
},
|
|
850
879
|
render: () => null
|
|
851
|
-
}),
|
|
880
|
+
}), nt = P({
|
|
852
881
|
props: {
|
|
853
882
|
position: {
|
|
854
883
|
type: String,
|
|
@@ -861,32 +890,32 @@ const A = /* @__PURE__ */ We(Ke), ge = ["click", "drag", "dragend", "dragstart",
|
|
|
861
890
|
},
|
|
862
891
|
emits: ["content:loaded"],
|
|
863
892
|
setup(n, { emit: e }) {
|
|
864
|
-
const t =
|
|
893
|
+
const t = v(null), s = C(B, v()), r = C(Z, v()), o = C(Te, v(!1)), a = S(
|
|
865
894
|
[o, r, t],
|
|
866
|
-
([d, u,
|
|
867
|
-
u && d &&
|
|
895
|
+
([d, u, c]) => {
|
|
896
|
+
u && d && c && (l(n.position), e("content:loaded"), setTimeout(a, 0));
|
|
868
897
|
},
|
|
869
898
|
{ immediate: !0 }
|
|
870
|
-
),
|
|
899
|
+
), l = (d) => {
|
|
871
900
|
if (s.value && r.value && t.value) {
|
|
872
901
|
const u = r.value.ControlPosition[d];
|
|
873
902
|
s.value.controls[u].push(t.value);
|
|
874
903
|
}
|
|
875
|
-
},
|
|
904
|
+
}, i = (d) => {
|
|
876
905
|
if (s.value && r.value) {
|
|
877
906
|
let u = null;
|
|
878
|
-
const
|
|
879
|
-
s.value.controls[
|
|
907
|
+
const c = r.value.ControlPosition[d];
|
|
908
|
+
s.value.controls[c].forEach((h, p) => {
|
|
880
909
|
h === t.value && (u = p);
|
|
881
|
-
}), u !== null && s.value.controls[
|
|
910
|
+
}), u !== null && s.value.controls[c].removeAt(u);
|
|
882
911
|
}
|
|
883
912
|
};
|
|
884
|
-
return
|
|
913
|
+
return j(() => i(n.position)), S(
|
|
885
914
|
() => n.position,
|
|
886
915
|
(d, u) => {
|
|
887
|
-
|
|
916
|
+
i(u), l(d);
|
|
888
917
|
}
|
|
889
|
-
),
|
|
918
|
+
), S(
|
|
890
919
|
() => n.index,
|
|
891
920
|
(d) => {
|
|
892
921
|
d && t.value && (t.value.index = n.index);
|
|
@@ -894,16 +923,16 @@ const A = /* @__PURE__ */ We(Ke), ge = ["click", "drag", "dragend", "dragstart",
|
|
|
894
923
|
), { controlRef: t };
|
|
895
924
|
}
|
|
896
925
|
});
|
|
897
|
-
const
|
|
926
|
+
const ot = {
|
|
898
927
|
ref: "controlRef",
|
|
899
928
|
class: "custom-control-wrapper"
|
|
900
929
|
};
|
|
901
|
-
function
|
|
902
|
-
return
|
|
903
|
-
|
|
930
|
+
function it(n, e, t, s, r, o) {
|
|
931
|
+
return U(), V("div", ot, [
|
|
932
|
+
z(n.$slots, "default", {}, void 0, !0)
|
|
904
933
|
], 512);
|
|
905
934
|
}
|
|
906
|
-
const
|
|
935
|
+
const Zt = /* @__PURE__ */ X(nt, [["render", it], ["__scopeId", "data-v-d099a3a6"]]), Oe = ["closeclick", "content_changed", "domready", "position_changed", "visible", "zindex_changed"], at = P({
|
|
907
936
|
inheritAttrs: !1,
|
|
908
937
|
props: {
|
|
909
938
|
options: {
|
|
@@ -914,68 +943,68 @@ const Tt = /* @__PURE__ */ te(Xe, [["render", et], ["__scopeId", "data-v-d099a3a
|
|
|
914
943
|
type: Boolean
|
|
915
944
|
}
|
|
916
945
|
},
|
|
917
|
-
emits: [...
|
|
946
|
+
emits: [...Oe, "update:modelValue"],
|
|
918
947
|
setup(n, { slots: e, emit: t, expose: s }) {
|
|
919
|
-
const r =
|
|
948
|
+
const r = v(), o = v(), a = C(B, v()), l = C(Z, v()), i = C(pe, v());
|
|
920
949
|
let d, u = n.modelValue;
|
|
921
|
-
const
|
|
922
|
-
var
|
|
923
|
-
return (
|
|
924
|
-
}), h = (
|
|
925
|
-
u =
|
|
926
|
-
}, p = (
|
|
927
|
-
r.value && (r.value.open({ map:
|
|
928
|
-
},
|
|
950
|
+
const c = G(() => {
|
|
951
|
+
var m;
|
|
952
|
+
return (m = e.default) == null ? void 0 : m.call(e).some((g) => g.type !== ue);
|
|
953
|
+
}), h = (m) => {
|
|
954
|
+
u = m, t("update:modelValue", m);
|
|
955
|
+
}, p = (m) => {
|
|
956
|
+
r.value && (r.value.open({ map: a.value, anchor: i.value, ...m }), h(!0));
|
|
957
|
+
}, f = () => {
|
|
929
958
|
r.value && (r.value.close(), h(!1));
|
|
930
959
|
};
|
|
931
|
-
return
|
|
932
|
-
|
|
933
|
-
[
|
|
934
|
-
([
|
|
960
|
+
return Ie(() => {
|
|
961
|
+
S(
|
|
962
|
+
[a, () => n.options],
|
|
963
|
+
([m, g], [y, _]) => {
|
|
935
964
|
var O;
|
|
936
|
-
const
|
|
937
|
-
|
|
965
|
+
const w = !A(g, _) || a.value !== y;
|
|
966
|
+
a.value && l.value && w && (r.value ? (r.value.setOptions({
|
|
938
967
|
...g,
|
|
939
|
-
content:
|
|
940
|
-
}),
|
|
941
|
-
new
|
|
968
|
+
content: c.value ? o.value : g.content
|
|
969
|
+
}), i.value || p()) : (r.value = x(
|
|
970
|
+
new l.value.InfoWindow({
|
|
942
971
|
...g,
|
|
943
|
-
content:
|
|
972
|
+
content: c.value ? o.value : g.content
|
|
944
973
|
})
|
|
945
|
-
),
|
|
974
|
+
), i.value && (d = i.value.addListener("click", () => {
|
|
946
975
|
p();
|
|
947
|
-
})), (!
|
|
976
|
+
})), (!i.value || u) && p(), Oe.forEach((b) => {
|
|
948
977
|
var E;
|
|
949
|
-
(E = r.value) == null || E.addListener(
|
|
978
|
+
(E = r.value) == null || E.addListener(b, (M) => t(b, M));
|
|
950
979
|
}), (O = r.value) == null || O.addListener("closeclick", () => h(!1))));
|
|
951
980
|
},
|
|
952
981
|
{
|
|
953
982
|
immediate: !0
|
|
954
983
|
}
|
|
955
|
-
),
|
|
984
|
+
), S(
|
|
956
985
|
() => n.modelValue,
|
|
957
|
-
(
|
|
958
|
-
|
|
986
|
+
(m) => {
|
|
987
|
+
m !== u && (m ? p() : f());
|
|
959
988
|
}
|
|
960
989
|
);
|
|
961
|
-
}),
|
|
962
|
-
var
|
|
963
|
-
d && d.remove(), r.value && ((
|
|
964
|
-
}), s({ infoWindow: r, open: p, close:
|
|
990
|
+
}), j(() => {
|
|
991
|
+
var m;
|
|
992
|
+
d && d.remove(), r.value && ((m = l.value) == null || m.event.clearInstanceListeners(r.value), f());
|
|
993
|
+
}), s({ infoWindow: r, open: p, close: f }), { infoWindow: r, infoWindowRef: o, hasSlotContent: c, open: p, close: f };
|
|
965
994
|
}
|
|
966
995
|
});
|
|
967
|
-
const
|
|
996
|
+
const lt = {
|
|
968
997
|
key: 0,
|
|
969
998
|
class: "info-window-wrapper"
|
|
970
999
|
};
|
|
971
|
-
function
|
|
972
|
-
return n.hasSlotContent ? (
|
|
973
|
-
|
|
974
|
-
|
|
1000
|
+
function ct(n, e, t, s, r, o) {
|
|
1001
|
+
return n.hasSlotContent ? (U(), V("div", lt, [
|
|
1002
|
+
se("div", de({ ref: "infoWindowRef" }, n.$attrs), [
|
|
1003
|
+
z(n.$slots, "default", {}, void 0, !0)
|
|
975
1004
|
], 16)
|
|
976
|
-
])) :
|
|
1005
|
+
])) : he("", !0);
|
|
977
1006
|
}
|
|
978
|
-
const
|
|
1007
|
+
const Nt = /* @__PURE__ */ X(at, [["render", ct], ["__scopeId", "data-v-cbe1707b"]]), Ee = [
|
|
979
1008
|
Int8Array,
|
|
980
1009
|
Uint8Array,
|
|
981
1010
|
Uint8ClampedArray,
|
|
@@ -985,8 +1014,8 @@ const $t = /* @__PURE__ */ te(tt, [["render", rt], ["__scopeId", "data-v-cbe1707
|
|
|
985
1014
|
Uint32Array,
|
|
986
1015
|
Float32Array,
|
|
987
1016
|
Float64Array
|
|
988
|
-
],
|
|
989
|
-
class
|
|
1017
|
+
], ie = 1, K = 8;
|
|
1018
|
+
class me {
|
|
990
1019
|
/**
|
|
991
1020
|
* Creates an index from raw `ArrayBuffer` data.
|
|
992
1021
|
* @param {ArrayBuffer} data
|
|
@@ -998,13 +1027,13 @@ class ue {
|
|
|
998
1027
|
if (t !== 219)
|
|
999
1028
|
throw new Error("Data does not appear to be in a KDBush format.");
|
|
1000
1029
|
const r = s >> 4;
|
|
1001
|
-
if (r !==
|
|
1002
|
-
throw new Error(`Got v${r} data when expected v${
|
|
1003
|
-
const o =
|
|
1030
|
+
if (r !== ie)
|
|
1031
|
+
throw new Error(`Got v${r} data when expected v${ie}.`);
|
|
1032
|
+
const o = Ee[s & 15];
|
|
1004
1033
|
if (!o)
|
|
1005
1034
|
throw new Error("Unrecognized array type.");
|
|
1006
|
-
const [
|
|
1007
|
-
return new
|
|
1035
|
+
const [a] = new Uint16Array(e, 2, 1), [l] = new Uint32Array(e, 4, 1);
|
|
1036
|
+
return new me(l, a, o, e);
|
|
1008
1037
|
}
|
|
1009
1038
|
/**
|
|
1010
1039
|
* Creates an index that will hold a given number of items.
|
|
@@ -1017,10 +1046,10 @@ class ue {
|
|
|
1017
1046
|
if (isNaN(e) || e < 0)
|
|
1018
1047
|
throw new Error(`Unpexpected numItems value: ${e}.`);
|
|
1019
1048
|
this.numItems = +e, this.nodeSize = Math.min(Math.max(+t, 2), 65535), this.ArrayType = s, this.IndexArrayType = e < 65536 ? Uint16Array : Uint32Array;
|
|
1020
|
-
const o =
|
|
1049
|
+
const o = Ee.indexOf(this.ArrayType), a = e * 2 * this.ArrayType.BYTES_PER_ELEMENT, l = e * this.IndexArrayType.BYTES_PER_ELEMENT, i = (8 - l % 8) % 8;
|
|
1021
1050
|
if (o < 0)
|
|
1022
1051
|
throw new Error(`Unexpected typed array class: ${s}.`);
|
|
1023
|
-
r && r instanceof ArrayBuffer ? (this.data = r, this.ids = new this.IndexArrayType(this.data,
|
|
1052
|
+
r && r instanceof ArrayBuffer ? (this.data = r, this.ids = new this.IndexArrayType(this.data, K, e), this.coords = new this.ArrayType(this.data, K + l + i, e * 2), this._pos = e * 2, this._finished = !0) : (this.data = new ArrayBuffer(K + a + l + i), this.ids = new this.IndexArrayType(this.data, K, e), this.coords = new this.ArrayType(this.data, K + l + i, e * 2), this._pos = 0, this._finished = !1, new Uint8Array(this.data, 0, 2).set([219, (ie << 4) + o]), new Uint16Array(this.data, 2, 1)[0] = t, new Uint32Array(this.data, 4, 1)[0] = e);
|
|
1024
1053
|
}
|
|
1025
1054
|
/**
|
|
1026
1055
|
* Add a point to the index.
|
|
@@ -1039,7 +1068,7 @@ class ue {
|
|
|
1039
1068
|
const e = this._pos >> 1;
|
|
1040
1069
|
if (e !== this.numItems)
|
|
1041
1070
|
throw new Error(`Added ${e} items when expected ${this.numItems}.`);
|
|
1042
|
-
return
|
|
1071
|
+
return ce(this.ids, this.coords, this.nodeSize, 0, this.numItems - 1, 0), this._finished = !0, this;
|
|
1043
1072
|
}
|
|
1044
1073
|
/**
|
|
1045
1074
|
* Search the index for items within a given bounding box.
|
|
@@ -1052,18 +1081,18 @@ class ue {
|
|
|
1052
1081
|
range(e, t, s, r) {
|
|
1053
1082
|
if (!this._finished)
|
|
1054
1083
|
throw new Error("Data not yet indexed - call index.finish().");
|
|
1055
|
-
const { ids: o, coords:
|
|
1056
|
-
for (;
|
|
1057
|
-
const u =
|
|
1058
|
-
if (
|
|
1059
|
-
for (let g = h; g <=
|
|
1060
|
-
const
|
|
1061
|
-
|
|
1084
|
+
const { ids: o, coords: a, nodeSize: l } = this, i = [0, o.length - 1, 0], d = [];
|
|
1085
|
+
for (; i.length; ) {
|
|
1086
|
+
const u = i.pop() || 0, c = i.pop() || 0, h = i.pop() || 0;
|
|
1087
|
+
if (c - h <= l) {
|
|
1088
|
+
for (let g = h; g <= c; g++) {
|
|
1089
|
+
const y = a[2 * g], _ = a[2 * g + 1];
|
|
1090
|
+
y >= e && y <= s && _ >= t && _ <= r && d.push(o[g]);
|
|
1062
1091
|
}
|
|
1063
1092
|
continue;
|
|
1064
1093
|
}
|
|
1065
|
-
const p = h +
|
|
1066
|
-
|
|
1094
|
+
const p = h + c >> 1, f = a[2 * p], m = a[2 * p + 1];
|
|
1095
|
+
f >= e && f <= s && m >= t && m <= r && d.push(o[p]), (u === 0 ? e <= f : t <= m) && (i.push(h), i.push(p - 1), i.push(1 - u)), (u === 0 ? s >= f : r >= m) && (i.push(p + 1), i.push(c), i.push(1 - u));
|
|
1067
1096
|
}
|
|
1068
1097
|
return d;
|
|
1069
1098
|
}
|
|
@@ -1077,55 +1106,55 @@ class ue {
|
|
|
1077
1106
|
within(e, t, s) {
|
|
1078
1107
|
if (!this._finished)
|
|
1079
1108
|
throw new Error("Data not yet indexed - call index.finish().");
|
|
1080
|
-
const { ids: r, coords: o, nodeSize:
|
|
1081
|
-
for (;
|
|
1082
|
-
const u =
|
|
1083
|
-
if (
|
|
1084
|
-
for (let g = h; g <=
|
|
1085
|
-
|
|
1109
|
+
const { ids: r, coords: o, nodeSize: a } = this, l = [0, r.length - 1, 0], i = [], d = s * s;
|
|
1110
|
+
for (; l.length; ) {
|
|
1111
|
+
const u = l.pop() || 0, c = l.pop() || 0, h = l.pop() || 0;
|
|
1112
|
+
if (c - h <= a) {
|
|
1113
|
+
for (let g = h; g <= c; g++)
|
|
1114
|
+
Pe(o[2 * g], o[2 * g + 1], e, t) <= d && i.push(r[g]);
|
|
1086
1115
|
continue;
|
|
1087
1116
|
}
|
|
1088
|
-
const p = h +
|
|
1089
|
-
|
|
1117
|
+
const p = h + c >> 1, f = o[2 * p], m = o[2 * p + 1];
|
|
1118
|
+
Pe(f, m, e, t) <= d && i.push(r[p]), (u === 0 ? e - s <= f : t - s <= m) && (l.push(h), l.push(p - 1), l.push(1 - u)), (u === 0 ? e + s >= f : t + s >= m) && (l.push(p + 1), l.push(c), l.push(1 - u));
|
|
1090
1119
|
}
|
|
1091
|
-
return
|
|
1120
|
+
return i;
|
|
1092
1121
|
}
|
|
1093
1122
|
}
|
|
1094
|
-
function
|
|
1123
|
+
function ce(n, e, t, s, r, o) {
|
|
1095
1124
|
if (r - s <= t)
|
|
1096
1125
|
return;
|
|
1097
|
-
const
|
|
1098
|
-
|
|
1126
|
+
const a = s + r >> 1;
|
|
1127
|
+
$e(n, e, a, s, r, o), ce(n, e, t, s, a - 1, 1 - o), ce(n, e, t, a + 1, r, 1 - o);
|
|
1099
1128
|
}
|
|
1100
|
-
function
|
|
1129
|
+
function $e(n, e, t, s, r, o) {
|
|
1101
1130
|
for (; r > s; ) {
|
|
1102
1131
|
if (r - s > 600) {
|
|
1103
|
-
const d = r - s + 1, u = t - s + 1,
|
|
1104
|
-
|
|
1132
|
+
const d = r - s + 1, u = t - s + 1, c = Math.log(d), h = 0.5 * Math.exp(2 * c / 3), p = 0.5 * Math.sqrt(c * h * (d - h) / d) * (u - d / 2 < 0 ? -1 : 1), f = Math.max(s, Math.floor(t - u * h / d + p)), m = Math.min(r, Math.floor(t + (d - u) * h / d + p));
|
|
1133
|
+
$e(n, e, t, f, m, o);
|
|
1105
1134
|
}
|
|
1106
|
-
const
|
|
1107
|
-
let
|
|
1108
|
-
for (
|
|
1109
|
-
for (
|
|
1110
|
-
|
|
1111
|
-
for (; e[2 *
|
|
1112
|
-
|
|
1135
|
+
const a = e[2 * t + o];
|
|
1136
|
+
let l = s, i = r;
|
|
1137
|
+
for (Y(n, e, s, t), e[2 * r + o] > a && Y(n, e, s, r); l < i; ) {
|
|
1138
|
+
for (Y(n, e, l, i), l++, i--; e[2 * l + o] < a; )
|
|
1139
|
+
l++;
|
|
1140
|
+
for (; e[2 * i + o] > a; )
|
|
1141
|
+
i--;
|
|
1113
1142
|
}
|
|
1114
|
-
e[2 * s + o] ===
|
|
1143
|
+
e[2 * s + o] === a ? Y(n, e, s, i) : (i++, Y(n, e, i, r)), i <= t && (s = i + 1), t <= i && (r = i - 1);
|
|
1115
1144
|
}
|
|
1116
1145
|
}
|
|
1117
|
-
function
|
|
1118
|
-
|
|
1146
|
+
function Y(n, e, t, s) {
|
|
1147
|
+
ae(n, t, s), ae(e, 2 * t, 2 * s), ae(e, 2 * t + 1, 2 * s + 1);
|
|
1119
1148
|
}
|
|
1120
|
-
function
|
|
1149
|
+
function ae(n, e, t) {
|
|
1121
1150
|
const s = n[e];
|
|
1122
1151
|
n[e] = n[t], n[t] = s;
|
|
1123
1152
|
}
|
|
1124
|
-
function
|
|
1153
|
+
function Pe(n, e, t, s) {
|
|
1125
1154
|
const r = n - t, o = e - s;
|
|
1126
1155
|
return r * r + o * o;
|
|
1127
1156
|
}
|
|
1128
|
-
const
|
|
1157
|
+
const ut = {
|
|
1129
1158
|
minZoom: 0,
|
|
1130
1159
|
// min zoom to generate clusters on
|
|
1131
1160
|
maxZoom: 16,
|
|
@@ -1148,41 +1177,41 @@ const nt = {
|
|
|
1148
1177
|
// properties to use for individual points when running the reducer
|
|
1149
1178
|
map: (n) => n
|
|
1150
1179
|
// props => ({sum: props.my_value})
|
|
1151
|
-
},
|
|
1152
|
-
class
|
|
1180
|
+
}, Se = Math.fround || ((n) => (e) => (n[0] = +e, n[0]))(new Float32Array(1)), R = 2, T = 3, le = 4, I = 5, Re = 6;
|
|
1181
|
+
class qe {
|
|
1153
1182
|
constructor(e) {
|
|
1154
|
-
this.options = Object.assign(Object.create(
|
|
1183
|
+
this.options = Object.assign(Object.create(ut), e), this.trees = new Array(this.options.maxZoom + 1), this.stride = this.options.reduce ? 7 : 6, this.clusterProps = [];
|
|
1155
1184
|
}
|
|
1156
1185
|
load(e) {
|
|
1157
1186
|
const { log: t, minZoom: s, maxZoom: r } = this.options;
|
|
1158
1187
|
t && console.time("total time");
|
|
1159
1188
|
const o = `prepare ${e.length} points`;
|
|
1160
1189
|
t && console.time(o), this.points = e;
|
|
1161
|
-
const
|
|
1162
|
-
for (let
|
|
1163
|
-
const d = e[
|
|
1190
|
+
const a = [];
|
|
1191
|
+
for (let i = 0; i < e.length; i++) {
|
|
1192
|
+
const d = e[i];
|
|
1164
1193
|
if (!d.geometry)
|
|
1165
1194
|
continue;
|
|
1166
|
-
const [u,
|
|
1167
|
-
|
|
1195
|
+
const [u, c] = d.geometry.coordinates, h = Se(ee(u)), p = Se(te(c));
|
|
1196
|
+
a.push(
|
|
1168
1197
|
h,
|
|
1169
1198
|
p,
|
|
1170
1199
|
// projected point coordinates
|
|
1171
1200
|
1 / 0,
|
|
1172
1201
|
// the last zoom the point was processed at
|
|
1173
|
-
|
|
1202
|
+
i,
|
|
1174
1203
|
// index of the source feature in the original input array
|
|
1175
1204
|
-1,
|
|
1176
1205
|
// parent cluster id
|
|
1177
1206
|
1
|
|
1178
1207
|
// number of points in a cluster
|
|
1179
|
-
), this.options.reduce &&
|
|
1208
|
+
), this.options.reduce && a.push(0);
|
|
1180
1209
|
}
|
|
1181
|
-
let
|
|
1210
|
+
let l = this.trees[r + 1] = this._createTree(a);
|
|
1182
1211
|
t && console.timeEnd(o);
|
|
1183
|
-
for (let
|
|
1212
|
+
for (let i = r; i >= s; i--) {
|
|
1184
1213
|
const d = +Date.now();
|
|
1185
|
-
|
|
1214
|
+
l = this.trees[i] = this._createTree(this._cluster(l, i)), t && console.log("z%d: %d clusters in %dms", i, l.numItems, +Date.now() - d);
|
|
1186
1215
|
}
|
|
1187
1216
|
return t && console.timeEnd("total time"), this;
|
|
1188
1217
|
}
|
|
@@ -1190,17 +1219,17 @@ class $e {
|
|
|
1190
1219
|
let s = ((e[0] + 180) % 360 + 360) % 360 - 180;
|
|
1191
1220
|
const r = Math.max(-90, Math.min(90, e[1]));
|
|
1192
1221
|
let o = e[2] === 180 ? 180 : ((e[2] + 180) % 360 + 360) % 360 - 180;
|
|
1193
|
-
const
|
|
1222
|
+
const a = Math.max(-90, Math.min(90, e[3]));
|
|
1194
1223
|
if (e[2] - e[0] >= 360)
|
|
1195
1224
|
s = -180, o = 180;
|
|
1196
1225
|
else if (s > o) {
|
|
1197
|
-
const
|
|
1198
|
-
return
|
|
1226
|
+
const c = this.getClusters([s, r, 180, a], t), h = this.getClusters([-180, r, o, a], t);
|
|
1227
|
+
return c.concat(h);
|
|
1199
1228
|
}
|
|
1200
|
-
const
|
|
1201
|
-
for (const
|
|
1202
|
-
const h = this.stride *
|
|
1203
|
-
u.push(d[h + I] > 1 ?
|
|
1229
|
+
const l = this.trees[this._limitZoom(t)], i = l.range(ee(s), te(a), ee(o), te(r)), d = l.data, u = [];
|
|
1230
|
+
for (const c of i) {
|
|
1231
|
+
const h = this.stride * c;
|
|
1232
|
+
u.push(d[h + I] > 1 ? Le(d, h, this.clusterProps) : this.points[d[h + T]]);
|
|
1204
1233
|
}
|
|
1205
1234
|
return u;
|
|
1206
1235
|
}
|
|
@@ -1208,17 +1237,17 @@ class $e {
|
|
|
1208
1237
|
const t = this._getOriginId(e), s = this._getOriginZoom(e), r = "No cluster with the specified id.", o = this.trees[s];
|
|
1209
1238
|
if (!o)
|
|
1210
1239
|
throw new Error(r);
|
|
1211
|
-
const
|
|
1212
|
-
if (t * this.stride >=
|
|
1240
|
+
const a = o.data;
|
|
1241
|
+
if (t * this.stride >= a.length)
|
|
1213
1242
|
throw new Error(r);
|
|
1214
|
-
const
|
|
1243
|
+
const l = this.options.radius / (this.options.extent * Math.pow(2, s - 1)), i = a[t * this.stride], d = a[t * this.stride + 1], u = o.within(i, d, l), c = [];
|
|
1215
1244
|
for (const h of u) {
|
|
1216
1245
|
const p = h * this.stride;
|
|
1217
|
-
|
|
1246
|
+
a[p + le] === e && c.push(a[p + I] > 1 ? Le(a, p, this.clusterProps) : this.points[a[p + T]]);
|
|
1218
1247
|
}
|
|
1219
|
-
if (
|
|
1248
|
+
if (c.length === 0)
|
|
1220
1249
|
throw new Error(r);
|
|
1221
|
-
return
|
|
1250
|
+
return c;
|
|
1222
1251
|
}
|
|
1223
1252
|
getLeaves(e, t, s) {
|
|
1224
1253
|
t = t || 10, s = s || 0;
|
|
@@ -1226,31 +1255,31 @@ class $e {
|
|
|
1226
1255
|
return this._appendLeaves(r, e, t, s, 0), r;
|
|
1227
1256
|
}
|
|
1228
1257
|
getTile(e, t, s) {
|
|
1229
|
-
const r = this.trees[this._limitZoom(e)], o = Math.pow(2, e), { extent:
|
|
1258
|
+
const r = this.trees[this._limitZoom(e)], o = Math.pow(2, e), { extent: a, radius: l } = this.options, i = l / a, d = (s - i) / o, u = (s + 1 + i) / o, c = {
|
|
1230
1259
|
features: []
|
|
1231
1260
|
};
|
|
1232
1261
|
return this._addTileFeatures(
|
|
1233
|
-
r.range((t -
|
|
1262
|
+
r.range((t - i) / o, d, (t + 1 + i) / o, u),
|
|
1234
1263
|
r.data,
|
|
1235
1264
|
t,
|
|
1236
1265
|
s,
|
|
1237
1266
|
o,
|
|
1238
|
-
|
|
1267
|
+
c
|
|
1239
1268
|
), t === 0 && this._addTileFeatures(
|
|
1240
|
-
r.range(1 -
|
|
1269
|
+
r.range(1 - i / o, d, 1, u),
|
|
1241
1270
|
r.data,
|
|
1242
1271
|
o,
|
|
1243
1272
|
s,
|
|
1244
1273
|
o,
|
|
1245
|
-
|
|
1274
|
+
c
|
|
1246
1275
|
), t === o - 1 && this._addTileFeatures(
|
|
1247
|
-
r.range(0, d,
|
|
1276
|
+
r.range(0, d, i / o, u),
|
|
1248
1277
|
r.data,
|
|
1249
1278
|
-1,
|
|
1250
1279
|
s,
|
|
1251
1280
|
o,
|
|
1252
|
-
|
|
1253
|
-
),
|
|
1281
|
+
c
|
|
1282
|
+
), c.features.length ? c : null;
|
|
1254
1283
|
}
|
|
1255
1284
|
getClusterExpansionZoom(e) {
|
|
1256
1285
|
let t = this._getOriginZoom(e) - 1;
|
|
@@ -1263,81 +1292,81 @@ class $e {
|
|
|
1263
1292
|
return t;
|
|
1264
1293
|
}
|
|
1265
1294
|
_appendLeaves(e, t, s, r, o) {
|
|
1266
|
-
const
|
|
1267
|
-
for (const
|
|
1268
|
-
const
|
|
1269
|
-
if (
|
|
1295
|
+
const a = this.getChildren(t);
|
|
1296
|
+
for (const l of a) {
|
|
1297
|
+
const i = l.properties;
|
|
1298
|
+
if (i && i.cluster ? o + i.point_count <= r ? o += i.point_count : o = this._appendLeaves(e, i.cluster_id, s, r, o) : o < r ? o++ : e.push(l), e.length === s)
|
|
1270
1299
|
break;
|
|
1271
1300
|
}
|
|
1272
1301
|
return o;
|
|
1273
1302
|
}
|
|
1274
1303
|
_createTree(e) {
|
|
1275
|
-
const t = new
|
|
1304
|
+
const t = new me(e.length / this.stride | 0, this.options.nodeSize, Float32Array);
|
|
1276
1305
|
for (let s = 0; s < e.length; s += this.stride)
|
|
1277
1306
|
t.add(e[s], e[s + 1]);
|
|
1278
1307
|
return t.finish(), t.data = e, t;
|
|
1279
1308
|
}
|
|
1280
|
-
_addTileFeatures(e, t, s, r, o,
|
|
1281
|
-
for (const
|
|
1282
|
-
const
|
|
1283
|
-
let u,
|
|
1309
|
+
_addTileFeatures(e, t, s, r, o, a) {
|
|
1310
|
+
for (const l of e) {
|
|
1311
|
+
const i = l * this.stride, d = t[i + I] > 1;
|
|
1312
|
+
let u, c, h;
|
|
1284
1313
|
if (d)
|
|
1285
|
-
u =
|
|
1314
|
+
u = je(t, i, this.clusterProps), c = t[i], h = t[i + 1];
|
|
1286
1315
|
else {
|
|
1287
|
-
const
|
|
1288
|
-
u =
|
|
1289
|
-
const [g,
|
|
1290
|
-
|
|
1316
|
+
const m = this.points[t[i + T]];
|
|
1317
|
+
u = m.properties;
|
|
1318
|
+
const [g, y] = m.geometry.coordinates;
|
|
1319
|
+
c = ee(g), h = te(y);
|
|
1291
1320
|
}
|
|
1292
1321
|
const p = {
|
|
1293
1322
|
type: 1,
|
|
1294
1323
|
geometry: [[
|
|
1295
|
-
Math.round(this.options.extent * (
|
|
1324
|
+
Math.round(this.options.extent * (c * o - s)),
|
|
1296
1325
|
Math.round(this.options.extent * (h * o - r))
|
|
1297
1326
|
]],
|
|
1298
1327
|
tags: u
|
|
1299
1328
|
};
|
|
1300
|
-
let
|
|
1301
|
-
d || this.options.generateId ?
|
|
1329
|
+
let f;
|
|
1330
|
+
d || this.options.generateId ? f = t[i + T] : f = this.points[t[i + T]].id, f !== void 0 && (p.id = f), a.features.push(p);
|
|
1302
1331
|
}
|
|
1303
1332
|
}
|
|
1304
1333
|
_limitZoom(e) {
|
|
1305
1334
|
return Math.max(this.options.minZoom, Math.min(Math.floor(+e), this.options.maxZoom + 1));
|
|
1306
1335
|
}
|
|
1307
1336
|
_cluster(e, t) {
|
|
1308
|
-
const { radius: s, extent: r, reduce: o, minPoints:
|
|
1309
|
-
for (let
|
|
1310
|
-
if (
|
|
1337
|
+
const { radius: s, extent: r, reduce: o, minPoints: a } = this.options, l = s / (r * Math.pow(2, t)), i = e.data, d = [], u = this.stride;
|
|
1338
|
+
for (let c = 0; c < i.length; c += u) {
|
|
1339
|
+
if (i[c + R] <= t)
|
|
1311
1340
|
continue;
|
|
1312
|
-
|
|
1313
|
-
const h =
|
|
1314
|
-
let g =
|
|
1315
|
-
for (const
|
|
1316
|
-
const
|
|
1317
|
-
|
|
1341
|
+
i[c + R] = t;
|
|
1342
|
+
const h = i[c], p = i[c + 1], f = e.within(i[c], i[c + 1], l), m = i[c + I];
|
|
1343
|
+
let g = m;
|
|
1344
|
+
for (const y of f) {
|
|
1345
|
+
const _ = y * u;
|
|
1346
|
+
i[_ + R] > t && (g += i[_ + I]);
|
|
1318
1347
|
}
|
|
1319
|
-
if (g >
|
|
1320
|
-
let
|
|
1321
|
-
const
|
|
1322
|
-
for (const E of
|
|
1323
|
-
const
|
|
1324
|
-
if (
|
|
1348
|
+
if (g > m && g >= a) {
|
|
1349
|
+
let y = h * m, _ = p * m, w, O = -1;
|
|
1350
|
+
const b = ((c / u | 0) << 5) + (t + 1) + this.points.length;
|
|
1351
|
+
for (const E of f) {
|
|
1352
|
+
const M = E * u;
|
|
1353
|
+
if (i[M + R] <= t)
|
|
1325
1354
|
continue;
|
|
1326
|
-
|
|
1327
|
-
const
|
|
1328
|
-
|
|
1355
|
+
i[M + R] = t;
|
|
1356
|
+
const L = i[M + I];
|
|
1357
|
+
y += i[M] * L, _ += i[M + 1] * L, i[M + le] = b, o && (w || (w = this._map(i, c, !0), O = this.clusterProps.length, this.clusterProps.push(w)), o(w, this._map(i, M)));
|
|
1329
1358
|
}
|
|
1330
|
-
|
|
1359
|
+
i[c + le] = b, d.push(y / g, _ / g, 1 / 0, b, -1, g), o && d.push(O);
|
|
1331
1360
|
} else {
|
|
1332
|
-
for (let
|
|
1333
|
-
d.push(
|
|
1361
|
+
for (let y = 0; y < u; y++)
|
|
1362
|
+
d.push(i[c + y]);
|
|
1334
1363
|
if (g > 1)
|
|
1335
|
-
for (const
|
|
1336
|
-
const
|
|
1337
|
-
if (!(
|
|
1338
|
-
|
|
1339
|
-
for (let
|
|
1340
|
-
d.push(
|
|
1364
|
+
for (const y of f) {
|
|
1365
|
+
const _ = y * u;
|
|
1366
|
+
if (!(i[_ + R] <= t)) {
|
|
1367
|
+
i[_ + R] = t;
|
|
1368
|
+
for (let w = 0; w < u; w++)
|
|
1369
|
+
d.push(i[_ + w]);
|
|
1341
1370
|
}
|
|
1342
1371
|
}
|
|
1343
1372
|
}
|
|
@@ -1354,44 +1383,44 @@ class $e {
|
|
|
1354
1383
|
}
|
|
1355
1384
|
_map(e, t, s) {
|
|
1356
1385
|
if (e[t + I] > 1) {
|
|
1357
|
-
const
|
|
1358
|
-
return s ? Object.assign({},
|
|
1386
|
+
const a = this.clusterProps[e[t + Re]];
|
|
1387
|
+
return s ? Object.assign({}, a) : a;
|
|
1359
1388
|
}
|
|
1360
1389
|
const r = this.points[e[t + T]].properties, o = this.options.map(r);
|
|
1361
1390
|
return s && o === r ? Object.assign({}, o) : o;
|
|
1362
1391
|
}
|
|
1363
1392
|
}
|
|
1364
|
-
function
|
|
1393
|
+
function Le(n, e, t) {
|
|
1365
1394
|
return {
|
|
1366
1395
|
type: "Feature",
|
|
1367
1396
|
id: n[e + T],
|
|
1368
|
-
properties:
|
|
1397
|
+
properties: je(n, e, t),
|
|
1369
1398
|
geometry: {
|
|
1370
1399
|
type: "Point",
|
|
1371
|
-
coordinates: [
|
|
1400
|
+
coordinates: [dt(n[e]), ht(n[e + 1])]
|
|
1372
1401
|
}
|
|
1373
1402
|
};
|
|
1374
1403
|
}
|
|
1375
|
-
function
|
|
1376
|
-
const s = n[e + I], r = s >= 1e4 ? `${Math.round(s / 1e3)}k` : s >= 1e3 ? `${Math.round(s / 100) / 10}k` : s, o = n[e +
|
|
1377
|
-
return Object.assign(
|
|
1404
|
+
function je(n, e, t) {
|
|
1405
|
+
const s = n[e + I], r = s >= 1e4 ? `${Math.round(s / 1e3)}k` : s >= 1e3 ? `${Math.round(s / 100) / 10}k` : s, o = n[e + Re], a = o === -1 ? {} : Object.assign({}, t[o]);
|
|
1406
|
+
return Object.assign(a, {
|
|
1378
1407
|
cluster: !0,
|
|
1379
1408
|
cluster_id: n[e + T],
|
|
1380
1409
|
point_count: s,
|
|
1381
1410
|
point_count_abbreviated: r
|
|
1382
1411
|
});
|
|
1383
1412
|
}
|
|
1384
|
-
function
|
|
1413
|
+
function ee(n) {
|
|
1385
1414
|
return n / 360 + 0.5;
|
|
1386
1415
|
}
|
|
1387
|
-
function
|
|
1416
|
+
function te(n) {
|
|
1388
1417
|
const e = Math.sin(n * Math.PI / 180), t = 0.5 - 0.25 * Math.log((1 + e) / (1 - e)) / Math.PI;
|
|
1389
1418
|
return t < 0 ? 0 : t > 1 ? 1 : t;
|
|
1390
1419
|
}
|
|
1391
|
-
function
|
|
1420
|
+
function dt(n) {
|
|
1392
1421
|
return (n - 0.5) * 360;
|
|
1393
1422
|
}
|
|
1394
|
-
function
|
|
1423
|
+
function ht(n) {
|
|
1395
1424
|
const e = (180 - n * 360) * Math.PI / 180;
|
|
1396
1425
|
return 360 * Math.atan(Math.exp(e)) / Math.PI - 90;
|
|
1397
1426
|
}
|
|
@@ -1409,7 +1438,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
1409
1438
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
1410
1439
|
PERFORMANCE OF THIS SOFTWARE.
|
|
1411
1440
|
***************************************************************************** */
|
|
1412
|
-
function
|
|
1441
|
+
function ge(n, e) {
|
|
1413
1442
|
var t = {};
|
|
1414
1443
|
for (var s in n)
|
|
1415
1444
|
Object.prototype.hasOwnProperty.call(n, s) && e.indexOf(s) < 0 && (t[s] = n[s]);
|
|
@@ -1418,7 +1447,7 @@ function de(n, e) {
|
|
|
1418
1447
|
e.indexOf(s[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, s[r]) && (t[s[r]] = n[s[r]]);
|
|
1419
1448
|
return t;
|
|
1420
1449
|
}
|
|
1421
|
-
class
|
|
1450
|
+
class k {
|
|
1422
1451
|
static isAdvancedMarkerAvailable(e) {
|
|
1423
1452
|
return google.maps.marker && e.getMapCapabilities().isAdvancedMarkersAvailable === !0;
|
|
1424
1453
|
}
|
|
@@ -1444,7 +1473,7 @@ class C {
|
|
|
1444
1473
|
return this.isAdvancedMarker(e) ? !0 : e.getVisible();
|
|
1445
1474
|
}
|
|
1446
1475
|
}
|
|
1447
|
-
class
|
|
1476
|
+
class J {
|
|
1448
1477
|
constructor({ markers: e, position: t }) {
|
|
1449
1478
|
this.markers = e, t && (t instanceof google.maps.LatLng ? this._position = t : this._position = new google.maps.LatLng(t));
|
|
1450
1479
|
}
|
|
@@ -1453,7 +1482,7 @@ class W {
|
|
|
1453
1482
|
return;
|
|
1454
1483
|
const e = new google.maps.LatLngBounds(this._position, this._position);
|
|
1455
1484
|
for (const t of this.markers)
|
|
1456
|
-
e.extend(
|
|
1485
|
+
e.extend(k.getPosition(t));
|
|
1457
1486
|
return e;
|
|
1458
1487
|
}
|
|
1459
1488
|
get position() {
|
|
@@ -1463,7 +1492,7 @@ class W {
|
|
|
1463
1492
|
* Get the count of **visible** markers.
|
|
1464
1493
|
*/
|
|
1465
1494
|
get count() {
|
|
1466
|
-
return this.markers.filter((e) =>
|
|
1495
|
+
return this.markers.filter((e) => k.getVisible(e)).length;
|
|
1467
1496
|
}
|
|
1468
1497
|
/**
|
|
1469
1498
|
* Add a marker to the cluster.
|
|
@@ -1475,26 +1504,26 @@ class W {
|
|
|
1475
1504
|
* Cleanup references and remove marker from map.
|
|
1476
1505
|
*/
|
|
1477
1506
|
delete() {
|
|
1478
|
-
this.marker && (
|
|
1507
|
+
this.marker && (k.setMap(this.marker, null), this.marker = void 0), this.markers.length = 0;
|
|
1479
1508
|
}
|
|
1480
1509
|
}
|
|
1481
|
-
const
|
|
1482
|
-
const r =
|
|
1483
|
-
return t.filter((o) => r.contains(
|
|
1484
|
-
},
|
|
1485
|
-
const { northEast: s, southWest: r } =
|
|
1486
|
-
return
|
|
1487
|
-
},
|
|
1488
|
-
const s =
|
|
1510
|
+
const pt = (n, e, t, s) => {
|
|
1511
|
+
const r = Be(n.getBounds(), e, s);
|
|
1512
|
+
return t.filter((o) => r.contains(k.getPosition(o)));
|
|
1513
|
+
}, Be = (n, e, t) => {
|
|
1514
|
+
const { northEast: s, southWest: r } = ft(n, e), o = mt({ northEast: s, southWest: r }, t);
|
|
1515
|
+
return gt(o, e);
|
|
1516
|
+
}, xe = (n, e, t) => {
|
|
1517
|
+
const s = Be(n, e, t), r = s.getNorthEast(), o = s.getSouthWest();
|
|
1489
1518
|
return [o.lng(), o.lat(), r.lng(), r.lat()];
|
|
1490
|
-
},
|
|
1519
|
+
}, ft = (n, e) => ({
|
|
1491
1520
|
northEast: e.fromLatLngToDivPixel(n.getNorthEast()),
|
|
1492
1521
|
southWest: e.fromLatLngToDivPixel(n.getSouthWest())
|
|
1493
|
-
}),
|
|
1522
|
+
}), mt = ({ northEast: n, southWest: e }, t) => (n.x += t, n.y -= t, e.x -= t, e.y += t, { northEast: n, southWest: e }), gt = ({ northEast: n, southWest: e }, t) => {
|
|
1494
1523
|
const s = t.fromDivPixelToLatLng(e), r = t.fromDivPixelToLatLng(n);
|
|
1495
1524
|
return new google.maps.LatLngBounds(s, r);
|
|
1496
1525
|
};
|
|
1497
|
-
class
|
|
1526
|
+
class Ze {
|
|
1498
1527
|
constructor({ maxZoom: e = 16 }) {
|
|
1499
1528
|
this.maxZoom = e;
|
|
1500
1529
|
}
|
|
@@ -1511,12 +1540,12 @@ class qe {
|
|
|
1511
1540
|
* ```
|
|
1512
1541
|
*/
|
|
1513
1542
|
noop({ markers: e }) {
|
|
1514
|
-
return
|
|
1543
|
+
return yt(e);
|
|
1515
1544
|
}
|
|
1516
1545
|
}
|
|
1517
|
-
class
|
|
1546
|
+
class vt extends Ze {
|
|
1518
1547
|
constructor(e) {
|
|
1519
|
-
var { viewportPadding: t = 60 } = e, s =
|
|
1548
|
+
var { viewportPadding: t = 60 } = e, s = ge(e, ["viewportPadding"]);
|
|
1520
1549
|
super(s), this.viewportPadding = 60, this.viewportPadding = t;
|
|
1521
1550
|
}
|
|
1522
1551
|
calculate({ markers: e, map: t, mapCanvasProjection: s }) {
|
|
@@ -1527,21 +1556,21 @@ class dt extends qe {
|
|
|
1527
1556
|
changed: !1
|
|
1528
1557
|
} : {
|
|
1529
1558
|
clusters: this.cluster({
|
|
1530
|
-
markers:
|
|
1559
|
+
markers: pt(t, s, e, this.viewportPadding),
|
|
1531
1560
|
map: t,
|
|
1532
1561
|
mapCanvasProjection: s
|
|
1533
1562
|
})
|
|
1534
1563
|
};
|
|
1535
1564
|
}
|
|
1536
1565
|
}
|
|
1537
|
-
const
|
|
1538
|
-
position:
|
|
1566
|
+
const yt = (n) => n.map((t) => new J({
|
|
1567
|
+
position: k.getPosition(t),
|
|
1539
1568
|
markers: [t]
|
|
1540
1569
|
}));
|
|
1541
|
-
class
|
|
1570
|
+
class _t extends Ze {
|
|
1542
1571
|
constructor(e) {
|
|
1543
|
-
var { maxZoom: t, radius: s = 60 } = e, r =
|
|
1544
|
-
super({ maxZoom: t }), this.state = { zoom: -1 }, this.superCluster = new
|
|
1572
|
+
var { maxZoom: t, radius: s = 60 } = e, r = ge(e, ["maxZoom", "radius"]);
|
|
1573
|
+
super({ maxZoom: t }), this.state = { zoom: -1 }, this.superCluster = new qe(Object.assign({ maxZoom: this.maxZoom, radius: s }, r));
|
|
1545
1574
|
}
|
|
1546
1575
|
calculate(e) {
|
|
1547
1576
|
let t = !1;
|
|
@@ -1549,12 +1578,12 @@ class pt extends qe {
|
|
|
1549
1578
|
if (!A(e.markers, this.markers)) {
|
|
1550
1579
|
t = !0, this.markers = [...e.markers];
|
|
1551
1580
|
const r = this.markers.map((o) => {
|
|
1552
|
-
const
|
|
1581
|
+
const a = k.getPosition(o);
|
|
1553
1582
|
return {
|
|
1554
1583
|
type: "Feature",
|
|
1555
1584
|
geometry: {
|
|
1556
1585
|
type: "Point",
|
|
1557
|
-
coordinates: [
|
|
1586
|
+
coordinates: [a.lng(), a.lat()]
|
|
1558
1587
|
},
|
|
1559
1588
|
properties: { marker: o }
|
|
1560
1589
|
};
|
|
@@ -1568,37 +1597,37 @@ class pt extends qe {
|
|
|
1568
1597
|
}
|
|
1569
1598
|
transformCluster({ geometry: { coordinates: [e, t] }, properties: s }) {
|
|
1570
1599
|
if (s.cluster)
|
|
1571
|
-
return new
|
|
1600
|
+
return new J({
|
|
1572
1601
|
markers: this.superCluster.getLeaves(s.cluster_id, 1 / 0).map((o) => o.properties.marker),
|
|
1573
1602
|
position: { lat: t, lng: e }
|
|
1574
1603
|
});
|
|
1575
1604
|
const r = s.marker;
|
|
1576
|
-
return new
|
|
1605
|
+
return new J({
|
|
1577
1606
|
markers: [r],
|
|
1578
|
-
position:
|
|
1607
|
+
position: k.getPosition(r)
|
|
1579
1608
|
});
|
|
1580
1609
|
}
|
|
1581
1610
|
}
|
|
1582
|
-
class
|
|
1611
|
+
class wt extends vt {
|
|
1583
1612
|
constructor(e) {
|
|
1584
|
-
var { maxZoom: t, radius: s = 60, viewportPadding: r = 60 } = e, o =
|
|
1585
|
-
super({ maxZoom: t, viewportPadding: r }), this.superCluster = new
|
|
1613
|
+
var { maxZoom: t, radius: s = 60, viewportPadding: r = 60 } = e, o = ge(e, ["maxZoom", "radius", "viewportPadding"]);
|
|
1614
|
+
super({ maxZoom: t, viewportPadding: r }), this.superCluster = new qe(Object.assign({ maxZoom: this.maxZoom, radius: s }, o)), this.state = { zoom: -1, view: [0, 0, 0, 0] };
|
|
1586
1615
|
}
|
|
1587
1616
|
calculate(e) {
|
|
1588
1617
|
const t = {
|
|
1589
1618
|
zoom: Math.round(e.map.getZoom()),
|
|
1590
|
-
view:
|
|
1619
|
+
view: xe(e.map.getBounds(), e.mapCanvasProjection, this.viewportPadding)
|
|
1591
1620
|
};
|
|
1592
1621
|
let s = !A(this.state, t);
|
|
1593
1622
|
if (!A(e.markers, this.markers)) {
|
|
1594
1623
|
s = !0, this.markers = [...e.markers];
|
|
1595
1624
|
const r = this.markers.map((o) => {
|
|
1596
|
-
const
|
|
1625
|
+
const a = k.getPosition(o);
|
|
1597
1626
|
return {
|
|
1598
1627
|
type: "Feature",
|
|
1599
1628
|
geometry: {
|
|
1600
1629
|
type: "Point",
|
|
1601
|
-
coordinates: [
|
|
1630
|
+
coordinates: [a.lng(), a.lat()]
|
|
1602
1631
|
},
|
|
1603
1632
|
properties: { marker: o }
|
|
1604
1633
|
};
|
|
@@ -1610,27 +1639,27 @@ class ft extends dt {
|
|
|
1610
1639
|
cluster({ map: e, mapCanvasProjection: t }) {
|
|
1611
1640
|
const s = {
|
|
1612
1641
|
zoom: Math.round(e.getZoom()),
|
|
1613
|
-
view:
|
|
1642
|
+
view: xe(e.getBounds(), t, this.viewportPadding)
|
|
1614
1643
|
};
|
|
1615
1644
|
return this.superCluster.getClusters(s.view, s.zoom).map((r) => this.transformCluster(r));
|
|
1616
1645
|
}
|
|
1617
1646
|
transformCluster({ geometry: { coordinates: [e, t] }, properties: s }) {
|
|
1618
1647
|
if (s.cluster)
|
|
1619
|
-
return new
|
|
1648
|
+
return new J({
|
|
1620
1649
|
markers: this.superCluster.getLeaves(s.cluster_id, 1 / 0).map((o) => o.properties.marker),
|
|
1621
1650
|
position: { lat: t, lng: e }
|
|
1622
1651
|
});
|
|
1623
1652
|
const r = s.marker;
|
|
1624
|
-
return new
|
|
1653
|
+
return new J({
|
|
1625
1654
|
markers: [r],
|
|
1626
|
-
position:
|
|
1655
|
+
position: k.getPosition(r)
|
|
1627
1656
|
});
|
|
1628
1657
|
}
|
|
1629
1658
|
}
|
|
1630
|
-
class
|
|
1659
|
+
class kt {
|
|
1631
1660
|
constructor(e, t) {
|
|
1632
1661
|
this.markers = { sum: e.length };
|
|
1633
|
-
const s = t.map((o) => o.count), r = s.reduce((o,
|
|
1662
|
+
const s = t.map((o) => o.count), r = s.reduce((o, a) => o + a, 0);
|
|
1634
1663
|
this.clusters = {
|
|
1635
1664
|
count: t.length,
|
|
1636
1665
|
markers: {
|
|
@@ -1642,7 +1671,7 @@ class mt {
|
|
|
1642
1671
|
};
|
|
1643
1672
|
}
|
|
1644
1673
|
}
|
|
1645
|
-
class
|
|
1674
|
+
class Ct {
|
|
1646
1675
|
/**
|
|
1647
1676
|
* The default render function for the library used by {@link MarkerClusterer}.
|
|
1648
1677
|
*
|
|
@@ -1682,57 +1711,57 @@ class gt {
|
|
|
1682
1711
|
* ```
|
|
1683
1712
|
*/
|
|
1684
1713
|
render({ count: e, position: t }, s, r) {
|
|
1685
|
-
const
|
|
1714
|
+
const a = `<svg fill="${e > Math.max(10, s.clusters.markers.mean) ? "#ff0000" : "#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">
|
|
1686
1715
|
<circle cx="120" cy="120" opacity=".6" r="70" />
|
|
1687
1716
|
<circle cx="120" cy="120" opacity=".3" r="90" />
|
|
1688
1717
|
<circle cx="120" cy="120" opacity=".2" r="110" />
|
|
1689
1718
|
<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>
|
|
1690
|
-
</svg>`,
|
|
1691
|
-
if (
|
|
1719
|
+
</svg>`, l = `Cluster of ${e} markers`, i = Number(google.maps.Marker.MAX_ZINDEX) + e;
|
|
1720
|
+
if (k.isAdvancedMarkerAvailable(r)) {
|
|
1692
1721
|
const u = document.createElement("div");
|
|
1693
|
-
u.innerHTML =
|
|
1694
|
-
const
|
|
1695
|
-
|
|
1722
|
+
u.innerHTML = a;
|
|
1723
|
+
const c = u.firstElementChild;
|
|
1724
|
+
c.setAttribute("transform", "translate(0 25)");
|
|
1696
1725
|
const h = {
|
|
1697
1726
|
map: r,
|
|
1698
1727
|
position: t,
|
|
1699
|
-
zIndex:
|
|
1700
|
-
title:
|
|
1701
|
-
content:
|
|
1728
|
+
zIndex: i,
|
|
1729
|
+
title: l,
|
|
1730
|
+
content: c
|
|
1702
1731
|
};
|
|
1703
1732
|
return new google.maps.marker.AdvancedMarkerElement(h);
|
|
1704
1733
|
}
|
|
1705
1734
|
const d = {
|
|
1706
1735
|
position: t,
|
|
1707
|
-
zIndex:
|
|
1708
|
-
title:
|
|
1736
|
+
zIndex: i,
|
|
1737
|
+
title: l,
|
|
1709
1738
|
icon: {
|
|
1710
|
-
url: `data:image/svg+xml;base64,${btoa(
|
|
1739
|
+
url: `data:image/svg+xml;base64,${btoa(a)}`,
|
|
1711
1740
|
anchor: new google.maps.Point(25, 25)
|
|
1712
1741
|
}
|
|
1713
1742
|
};
|
|
1714
1743
|
return new google.maps.Marker(d);
|
|
1715
1744
|
}
|
|
1716
1745
|
}
|
|
1717
|
-
function
|
|
1746
|
+
function bt(n, e) {
|
|
1718
1747
|
for (let t in e.prototype)
|
|
1719
1748
|
n.prototype[t] = e.prototype[t];
|
|
1720
1749
|
}
|
|
1721
|
-
class
|
|
1750
|
+
class ve {
|
|
1722
1751
|
constructor() {
|
|
1723
|
-
|
|
1752
|
+
bt(ve, google.maps.OverlayView);
|
|
1724
1753
|
}
|
|
1725
1754
|
}
|
|
1726
|
-
var
|
|
1755
|
+
var F;
|
|
1727
1756
|
(function(n) {
|
|
1728
1757
|
n.CLUSTERING_BEGIN = "clusteringbegin", n.CLUSTERING_END = "clusteringend", n.CLUSTER_CLICK = "click";
|
|
1729
|
-
})(
|
|
1730
|
-
const
|
|
1758
|
+
})(F || (F = {}));
|
|
1759
|
+
const Mt = (n, e, t) => {
|
|
1731
1760
|
t.fitBounds(e.bounds);
|
|
1732
1761
|
};
|
|
1733
|
-
class
|
|
1734
|
-
constructor({ map: e, markers: t = [], algorithmOptions: s = {}, algorithm: r = new
|
|
1735
|
-
super(), this.markers = [...t], this.clusters = [], this.algorithm = r, this.renderer = o, this.onClusterClick =
|
|
1762
|
+
class Ot extends ve {
|
|
1763
|
+
constructor({ map: e, markers: t = [], algorithmOptions: s = {}, algorithm: r = new _t(s), renderer: o = new Ct(), onClusterClick: a = Mt }) {
|
|
1764
|
+
super(), this.markers = [...t], this.clusters = [], this.algorithm = r, this.renderer = o, this.onClusterClick = a, e && this.setMap(e);
|
|
1736
1765
|
}
|
|
1737
1766
|
addMarker(e, t) {
|
|
1738
1767
|
this.markers.includes(e) || (this.markers.push(e), t || this.render());
|
|
@@ -1744,7 +1773,7 @@ class wt extends he {
|
|
|
1744
1773
|
}
|
|
1745
1774
|
removeMarker(e, t) {
|
|
1746
1775
|
const s = this.markers.indexOf(e);
|
|
1747
|
-
return s === -1 ? !1 : (
|
|
1776
|
+
return s === -1 ? !1 : (k.setMap(e, null), this.markers.splice(s, 1), t || this.render(), !0);
|
|
1748
1777
|
}
|
|
1749
1778
|
removeMarkers(e, t) {
|
|
1750
1779
|
let s = !1;
|
|
@@ -1761,7 +1790,7 @@ class wt extends he {
|
|
|
1761
1790
|
render() {
|
|
1762
1791
|
const e = this.getMap();
|
|
1763
1792
|
if (e instanceof google.maps.Map && e.getProjection()) {
|
|
1764
|
-
google.maps.event.trigger(this,
|
|
1793
|
+
google.maps.event.trigger(this, F.CLUSTERING_BEGIN, this);
|
|
1765
1794
|
const { clusters: t, changed: s } = this.algorithm.calculate({
|
|
1766
1795
|
markers: this.markers,
|
|
1767
1796
|
map: e,
|
|
@@ -1769,14 +1798,14 @@ class wt extends he {
|
|
|
1769
1798
|
});
|
|
1770
1799
|
if (s || s == null) {
|
|
1771
1800
|
const r = /* @__PURE__ */ new Set();
|
|
1772
|
-
for (const
|
|
1773
|
-
|
|
1801
|
+
for (const a of t)
|
|
1802
|
+
a.markers.length == 1 && r.add(a.markers[0]);
|
|
1774
1803
|
const o = [];
|
|
1775
|
-
for (const
|
|
1776
|
-
|
|
1777
|
-
this.clusters = t, this.renderClusters(), requestAnimationFrame(() => o.forEach((
|
|
1804
|
+
for (const a of this.clusters)
|
|
1805
|
+
a.marker != null && (a.markers.length == 1 ? r.has(a.marker) || k.setMap(a.marker, null) : o.push(a.marker));
|
|
1806
|
+
this.clusters = t, this.renderClusters(), requestAnimationFrame(() => o.forEach((a) => k.setMap(a, null)));
|
|
1778
1807
|
}
|
|
1779
|
-
google.maps.event.trigger(this,
|
|
1808
|
+
google.maps.event.trigger(this, F.CLUSTERING_END, this);
|
|
1780
1809
|
}
|
|
1781
1810
|
}
|
|
1782
1811
|
onAdd() {
|
|
@@ -1786,22 +1815,22 @@ class wt extends he {
|
|
|
1786
1815
|
google.maps.event.removeListener(this.idleListener), this.reset();
|
|
1787
1816
|
}
|
|
1788
1817
|
reset() {
|
|
1789
|
-
this.markers.forEach((e) =>
|
|
1818
|
+
this.markers.forEach((e) => k.setMap(e, null)), this.clusters.forEach((e) => e.delete()), this.clusters = [];
|
|
1790
1819
|
}
|
|
1791
1820
|
renderClusters() {
|
|
1792
|
-
const e = new
|
|
1821
|
+
const e = new kt(this.markers, this.clusters), t = this.getMap();
|
|
1793
1822
|
this.clusters.forEach((s) => {
|
|
1794
|
-
s.markers.length === 1 ? s.marker = s.markers[0] : (s.marker = this.renderer.render(s, e, t), s.markers.forEach((r) =>
|
|
1823
|
+
s.markers.length === 1 ? s.marker = s.markers[0] : (s.marker = this.renderer.render(s, e, t), s.markers.forEach((r) => k.setMap(r, null)), this.onClusterClick && s.marker.addListener(
|
|
1795
1824
|
"click",
|
|
1796
1825
|
/* istanbul ignore next */
|
|
1797
1826
|
(r) => {
|
|
1798
|
-
google.maps.event.trigger(this,
|
|
1827
|
+
google.maps.event.trigger(this, F.CLUSTER_CLICK, s), this.onClusterClick(r, s, t);
|
|
1799
1828
|
}
|
|
1800
|
-
)),
|
|
1829
|
+
)), k.setMap(s.marker, t);
|
|
1801
1830
|
});
|
|
1802
1831
|
}
|
|
1803
1832
|
}
|
|
1804
|
-
const
|
|
1833
|
+
const Ae = Object.values(F), Dt = P({
|
|
1805
1834
|
name: "MarkerCluster",
|
|
1806
1835
|
props: {
|
|
1807
1836
|
options: {
|
|
@@ -1809,37 +1838,37 @@ const Ee = Object.values(D), Rt = P({
|
|
|
1809
1838
|
default: () => ({})
|
|
1810
1839
|
}
|
|
1811
1840
|
},
|
|
1812
|
-
emits:
|
|
1841
|
+
emits: Ae,
|
|
1813
1842
|
setup(n, { emit: e, expose: t, slots: s }) {
|
|
1814
|
-
const r =
|
|
1815
|
-
return
|
|
1843
|
+
const r = v(), o = C(B, v()), a = C(Z, v());
|
|
1844
|
+
return D(fe, r), S(
|
|
1816
1845
|
o,
|
|
1817
1846
|
() => {
|
|
1818
1847
|
o.value && (r.value = x(
|
|
1819
|
-
new
|
|
1848
|
+
new Ot({
|
|
1820
1849
|
map: o.value,
|
|
1821
1850
|
// Better perf than the default `SuperClusterAlgorithm`. See:
|
|
1822
1851
|
// https://github.com/googlemaps/js-markerclusterer/pull/640
|
|
1823
|
-
algorithm: new
|
|
1852
|
+
algorithm: new wt(n.options.algorithmOptions ?? {}),
|
|
1824
1853
|
...n.options
|
|
1825
1854
|
})
|
|
1826
|
-
),
|
|
1827
|
-
var
|
|
1828
|
-
(
|
|
1855
|
+
), Ae.forEach((l) => {
|
|
1856
|
+
var i;
|
|
1857
|
+
(i = r.value) == null || i.addListener(l, (d) => e(l, d));
|
|
1829
1858
|
}));
|
|
1830
1859
|
},
|
|
1831
1860
|
{
|
|
1832
1861
|
immediate: !0
|
|
1833
1862
|
}
|
|
1834
|
-
),
|
|
1835
|
-
var
|
|
1836
|
-
r.value && ((
|
|
1863
|
+
), j(() => {
|
|
1864
|
+
var l;
|
|
1865
|
+
r.value && ((l = a.value) == null || l.event.clearInstanceListeners(r.value), r.value.clearMarkers(), r.value.setMap(null));
|
|
1837
1866
|
}), t({ markerCluster: r }), () => {
|
|
1838
|
-
var
|
|
1839
|
-
return (
|
|
1867
|
+
var l;
|
|
1868
|
+
return (l = s.default) == null ? void 0 : l.call(s);
|
|
1840
1869
|
};
|
|
1841
1870
|
}
|
|
1842
|
-
}),
|
|
1871
|
+
}), Et = P({
|
|
1843
1872
|
inheritAttrs: !1,
|
|
1844
1873
|
props: {
|
|
1845
1874
|
options: {
|
|
@@ -1848,33 +1877,33 @@ const Ee = Object.values(D), Rt = P({
|
|
|
1848
1877
|
}
|
|
1849
1878
|
},
|
|
1850
1879
|
setup(n, { slots: e, emit: t, expose: s }) {
|
|
1851
|
-
const r =
|
|
1852
|
-
var
|
|
1853
|
-
return (
|
|
1854
|
-
}),
|
|
1880
|
+
const r = v(), o = G(() => {
|
|
1881
|
+
var i;
|
|
1882
|
+
return (i = e.default) == null ? void 0 : i.call(e).some((d) => d.type !== ue);
|
|
1883
|
+
}), a = G(() => ({
|
|
1855
1884
|
...n.options,
|
|
1856
1885
|
element: r.value
|
|
1857
|
-
})),
|
|
1886
|
+
})), l = W(re, [], a, t);
|
|
1858
1887
|
return s({
|
|
1859
|
-
customMarker:
|
|
1860
|
-
}), { customMarkerRef: r, customMarker:
|
|
1888
|
+
customMarker: l
|
|
1889
|
+
}), { customMarkerRef: r, customMarker: l, hasSlotContent: o };
|
|
1861
1890
|
}
|
|
1862
1891
|
});
|
|
1863
|
-
const
|
|
1892
|
+
const Pt = {
|
|
1864
1893
|
key: 0,
|
|
1865
1894
|
class: "custom-marker-wrapper"
|
|
1866
1895
|
};
|
|
1867
|
-
function
|
|
1868
|
-
return n.hasSlotContent ? (
|
|
1869
|
-
|
|
1896
|
+
function St(n, e, t, s, r, o) {
|
|
1897
|
+
return n.hasSlotContent ? (U(), V("div", Pt, [
|
|
1898
|
+
se("div", de({
|
|
1870
1899
|
ref: "customMarkerRef",
|
|
1871
1900
|
style: { cursor: n.$attrs.onClick ? "pointer" : void 0 }
|
|
1872
1901
|
}, n.$attrs), [
|
|
1873
|
-
|
|
1902
|
+
z(n.$slots, "default", {}, void 0, !0)
|
|
1874
1903
|
], 16)
|
|
1875
|
-
])) :
|
|
1904
|
+
])) : he("", !0);
|
|
1876
1905
|
}
|
|
1877
|
-
const
|
|
1906
|
+
const Ft = /* @__PURE__ */ X(Et, [["render", St], ["__scopeId", "data-v-2d2d343a"]]), Ut = P({
|
|
1878
1907
|
name: "HeatmapLayer",
|
|
1879
1908
|
props: {
|
|
1880
1909
|
options: {
|
|
@@ -1883,44 +1912,47 @@ const jt = /* @__PURE__ */ te(_t, [["render", Ct], ["__scopeId", "data-v-2d2d343
|
|
|
1883
1912
|
}
|
|
1884
1913
|
},
|
|
1885
1914
|
setup(n) {
|
|
1886
|
-
const e =
|
|
1887
|
-
return
|
|
1915
|
+
const e = v(), t = C(B, v()), s = C(Z, v());
|
|
1916
|
+
return S(
|
|
1888
1917
|
[t, () => n.options],
|
|
1889
|
-
([r, o], [
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1918
|
+
([r, o], [a, l]) => {
|
|
1919
|
+
const i = !A(o, l) || t.value !== a;
|
|
1920
|
+
if (t.value && s.value && i) {
|
|
1921
|
+
let d;
|
|
1922
|
+
if (o.data && !(o.data instanceof s.value.MVCArray)) {
|
|
1923
|
+
const u = s.value.LatLng, c = o.data.map((h) => h instanceof u || "location" in h && (h.location instanceof u || h.location === null) ? h : "location" in h ? { ...h, location: new u(h.location) } : new u(h));
|
|
1924
|
+
d = {
|
|
1925
|
+
...o,
|
|
1926
|
+
data: c
|
|
1927
|
+
};
|
|
1928
|
+
} else
|
|
1929
|
+
d = o;
|
|
1930
|
+
e.value ? e.value.setOptions(d) : e.value = x(
|
|
1899
1931
|
new s.value.visualization.HeatmapLayer({
|
|
1900
|
-
...
|
|
1932
|
+
...d,
|
|
1901
1933
|
map: t.value
|
|
1902
1934
|
})
|
|
1903
1935
|
);
|
|
1904
1936
|
}
|
|
1905
1937
|
},
|
|
1906
1938
|
{ immediate: !0 }
|
|
1907
|
-
),
|
|
1939
|
+
), j(() => {
|
|
1908
1940
|
e.value && e.value.setMap(null);
|
|
1909
1941
|
}), { heatmapLayer: e };
|
|
1910
1942
|
},
|
|
1911
1943
|
render: () => null
|
|
1912
1944
|
});
|
|
1913
1945
|
export {
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1946
|
+
Tt as AdvancedMarker,
|
|
1947
|
+
Bt as Circle,
|
|
1948
|
+
Zt as CustomControl,
|
|
1949
|
+
Ft as CustomMarker,
|
|
1950
|
+
It as GoogleMap,
|
|
1951
|
+
Ut as HeatmapLayer,
|
|
1952
|
+
Nt as InfoWindow,
|
|
1953
|
+
$t as Marker,
|
|
1954
|
+
Dt as MarkerCluster,
|
|
1955
|
+
qt as Polygon,
|
|
1956
|
+
Rt as Polyline,
|
|
1957
|
+
jt as Rectangle
|
|
1926
1958
|
};
|