vue3-google-map 0.21.1 → 0.22.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 +9 -2
- package/dist/index.cjs +5 -5
- package/dist/index.mjs +506 -480
- 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/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 Ue = (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) => (Ue(n, typeof e != "symbol" ? e + "" : e, t), t);
|
|
5
|
+
import { defineComponent as P, ref as v, provide as U, watch as S, onMounted as Ie, onBeforeUnmount as j, markRaw as x, toRef as $, openBlock as K, createElementBlock as Y, createElementVNode as se, renderSlot as J, normalizeProps as De, guardReactiveProps as Fe, computed as F, Comment as ue, inject as C, 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"), V = [
|
|
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 Ve(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 ze = 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 (!ze(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) => Ve(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 Ge(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
|
+
], He = 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
|
-
U(B, r), U(Z, o), U(
|
|
560
|
-
const
|
|
561
|
-
const
|
|
562
|
-
Object.keys(
|
|
563
|
-
|
|
571
|
+
const t = v(), s = v(!1), r = v(), o = v(), a = v(!1);
|
|
572
|
+
U(B, r), U(Z, o), U(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 = Ge(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
|
+
}, We = {
|
|
629
643
|
ref: "mapRef",
|
|
630
644
|
class: "mapdiv"
|
|
631
645
|
};
|
|
632
|
-
function
|
|
633
|
-
return
|
|
634
|
-
|
|
635
|
-
|
|
646
|
+
function Ke(n, e, t, s, r, o) {
|
|
647
|
+
return K(), Y("div", null, [
|
|
648
|
+
se("div", We, null, 512),
|
|
649
|
+
J(n.$slots, "default", De(Fe({ 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 At = /* @__PURE__ */ X(He, [["render", Ke], ["__scopeId", "data-v-e7ebb206"]]);
|
|
653
|
+
function Ye(n) {
|
|
640
654
|
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
641
655
|
}
|
|
642
|
-
var
|
|
656
|
+
var Je = 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__ */ Ye(Je), ke = ["click", "drag", "dragend", "dragstart", "gmp-click"], Xe = P({
|
|
678
692
|
name: "AdvancedMarker",
|
|
679
693
|
props: {
|
|
680
694
|
options: {
|
|
@@ -686,73 +700,85 @@ 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 = F(() => {
|
|
706
|
+
var p;
|
|
707
|
+
return (p = s.default) == 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 = F(
|
|
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
|
-
}), U(
|
|
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
|
+
}), U(pe, i), t({ marker: i }), { hasSlotContent: o, markerRef: r };
|
|
724
738
|
}
|
|
725
|
-
})
|
|
726
|
-
|
|
727
|
-
|
|
739
|
+
});
|
|
740
|
+
const Qe = {
|
|
741
|
+
key: 0,
|
|
742
|
+
class: "advanced-marker-wrapper"
|
|
743
|
+
};
|
|
744
|
+
function et(n, e, t, s, r, o) {
|
|
745
|
+
return n.hasSlotContent ? (K(), Y("div", Qe, [
|
|
746
|
+
se("div", de({ ref: "markerRef" }, n.$attrs), [
|
|
747
|
+
J(n.$slots, "default")
|
|
748
|
+
], 16)
|
|
749
|
+
])) : he("", !0);
|
|
750
|
+
}
|
|
751
|
+
const It = /* @__PURE__ */ X(Xe, [["render", et]]), tt = (n) => n === "Marker", st = (n) => n === re, z = (n, e, t, s) => {
|
|
752
|
+
const r = v(), o = C(B, v()), a = C(Z, v()), l = C(fe, v()), i = F(
|
|
753
|
+
() => !!(l.value && a.value && (r.value instanceof a.value.Marker || r.value instanceof a.value[re]))
|
|
728
754
|
);
|
|
729
|
-
return
|
|
755
|
+
return S(
|
|
730
756
|
[o, t],
|
|
731
|
-
(d, [u,
|
|
732
|
-
var p,
|
|
733
|
-
const h = !A(t.value,
|
|
734
|
-
!o.value || !
|
|
735
|
-
new
|
|
736
|
-
) :
|
|
737
|
-
new
|
|
757
|
+
(d, [u, c]) => {
|
|
758
|
+
var p, f, m;
|
|
759
|
+
const h = !A(t.value, c) || o.value !== u;
|
|
760
|
+
!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))) : (tt(n) ? r.value = x(
|
|
761
|
+
new a.value[n](t.value)
|
|
762
|
+
) : st(n) ? r.value = x(
|
|
763
|
+
new a.value[n](t.value)
|
|
738
764
|
) : r.value = x(
|
|
739
|
-
new
|
|
765
|
+
new a.value[n]({
|
|
740
766
|
...t.value,
|
|
741
767
|
map: o.value
|
|
742
768
|
})
|
|
743
|
-
),
|
|
744
|
-
var
|
|
745
|
-
(
|
|
769
|
+
), i.value ? (m = l.value) == null || m.addMarker(r.value) : r.value.setMap(o.value), e.forEach((g) => {
|
|
770
|
+
var y;
|
|
771
|
+
(y = r.value) == null || y.addListener(g, (_) => s(g, _));
|
|
746
772
|
})));
|
|
747
773
|
},
|
|
748
774
|
{
|
|
749
775
|
immediate: !0
|
|
750
776
|
}
|
|
751
|
-
),
|
|
777
|
+
), j(() => {
|
|
752
778
|
var d, u;
|
|
753
|
-
r.value && ((d =
|
|
779
|
+
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
780
|
}), r;
|
|
755
|
-
},
|
|
781
|
+
}, Ce = [
|
|
756
782
|
"animation_changed",
|
|
757
783
|
"click",
|
|
758
784
|
"dblclick",
|
|
@@ -776,7 +802,7 @@ const A = /* @__PURE__ */ We(Ke), ge = ["click", "drag", "dragend", "dragstart",
|
|
|
776
802
|
"shape_changed",
|
|
777
803
|
"title_changed",
|
|
778
804
|
"visible_changed"
|
|
779
|
-
],
|
|
805
|
+
], Tt = P({
|
|
780
806
|
name: "Marker",
|
|
781
807
|
props: {
|
|
782
808
|
options: {
|
|
@@ -784,15 +810,15 @@ const A = /* @__PURE__ */ We(Ke), ge = ["click", "drag", "dragend", "dragstart",
|
|
|
784
810
|
required: !0
|
|
785
811
|
}
|
|
786
812
|
},
|
|
787
|
-
emits:
|
|
813
|
+
emits: Ce,
|
|
788
814
|
setup(n, { emit: e, expose: t, slots: s }) {
|
|
789
|
-
const r = $(n, "options"), o =
|
|
790
|
-
return U(
|
|
791
|
-
var
|
|
792
|
-
return (
|
|
815
|
+
const r = $(n, "options"), o = z("Marker", Ce, r, e);
|
|
816
|
+
return U(pe, o), t({ marker: o }), () => {
|
|
817
|
+
var a;
|
|
818
|
+
return (a = s.default) == null ? void 0 : a.call(s);
|
|
793
819
|
};
|
|
794
820
|
}
|
|
795
|
-
}),
|
|
821
|
+
}), $t = P({
|
|
796
822
|
name: "Polyline",
|
|
797
823
|
props: {
|
|
798
824
|
options: {
|
|
@@ -800,13 +826,13 @@ const A = /* @__PURE__ */ We(Ke), ge = ["click", "drag", "dragend", "dragstart",
|
|
|
800
826
|
required: !0
|
|
801
827
|
}
|
|
802
828
|
},
|
|
803
|
-
emits:
|
|
829
|
+
emits: V,
|
|
804
830
|
setup(n, { emit: e }) {
|
|
805
831
|
const t = $(n, "options");
|
|
806
|
-
return { polyline:
|
|
832
|
+
return { polyline: z("Polyline", V, t, e) };
|
|
807
833
|
},
|
|
808
834
|
render: () => null
|
|
809
|
-
}),
|
|
835
|
+
}), Rt = P({
|
|
810
836
|
name: "Polygon",
|
|
811
837
|
props: {
|
|
812
838
|
options: {
|
|
@@ -814,13 +840,13 @@ const A = /* @__PURE__ */ We(Ke), ge = ["click", "drag", "dragend", "dragstart",
|
|
|
814
840
|
required: !0
|
|
815
841
|
}
|
|
816
842
|
},
|
|
817
|
-
emits:
|
|
843
|
+
emits: V,
|
|
818
844
|
setup(n, { emit: e }) {
|
|
819
845
|
const t = $(n, "options");
|
|
820
|
-
return { polygon:
|
|
846
|
+
return { polygon: z("Polygon", V, t, e) };
|
|
821
847
|
},
|
|
822
848
|
render: () => null
|
|
823
|
-
}),
|
|
849
|
+
}), be = V.concat(["bounds_changed"]), qt = P({
|
|
824
850
|
name: "Rectangle",
|
|
825
851
|
props: {
|
|
826
852
|
options: {
|
|
@@ -828,13 +854,13 @@ const A = /* @__PURE__ */ We(Ke), ge = ["click", "drag", "dragend", "dragstart",
|
|
|
828
854
|
required: !0
|
|
829
855
|
}
|
|
830
856
|
},
|
|
831
|
-
emits:
|
|
857
|
+
emits: be,
|
|
832
858
|
setup(n, { emit: e }) {
|
|
833
859
|
const t = $(n, "options");
|
|
834
|
-
return { rectangle:
|
|
860
|
+
return { rectangle: z("Rectangle", be, t, e) };
|
|
835
861
|
},
|
|
836
862
|
render: () => null
|
|
837
|
-
}),
|
|
863
|
+
}), Me = V.concat(["center_changed", "radius_changed"]), jt = P({
|
|
838
864
|
name: "Circle",
|
|
839
865
|
props: {
|
|
840
866
|
options: {
|
|
@@ -842,13 +868,13 @@ const A = /* @__PURE__ */ We(Ke), ge = ["click", "drag", "dragend", "dragstart",
|
|
|
842
868
|
required: !0
|
|
843
869
|
}
|
|
844
870
|
},
|
|
845
|
-
emits:
|
|
871
|
+
emits: Me,
|
|
846
872
|
setup(n, { emit: e }) {
|
|
847
873
|
const t = $(n, "options");
|
|
848
|
-
return { circle:
|
|
874
|
+
return { circle: z("Circle", Me, t, e) };
|
|
849
875
|
},
|
|
850
876
|
render: () => null
|
|
851
|
-
}),
|
|
877
|
+
}), rt = P({
|
|
852
878
|
props: {
|
|
853
879
|
position: {
|
|
854
880
|
type: String,
|
|
@@ -861,32 +887,32 @@ const A = /* @__PURE__ */ We(Ke), ge = ["click", "drag", "dragend", "dragstart",
|
|
|
861
887
|
},
|
|
862
888
|
emits: ["content:loaded"],
|
|
863
889
|
setup(n, { emit: e }) {
|
|
864
|
-
const t =
|
|
890
|
+
const t = v(null), s = C(B, v()), r = C(Z, v()), o = C(Te, v(!1)), a = S(
|
|
865
891
|
[o, r, t],
|
|
866
|
-
([d, u,
|
|
867
|
-
u && d &&
|
|
892
|
+
([d, u, c]) => {
|
|
893
|
+
u && d && c && (l(n.position), e("content:loaded"), setTimeout(a, 0));
|
|
868
894
|
},
|
|
869
895
|
{ immediate: !0 }
|
|
870
|
-
),
|
|
896
|
+
), l = (d) => {
|
|
871
897
|
if (s.value && r.value && t.value) {
|
|
872
898
|
const u = r.value.ControlPosition[d];
|
|
873
899
|
s.value.controls[u].push(t.value);
|
|
874
900
|
}
|
|
875
|
-
},
|
|
901
|
+
}, i = (d) => {
|
|
876
902
|
if (s.value && r.value) {
|
|
877
903
|
let u = null;
|
|
878
|
-
const
|
|
879
|
-
s.value.controls[
|
|
904
|
+
const c = r.value.ControlPosition[d];
|
|
905
|
+
s.value.controls[c].forEach((h, p) => {
|
|
880
906
|
h === t.value && (u = p);
|
|
881
|
-
}), u !== null && s.value.controls[
|
|
907
|
+
}), u !== null && s.value.controls[c].removeAt(u);
|
|
882
908
|
}
|
|
883
909
|
};
|
|
884
|
-
return
|
|
910
|
+
return j(() => i(n.position)), S(
|
|
885
911
|
() => n.position,
|
|
886
912
|
(d, u) => {
|
|
887
|
-
|
|
913
|
+
i(u), l(d);
|
|
888
914
|
}
|
|
889
|
-
),
|
|
915
|
+
), S(
|
|
890
916
|
() => n.index,
|
|
891
917
|
(d) => {
|
|
892
918
|
d && t.value && (t.value.index = n.index);
|
|
@@ -894,16 +920,16 @@ const A = /* @__PURE__ */ We(Ke), ge = ["click", "drag", "dragend", "dragstart",
|
|
|
894
920
|
), { controlRef: t };
|
|
895
921
|
}
|
|
896
922
|
});
|
|
897
|
-
const
|
|
923
|
+
const nt = {
|
|
898
924
|
ref: "controlRef",
|
|
899
925
|
class: "custom-control-wrapper"
|
|
900
926
|
};
|
|
901
|
-
function
|
|
902
|
-
return
|
|
903
|
-
|
|
927
|
+
function ot(n, e, t, s, r, o) {
|
|
928
|
+
return K(), Y("div", nt, [
|
|
929
|
+
J(n.$slots, "default", {}, void 0, !0)
|
|
904
930
|
], 512);
|
|
905
931
|
}
|
|
906
|
-
const
|
|
932
|
+
const Bt = /* @__PURE__ */ X(rt, [["render", ot], ["__scopeId", "data-v-d099a3a6"]]), Oe = ["closeclick", "content_changed", "domready", "position_changed", "visible", "zindex_changed"], it = P({
|
|
907
933
|
inheritAttrs: !1,
|
|
908
934
|
props: {
|
|
909
935
|
options: {
|
|
@@ -914,68 +940,68 @@ const Tt = /* @__PURE__ */ te(Xe, [["render", et], ["__scopeId", "data-v-d099a3a
|
|
|
914
940
|
type: Boolean
|
|
915
941
|
}
|
|
916
942
|
},
|
|
917
|
-
emits: [...
|
|
943
|
+
emits: [...Oe, "update:modelValue"],
|
|
918
944
|
setup(n, { slots: e, emit: t, expose: s }) {
|
|
919
|
-
const r =
|
|
945
|
+
const r = v(), o = v(), a = C(B, v()), l = C(Z, v()), i = C(pe, v());
|
|
920
946
|
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
|
-
},
|
|
947
|
+
const c = F(() => {
|
|
948
|
+
var m;
|
|
949
|
+
return (m = e.default) == null ? void 0 : m.call(e).some((g) => g.type !== ue);
|
|
950
|
+
}), h = (m) => {
|
|
951
|
+
u = m, t("update:modelValue", m);
|
|
952
|
+
}, p = (m) => {
|
|
953
|
+
r.value && (r.value.open({ map: a.value, anchor: i.value, ...m }), h(!0));
|
|
954
|
+
}, f = () => {
|
|
929
955
|
r.value && (r.value.close(), h(!1));
|
|
930
956
|
};
|
|
931
|
-
return
|
|
932
|
-
|
|
933
|
-
[
|
|
934
|
-
([
|
|
957
|
+
return Ie(() => {
|
|
958
|
+
S(
|
|
959
|
+
[a, () => n.options],
|
|
960
|
+
([m, g], [y, _]) => {
|
|
935
961
|
var O;
|
|
936
|
-
const
|
|
937
|
-
|
|
962
|
+
const w = !A(g, _) || a.value !== y;
|
|
963
|
+
a.value && l.value && w && (r.value ? (r.value.setOptions({
|
|
938
964
|
...g,
|
|
939
|
-
content:
|
|
940
|
-
}),
|
|
941
|
-
new
|
|
965
|
+
content: c.value ? o.value : g.content
|
|
966
|
+
}), i.value || p()) : (r.value = x(
|
|
967
|
+
new l.value.InfoWindow({
|
|
942
968
|
...g,
|
|
943
|
-
content:
|
|
969
|
+
content: c.value ? o.value : g.content
|
|
944
970
|
})
|
|
945
|
-
),
|
|
971
|
+
), i.value && (d = i.value.addListener("click", () => {
|
|
946
972
|
p();
|
|
947
|
-
})), (!
|
|
973
|
+
})), (!i.value || u) && p(), Oe.forEach((b) => {
|
|
948
974
|
var E;
|
|
949
|
-
(E = r.value) == null || E.addListener(
|
|
975
|
+
(E = r.value) == null || E.addListener(b, (M) => t(b, M));
|
|
950
976
|
}), (O = r.value) == null || O.addListener("closeclick", () => h(!1))));
|
|
951
977
|
},
|
|
952
978
|
{
|
|
953
979
|
immediate: !0
|
|
954
980
|
}
|
|
955
|
-
),
|
|
981
|
+
), S(
|
|
956
982
|
() => n.modelValue,
|
|
957
|
-
(
|
|
958
|
-
|
|
983
|
+
(m) => {
|
|
984
|
+
m !== u && (m ? p() : f());
|
|
959
985
|
}
|
|
960
986
|
);
|
|
961
|
-
}),
|
|
962
|
-
var
|
|
963
|
-
d && d.remove(), r.value && ((
|
|
964
|
-
}), s({ infoWindow: r, open: p, close:
|
|
987
|
+
}), j(() => {
|
|
988
|
+
var m;
|
|
989
|
+
d && d.remove(), r.value && ((m = l.value) == null || m.event.clearInstanceListeners(r.value), f());
|
|
990
|
+
}), s({ infoWindow: r, open: p, close: f }), { infoWindow: r, infoWindowRef: o, hasSlotContent: c, open: p, close: f };
|
|
965
991
|
}
|
|
966
992
|
});
|
|
967
|
-
const
|
|
993
|
+
const at = {
|
|
968
994
|
key: 0,
|
|
969
995
|
class: "info-window-wrapper"
|
|
970
996
|
};
|
|
971
|
-
function
|
|
972
|
-
return n.hasSlotContent ? (
|
|
973
|
-
|
|
974
|
-
|
|
997
|
+
function lt(n, e, t, s, r, o) {
|
|
998
|
+
return n.hasSlotContent ? (K(), Y("div", at, [
|
|
999
|
+
se("div", de({ ref: "infoWindowRef" }, n.$attrs), [
|
|
1000
|
+
J(n.$slots, "default", {}, void 0, !0)
|
|
975
1001
|
], 16)
|
|
976
|
-
])) :
|
|
1002
|
+
])) : he("", !0);
|
|
977
1003
|
}
|
|
978
|
-
const
|
|
1004
|
+
const Zt = /* @__PURE__ */ X(it, [["render", lt], ["__scopeId", "data-v-cbe1707b"]]), Ee = [
|
|
979
1005
|
Int8Array,
|
|
980
1006
|
Uint8Array,
|
|
981
1007
|
Uint8ClampedArray,
|
|
@@ -985,8 +1011,8 @@ const $t = /* @__PURE__ */ te(tt, [["render", rt], ["__scopeId", "data-v-cbe1707
|
|
|
985
1011
|
Uint32Array,
|
|
986
1012
|
Float32Array,
|
|
987
1013
|
Float64Array
|
|
988
|
-
],
|
|
989
|
-
class
|
|
1014
|
+
], ie = 1, G = 8;
|
|
1015
|
+
class me {
|
|
990
1016
|
/**
|
|
991
1017
|
* Creates an index from raw `ArrayBuffer` data.
|
|
992
1018
|
* @param {ArrayBuffer} data
|
|
@@ -998,13 +1024,13 @@ class ue {
|
|
|
998
1024
|
if (t !== 219)
|
|
999
1025
|
throw new Error("Data does not appear to be in a KDBush format.");
|
|
1000
1026
|
const r = s >> 4;
|
|
1001
|
-
if (r !==
|
|
1002
|
-
throw new Error(`Got v${r} data when expected v${
|
|
1003
|
-
const o =
|
|
1027
|
+
if (r !== ie)
|
|
1028
|
+
throw new Error(`Got v${r} data when expected v${ie}.`);
|
|
1029
|
+
const o = Ee[s & 15];
|
|
1004
1030
|
if (!o)
|
|
1005
1031
|
throw new Error("Unrecognized array type.");
|
|
1006
|
-
const [
|
|
1007
|
-
return new
|
|
1032
|
+
const [a] = new Uint16Array(e, 2, 1), [l] = new Uint32Array(e, 4, 1);
|
|
1033
|
+
return new me(l, a, o, e);
|
|
1008
1034
|
}
|
|
1009
1035
|
/**
|
|
1010
1036
|
* Creates an index that will hold a given number of items.
|
|
@@ -1017,10 +1043,10 @@ class ue {
|
|
|
1017
1043
|
if (isNaN(e) || e < 0)
|
|
1018
1044
|
throw new Error(`Unpexpected numItems value: ${e}.`);
|
|
1019
1045
|
this.numItems = +e, this.nodeSize = Math.min(Math.max(+t, 2), 65535), this.ArrayType = s, this.IndexArrayType = e < 65536 ? Uint16Array : Uint32Array;
|
|
1020
|
-
const o =
|
|
1046
|
+
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
1047
|
if (o < 0)
|
|
1022
1048
|
throw new Error(`Unexpected typed array class: ${s}.`);
|
|
1023
|
-
r && r instanceof ArrayBuffer ? (this.data = r, this.ids = new this.IndexArrayType(this.data,
|
|
1049
|
+
r && r instanceof ArrayBuffer ? (this.data = r, this.ids = new this.IndexArrayType(this.data, G, e), this.coords = new this.ArrayType(this.data, G + l + i, e * 2), this._pos = e * 2, this._finished = !0) : (this.data = new ArrayBuffer(G + a + l + i), this.ids = new this.IndexArrayType(this.data, G, e), this.coords = new this.ArrayType(this.data, G + 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
1050
|
}
|
|
1025
1051
|
/**
|
|
1026
1052
|
* Add a point to the index.
|
|
@@ -1039,7 +1065,7 @@ class ue {
|
|
|
1039
1065
|
const e = this._pos >> 1;
|
|
1040
1066
|
if (e !== this.numItems)
|
|
1041
1067
|
throw new Error(`Added ${e} items when expected ${this.numItems}.`);
|
|
1042
|
-
return
|
|
1068
|
+
return ce(this.ids, this.coords, this.nodeSize, 0, this.numItems - 1, 0), this._finished = !0, this;
|
|
1043
1069
|
}
|
|
1044
1070
|
/**
|
|
1045
1071
|
* Search the index for items within a given bounding box.
|
|
@@ -1052,18 +1078,18 @@ class ue {
|
|
|
1052
1078
|
range(e, t, s, r) {
|
|
1053
1079
|
if (!this._finished)
|
|
1054
1080
|
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
|
-
|
|
1081
|
+
const { ids: o, coords: a, nodeSize: l } = this, i = [0, o.length - 1, 0], d = [];
|
|
1082
|
+
for (; i.length; ) {
|
|
1083
|
+
const u = i.pop() || 0, c = i.pop() || 0, h = i.pop() || 0;
|
|
1084
|
+
if (c - h <= l) {
|
|
1085
|
+
for (let g = h; g <= c; g++) {
|
|
1086
|
+
const y = a[2 * g], _ = a[2 * g + 1];
|
|
1087
|
+
y >= e && y <= s && _ >= t && _ <= r && d.push(o[g]);
|
|
1062
1088
|
}
|
|
1063
1089
|
continue;
|
|
1064
1090
|
}
|
|
1065
|
-
const p = h +
|
|
1066
|
-
|
|
1091
|
+
const p = h + c >> 1, f = a[2 * p], m = a[2 * p + 1];
|
|
1092
|
+
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
1093
|
}
|
|
1068
1094
|
return d;
|
|
1069
1095
|
}
|
|
@@ -1077,55 +1103,55 @@ class ue {
|
|
|
1077
1103
|
within(e, t, s) {
|
|
1078
1104
|
if (!this._finished)
|
|
1079
1105
|
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
|
-
|
|
1106
|
+
const { ids: r, coords: o, nodeSize: a } = this, l = [0, r.length - 1, 0], i = [], d = s * s;
|
|
1107
|
+
for (; l.length; ) {
|
|
1108
|
+
const u = l.pop() || 0, c = l.pop() || 0, h = l.pop() || 0;
|
|
1109
|
+
if (c - h <= a) {
|
|
1110
|
+
for (let g = h; g <= c; g++)
|
|
1111
|
+
Pe(o[2 * g], o[2 * g + 1], e, t) <= d && i.push(r[g]);
|
|
1086
1112
|
continue;
|
|
1087
1113
|
}
|
|
1088
|
-
const p = h +
|
|
1089
|
-
|
|
1114
|
+
const p = h + c >> 1, f = o[2 * p], m = o[2 * p + 1];
|
|
1115
|
+
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
1116
|
}
|
|
1091
|
-
return
|
|
1117
|
+
return i;
|
|
1092
1118
|
}
|
|
1093
1119
|
}
|
|
1094
|
-
function
|
|
1120
|
+
function ce(n, e, t, s, r, o) {
|
|
1095
1121
|
if (r - s <= t)
|
|
1096
1122
|
return;
|
|
1097
|
-
const
|
|
1098
|
-
|
|
1123
|
+
const a = s + r >> 1;
|
|
1124
|
+
$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
1125
|
}
|
|
1100
|
-
function
|
|
1126
|
+
function $e(n, e, t, s, r, o) {
|
|
1101
1127
|
for (; r > s; ) {
|
|
1102
1128
|
if (r - s > 600) {
|
|
1103
|
-
const d = r - s + 1, u = t - s + 1,
|
|
1104
|
-
|
|
1129
|
+
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));
|
|
1130
|
+
$e(n, e, t, f, m, o);
|
|
1105
1131
|
}
|
|
1106
|
-
const
|
|
1107
|
-
let
|
|
1108
|
-
for (
|
|
1109
|
-
for (
|
|
1110
|
-
|
|
1111
|
-
for (; e[2 *
|
|
1112
|
-
|
|
1132
|
+
const a = e[2 * t + o];
|
|
1133
|
+
let l = s, i = r;
|
|
1134
|
+
for (H(n, e, s, t), e[2 * r + o] > a && H(n, e, s, r); l < i; ) {
|
|
1135
|
+
for (H(n, e, l, i), l++, i--; e[2 * l + o] < a; )
|
|
1136
|
+
l++;
|
|
1137
|
+
for (; e[2 * i + o] > a; )
|
|
1138
|
+
i--;
|
|
1113
1139
|
}
|
|
1114
|
-
e[2 * s + o] ===
|
|
1140
|
+
e[2 * s + o] === a ? H(n, e, s, i) : (i++, H(n, e, i, r)), i <= t && (s = i + 1), t <= i && (r = i - 1);
|
|
1115
1141
|
}
|
|
1116
1142
|
}
|
|
1117
|
-
function
|
|
1118
|
-
|
|
1143
|
+
function H(n, e, t, s) {
|
|
1144
|
+
ae(n, t, s), ae(e, 2 * t, 2 * s), ae(e, 2 * t + 1, 2 * s + 1);
|
|
1119
1145
|
}
|
|
1120
|
-
function
|
|
1146
|
+
function ae(n, e, t) {
|
|
1121
1147
|
const s = n[e];
|
|
1122
1148
|
n[e] = n[t], n[t] = s;
|
|
1123
1149
|
}
|
|
1124
|
-
function
|
|
1150
|
+
function Pe(n, e, t, s) {
|
|
1125
1151
|
const r = n - t, o = e - s;
|
|
1126
1152
|
return r * r + o * o;
|
|
1127
1153
|
}
|
|
1128
|
-
const
|
|
1154
|
+
const ct = {
|
|
1129
1155
|
minZoom: 0,
|
|
1130
1156
|
// min zoom to generate clusters on
|
|
1131
1157
|
maxZoom: 16,
|
|
@@ -1148,41 +1174,41 @@ const nt = {
|
|
|
1148
1174
|
// properties to use for individual points when running the reducer
|
|
1149
1175
|
map: (n) => n
|
|
1150
1176
|
// props => ({sum: props.my_value})
|
|
1151
|
-
},
|
|
1152
|
-
class
|
|
1177
|
+
}, Se = Math.fround || ((n) => (e) => (n[0] = +e, n[0]))(new Float32Array(1)), R = 2, T = 3, le = 4, I = 5, Re = 6;
|
|
1178
|
+
class qe {
|
|
1153
1179
|
constructor(e) {
|
|
1154
|
-
this.options = Object.assign(Object.create(
|
|
1180
|
+
this.options = Object.assign(Object.create(ct), e), this.trees = new Array(this.options.maxZoom + 1), this.stride = this.options.reduce ? 7 : 6, this.clusterProps = [];
|
|
1155
1181
|
}
|
|
1156
1182
|
load(e) {
|
|
1157
1183
|
const { log: t, minZoom: s, maxZoom: r } = this.options;
|
|
1158
1184
|
t && console.time("total time");
|
|
1159
1185
|
const o = `prepare ${e.length} points`;
|
|
1160
1186
|
t && console.time(o), this.points = e;
|
|
1161
|
-
const
|
|
1162
|
-
for (let
|
|
1163
|
-
const d = e[
|
|
1187
|
+
const a = [];
|
|
1188
|
+
for (let i = 0; i < e.length; i++) {
|
|
1189
|
+
const d = e[i];
|
|
1164
1190
|
if (!d.geometry)
|
|
1165
1191
|
continue;
|
|
1166
|
-
const [u,
|
|
1167
|
-
|
|
1192
|
+
const [u, c] = d.geometry.coordinates, h = Se(ee(u)), p = Se(te(c));
|
|
1193
|
+
a.push(
|
|
1168
1194
|
h,
|
|
1169
1195
|
p,
|
|
1170
1196
|
// projected point coordinates
|
|
1171
1197
|
1 / 0,
|
|
1172
1198
|
// the last zoom the point was processed at
|
|
1173
|
-
|
|
1199
|
+
i,
|
|
1174
1200
|
// index of the source feature in the original input array
|
|
1175
1201
|
-1,
|
|
1176
1202
|
// parent cluster id
|
|
1177
1203
|
1
|
|
1178
1204
|
// number of points in a cluster
|
|
1179
|
-
), this.options.reduce &&
|
|
1205
|
+
), this.options.reduce && a.push(0);
|
|
1180
1206
|
}
|
|
1181
|
-
let
|
|
1207
|
+
let l = this.trees[r + 1] = this._createTree(a);
|
|
1182
1208
|
t && console.timeEnd(o);
|
|
1183
|
-
for (let
|
|
1209
|
+
for (let i = r; i >= s; i--) {
|
|
1184
1210
|
const d = +Date.now();
|
|
1185
|
-
|
|
1211
|
+
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
1212
|
}
|
|
1187
1213
|
return t && console.timeEnd("total time"), this;
|
|
1188
1214
|
}
|
|
@@ -1190,17 +1216,17 @@ class $e {
|
|
|
1190
1216
|
let s = ((e[0] + 180) % 360 + 360) % 360 - 180;
|
|
1191
1217
|
const r = Math.max(-90, Math.min(90, e[1]));
|
|
1192
1218
|
let o = e[2] === 180 ? 180 : ((e[2] + 180) % 360 + 360) % 360 - 180;
|
|
1193
|
-
const
|
|
1219
|
+
const a = Math.max(-90, Math.min(90, e[3]));
|
|
1194
1220
|
if (e[2] - e[0] >= 360)
|
|
1195
1221
|
s = -180, o = 180;
|
|
1196
1222
|
else if (s > o) {
|
|
1197
|
-
const
|
|
1198
|
-
return
|
|
1223
|
+
const c = this.getClusters([s, r, 180, a], t), h = this.getClusters([-180, r, o, a], t);
|
|
1224
|
+
return c.concat(h);
|
|
1199
1225
|
}
|
|
1200
|
-
const
|
|
1201
|
-
for (const
|
|
1202
|
-
const h = this.stride *
|
|
1203
|
-
u.push(d[h + I] > 1 ?
|
|
1226
|
+
const l = this.trees[this._limitZoom(t)], i = l.range(ee(s), te(a), ee(o), te(r)), d = l.data, u = [];
|
|
1227
|
+
for (const c of i) {
|
|
1228
|
+
const h = this.stride * c;
|
|
1229
|
+
u.push(d[h + I] > 1 ? Le(d, h, this.clusterProps) : this.points[d[h + T]]);
|
|
1204
1230
|
}
|
|
1205
1231
|
return u;
|
|
1206
1232
|
}
|
|
@@ -1208,17 +1234,17 @@ class $e {
|
|
|
1208
1234
|
const t = this._getOriginId(e), s = this._getOriginZoom(e), r = "No cluster with the specified id.", o = this.trees[s];
|
|
1209
1235
|
if (!o)
|
|
1210
1236
|
throw new Error(r);
|
|
1211
|
-
const
|
|
1212
|
-
if (t * this.stride >=
|
|
1237
|
+
const a = o.data;
|
|
1238
|
+
if (t * this.stride >= a.length)
|
|
1213
1239
|
throw new Error(r);
|
|
1214
|
-
const
|
|
1240
|
+
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
1241
|
for (const h of u) {
|
|
1216
1242
|
const p = h * this.stride;
|
|
1217
|
-
|
|
1243
|
+
a[p + le] === e && c.push(a[p + I] > 1 ? Le(a, p, this.clusterProps) : this.points[a[p + T]]);
|
|
1218
1244
|
}
|
|
1219
|
-
if (
|
|
1245
|
+
if (c.length === 0)
|
|
1220
1246
|
throw new Error(r);
|
|
1221
|
-
return
|
|
1247
|
+
return c;
|
|
1222
1248
|
}
|
|
1223
1249
|
getLeaves(e, t, s) {
|
|
1224
1250
|
t = t || 10, s = s || 0;
|
|
@@ -1226,31 +1252,31 @@ class $e {
|
|
|
1226
1252
|
return this._appendLeaves(r, e, t, s, 0), r;
|
|
1227
1253
|
}
|
|
1228
1254
|
getTile(e, t, s) {
|
|
1229
|
-
const r = this.trees[this._limitZoom(e)], o = Math.pow(2, e), { extent:
|
|
1255
|
+
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
1256
|
features: []
|
|
1231
1257
|
};
|
|
1232
1258
|
return this._addTileFeatures(
|
|
1233
|
-
r.range((t -
|
|
1259
|
+
r.range((t - i) / o, d, (t + 1 + i) / o, u),
|
|
1234
1260
|
r.data,
|
|
1235
1261
|
t,
|
|
1236
1262
|
s,
|
|
1237
1263
|
o,
|
|
1238
|
-
|
|
1264
|
+
c
|
|
1239
1265
|
), t === 0 && this._addTileFeatures(
|
|
1240
|
-
r.range(1 -
|
|
1266
|
+
r.range(1 - i / o, d, 1, u),
|
|
1241
1267
|
r.data,
|
|
1242
1268
|
o,
|
|
1243
1269
|
s,
|
|
1244
1270
|
o,
|
|
1245
|
-
|
|
1271
|
+
c
|
|
1246
1272
|
), t === o - 1 && this._addTileFeatures(
|
|
1247
|
-
r.range(0, d,
|
|
1273
|
+
r.range(0, d, i / o, u),
|
|
1248
1274
|
r.data,
|
|
1249
1275
|
-1,
|
|
1250
1276
|
s,
|
|
1251
1277
|
o,
|
|
1252
|
-
|
|
1253
|
-
),
|
|
1278
|
+
c
|
|
1279
|
+
), c.features.length ? c : null;
|
|
1254
1280
|
}
|
|
1255
1281
|
getClusterExpansionZoom(e) {
|
|
1256
1282
|
let t = this._getOriginZoom(e) - 1;
|
|
@@ -1263,81 +1289,81 @@ class $e {
|
|
|
1263
1289
|
return t;
|
|
1264
1290
|
}
|
|
1265
1291
|
_appendLeaves(e, t, s, r, o) {
|
|
1266
|
-
const
|
|
1267
|
-
for (const
|
|
1268
|
-
const
|
|
1269
|
-
if (
|
|
1292
|
+
const a = this.getChildren(t);
|
|
1293
|
+
for (const l of a) {
|
|
1294
|
+
const i = l.properties;
|
|
1295
|
+
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
1296
|
break;
|
|
1271
1297
|
}
|
|
1272
1298
|
return o;
|
|
1273
1299
|
}
|
|
1274
1300
|
_createTree(e) {
|
|
1275
|
-
const t = new
|
|
1301
|
+
const t = new me(e.length / this.stride | 0, this.options.nodeSize, Float32Array);
|
|
1276
1302
|
for (let s = 0; s < e.length; s += this.stride)
|
|
1277
1303
|
t.add(e[s], e[s + 1]);
|
|
1278
1304
|
return t.finish(), t.data = e, t;
|
|
1279
1305
|
}
|
|
1280
|
-
_addTileFeatures(e, t, s, r, o,
|
|
1281
|
-
for (const
|
|
1282
|
-
const
|
|
1283
|
-
let u,
|
|
1306
|
+
_addTileFeatures(e, t, s, r, o, a) {
|
|
1307
|
+
for (const l of e) {
|
|
1308
|
+
const i = l * this.stride, d = t[i + I] > 1;
|
|
1309
|
+
let u, c, h;
|
|
1284
1310
|
if (d)
|
|
1285
|
-
u =
|
|
1311
|
+
u = je(t, i, this.clusterProps), c = t[i], h = t[i + 1];
|
|
1286
1312
|
else {
|
|
1287
|
-
const
|
|
1288
|
-
u =
|
|
1289
|
-
const [g,
|
|
1290
|
-
|
|
1313
|
+
const m = this.points[t[i + T]];
|
|
1314
|
+
u = m.properties;
|
|
1315
|
+
const [g, y] = m.geometry.coordinates;
|
|
1316
|
+
c = ee(g), h = te(y);
|
|
1291
1317
|
}
|
|
1292
1318
|
const p = {
|
|
1293
1319
|
type: 1,
|
|
1294
1320
|
geometry: [[
|
|
1295
|
-
Math.round(this.options.extent * (
|
|
1321
|
+
Math.round(this.options.extent * (c * o - s)),
|
|
1296
1322
|
Math.round(this.options.extent * (h * o - r))
|
|
1297
1323
|
]],
|
|
1298
1324
|
tags: u
|
|
1299
1325
|
};
|
|
1300
|
-
let
|
|
1301
|
-
d || this.options.generateId ?
|
|
1326
|
+
let f;
|
|
1327
|
+
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
1328
|
}
|
|
1303
1329
|
}
|
|
1304
1330
|
_limitZoom(e) {
|
|
1305
1331
|
return Math.max(this.options.minZoom, Math.min(Math.floor(+e), this.options.maxZoom + 1));
|
|
1306
1332
|
}
|
|
1307
1333
|
_cluster(e, t) {
|
|
1308
|
-
const { radius: s, extent: r, reduce: o, minPoints:
|
|
1309
|
-
for (let
|
|
1310
|
-
if (
|
|
1334
|
+
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;
|
|
1335
|
+
for (let c = 0; c < i.length; c += u) {
|
|
1336
|
+
if (i[c + R] <= t)
|
|
1311
1337
|
continue;
|
|
1312
|
-
|
|
1313
|
-
const h =
|
|
1314
|
-
let g =
|
|
1315
|
-
for (const
|
|
1316
|
-
const
|
|
1317
|
-
|
|
1338
|
+
i[c + R] = t;
|
|
1339
|
+
const h = i[c], p = i[c + 1], f = e.within(i[c], i[c + 1], l), m = i[c + I];
|
|
1340
|
+
let g = m;
|
|
1341
|
+
for (const y of f) {
|
|
1342
|
+
const _ = y * u;
|
|
1343
|
+
i[_ + R] > t && (g += i[_ + I]);
|
|
1318
1344
|
}
|
|
1319
|
-
if (g >
|
|
1320
|
-
let
|
|
1321
|
-
const
|
|
1322
|
-
for (const E of
|
|
1323
|
-
const
|
|
1324
|
-
if (
|
|
1345
|
+
if (g > m && g >= a) {
|
|
1346
|
+
let y = h * m, _ = p * m, w, O = -1;
|
|
1347
|
+
const b = ((c / u | 0) << 5) + (t + 1) + this.points.length;
|
|
1348
|
+
for (const E of f) {
|
|
1349
|
+
const M = E * u;
|
|
1350
|
+
if (i[M + R] <= t)
|
|
1325
1351
|
continue;
|
|
1326
|
-
|
|
1327
|
-
const
|
|
1328
|
-
|
|
1352
|
+
i[M + R] = t;
|
|
1353
|
+
const L = i[M + I];
|
|
1354
|
+
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
1355
|
}
|
|
1330
|
-
|
|
1356
|
+
i[c + le] = b, d.push(y / g, _ / g, 1 / 0, b, -1, g), o && d.push(O);
|
|
1331
1357
|
} else {
|
|
1332
|
-
for (let
|
|
1333
|
-
d.push(
|
|
1358
|
+
for (let y = 0; y < u; y++)
|
|
1359
|
+
d.push(i[c + y]);
|
|
1334
1360
|
if (g > 1)
|
|
1335
|
-
for (const
|
|
1336
|
-
const
|
|
1337
|
-
if (!(
|
|
1338
|
-
|
|
1339
|
-
for (let
|
|
1340
|
-
d.push(
|
|
1361
|
+
for (const y of f) {
|
|
1362
|
+
const _ = y * u;
|
|
1363
|
+
if (!(i[_ + R] <= t)) {
|
|
1364
|
+
i[_ + R] = t;
|
|
1365
|
+
for (let w = 0; w < u; w++)
|
|
1366
|
+
d.push(i[_ + w]);
|
|
1341
1367
|
}
|
|
1342
1368
|
}
|
|
1343
1369
|
}
|
|
@@ -1354,44 +1380,44 @@ class $e {
|
|
|
1354
1380
|
}
|
|
1355
1381
|
_map(e, t, s) {
|
|
1356
1382
|
if (e[t + I] > 1) {
|
|
1357
|
-
const
|
|
1358
|
-
return s ? Object.assign({},
|
|
1383
|
+
const a = this.clusterProps[e[t + Re]];
|
|
1384
|
+
return s ? Object.assign({}, a) : a;
|
|
1359
1385
|
}
|
|
1360
1386
|
const r = this.points[e[t + T]].properties, o = this.options.map(r);
|
|
1361
1387
|
return s && o === r ? Object.assign({}, o) : o;
|
|
1362
1388
|
}
|
|
1363
1389
|
}
|
|
1364
|
-
function
|
|
1390
|
+
function Le(n, e, t) {
|
|
1365
1391
|
return {
|
|
1366
1392
|
type: "Feature",
|
|
1367
1393
|
id: n[e + T],
|
|
1368
|
-
properties:
|
|
1394
|
+
properties: je(n, e, t),
|
|
1369
1395
|
geometry: {
|
|
1370
1396
|
type: "Point",
|
|
1371
|
-
coordinates: [
|
|
1397
|
+
coordinates: [ut(n[e]), dt(n[e + 1])]
|
|
1372
1398
|
}
|
|
1373
1399
|
};
|
|
1374
1400
|
}
|
|
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(
|
|
1401
|
+
function je(n, e, t) {
|
|
1402
|
+
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]);
|
|
1403
|
+
return Object.assign(a, {
|
|
1378
1404
|
cluster: !0,
|
|
1379
1405
|
cluster_id: n[e + T],
|
|
1380
1406
|
point_count: s,
|
|
1381
1407
|
point_count_abbreviated: r
|
|
1382
1408
|
});
|
|
1383
1409
|
}
|
|
1384
|
-
function
|
|
1410
|
+
function ee(n) {
|
|
1385
1411
|
return n / 360 + 0.5;
|
|
1386
1412
|
}
|
|
1387
|
-
function
|
|
1413
|
+
function te(n) {
|
|
1388
1414
|
const e = Math.sin(n * Math.PI / 180), t = 0.5 - 0.25 * Math.log((1 + e) / (1 - e)) / Math.PI;
|
|
1389
1415
|
return t < 0 ? 0 : t > 1 ? 1 : t;
|
|
1390
1416
|
}
|
|
1391
|
-
function
|
|
1417
|
+
function ut(n) {
|
|
1392
1418
|
return (n - 0.5) * 360;
|
|
1393
1419
|
}
|
|
1394
|
-
function
|
|
1420
|
+
function dt(n) {
|
|
1395
1421
|
const e = (180 - n * 360) * Math.PI / 180;
|
|
1396
1422
|
return 360 * Math.atan(Math.exp(e)) / Math.PI - 90;
|
|
1397
1423
|
}
|
|
@@ -1409,7 +1435,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
1409
1435
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
1410
1436
|
PERFORMANCE OF THIS SOFTWARE.
|
|
1411
1437
|
***************************************************************************** */
|
|
1412
|
-
function
|
|
1438
|
+
function ge(n, e) {
|
|
1413
1439
|
var t = {};
|
|
1414
1440
|
for (var s in n)
|
|
1415
1441
|
Object.prototype.hasOwnProperty.call(n, s) && e.indexOf(s) < 0 && (t[s] = n[s]);
|
|
@@ -1418,7 +1444,7 @@ function de(n, e) {
|
|
|
1418
1444
|
e.indexOf(s[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, s[r]) && (t[s[r]] = n[s[r]]);
|
|
1419
1445
|
return t;
|
|
1420
1446
|
}
|
|
1421
|
-
class
|
|
1447
|
+
class k {
|
|
1422
1448
|
static isAdvancedMarkerAvailable(e) {
|
|
1423
1449
|
return google.maps.marker && e.getMapCapabilities().isAdvancedMarkersAvailable === !0;
|
|
1424
1450
|
}
|
|
@@ -1453,7 +1479,7 @@ class W {
|
|
|
1453
1479
|
return;
|
|
1454
1480
|
const e = new google.maps.LatLngBounds(this._position, this._position);
|
|
1455
1481
|
for (const t of this.markers)
|
|
1456
|
-
e.extend(
|
|
1482
|
+
e.extend(k.getPosition(t));
|
|
1457
1483
|
return e;
|
|
1458
1484
|
}
|
|
1459
1485
|
get position() {
|
|
@@ -1463,7 +1489,7 @@ class W {
|
|
|
1463
1489
|
* Get the count of **visible** markers.
|
|
1464
1490
|
*/
|
|
1465
1491
|
get count() {
|
|
1466
|
-
return this.markers.filter((e) =>
|
|
1492
|
+
return this.markers.filter((e) => k.getVisible(e)).length;
|
|
1467
1493
|
}
|
|
1468
1494
|
/**
|
|
1469
1495
|
* Add a marker to the cluster.
|
|
@@ -1475,26 +1501,26 @@ class W {
|
|
|
1475
1501
|
* Cleanup references and remove marker from map.
|
|
1476
1502
|
*/
|
|
1477
1503
|
delete() {
|
|
1478
|
-
this.marker && (
|
|
1504
|
+
this.marker && (k.setMap(this.marker, null), this.marker = void 0), this.markers.length = 0;
|
|
1479
1505
|
}
|
|
1480
1506
|
}
|
|
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 =
|
|
1507
|
+
const ht = (n, e, t, s) => {
|
|
1508
|
+
const r = Be(n.getBounds(), e, s);
|
|
1509
|
+
return t.filter((o) => r.contains(k.getPosition(o)));
|
|
1510
|
+
}, Be = (n, e, t) => {
|
|
1511
|
+
const { northEast: s, southWest: r } = pt(n, e), o = ft({ northEast: s, southWest: r }, t);
|
|
1512
|
+
return mt(o, e);
|
|
1513
|
+
}, xe = (n, e, t) => {
|
|
1514
|
+
const s = Be(n, e, t), r = s.getNorthEast(), o = s.getSouthWest();
|
|
1489
1515
|
return [o.lng(), o.lat(), r.lng(), r.lat()];
|
|
1490
|
-
},
|
|
1516
|
+
}, pt = (n, e) => ({
|
|
1491
1517
|
northEast: e.fromLatLngToDivPixel(n.getNorthEast()),
|
|
1492
1518
|
southWest: e.fromLatLngToDivPixel(n.getSouthWest())
|
|
1493
|
-
}),
|
|
1519
|
+
}), ft = ({ northEast: n, southWest: e }, t) => (n.x += t, n.y -= t, e.x -= t, e.y += t, { northEast: n, southWest: e }), mt = ({ northEast: n, southWest: e }, t) => {
|
|
1494
1520
|
const s = t.fromDivPixelToLatLng(e), r = t.fromDivPixelToLatLng(n);
|
|
1495
1521
|
return new google.maps.LatLngBounds(s, r);
|
|
1496
1522
|
};
|
|
1497
|
-
class
|
|
1523
|
+
class Ze {
|
|
1498
1524
|
constructor({ maxZoom: e = 16 }) {
|
|
1499
1525
|
this.maxZoom = e;
|
|
1500
1526
|
}
|
|
@@ -1511,12 +1537,12 @@ class qe {
|
|
|
1511
1537
|
* ```
|
|
1512
1538
|
*/
|
|
1513
1539
|
noop({ markers: e }) {
|
|
1514
|
-
return
|
|
1540
|
+
return vt(e);
|
|
1515
1541
|
}
|
|
1516
1542
|
}
|
|
1517
|
-
class
|
|
1543
|
+
class gt extends Ze {
|
|
1518
1544
|
constructor(e) {
|
|
1519
|
-
var { viewportPadding: t = 60 } = e, s =
|
|
1545
|
+
var { viewportPadding: t = 60 } = e, s = ge(e, ["viewportPadding"]);
|
|
1520
1546
|
super(s), this.viewportPadding = 60, this.viewportPadding = t;
|
|
1521
1547
|
}
|
|
1522
1548
|
calculate({ markers: e, map: t, mapCanvasProjection: s }) {
|
|
@@ -1527,21 +1553,21 @@ class dt extends qe {
|
|
|
1527
1553
|
changed: !1
|
|
1528
1554
|
} : {
|
|
1529
1555
|
clusters: this.cluster({
|
|
1530
|
-
markers:
|
|
1556
|
+
markers: ht(t, s, e, this.viewportPadding),
|
|
1531
1557
|
map: t,
|
|
1532
1558
|
mapCanvasProjection: s
|
|
1533
1559
|
})
|
|
1534
1560
|
};
|
|
1535
1561
|
}
|
|
1536
1562
|
}
|
|
1537
|
-
const
|
|
1538
|
-
position:
|
|
1563
|
+
const vt = (n) => n.map((t) => new W({
|
|
1564
|
+
position: k.getPosition(t),
|
|
1539
1565
|
markers: [t]
|
|
1540
1566
|
}));
|
|
1541
|
-
class
|
|
1567
|
+
class yt extends Ze {
|
|
1542
1568
|
constructor(e) {
|
|
1543
|
-
var { maxZoom: t, radius: s = 60 } = e, r =
|
|
1544
|
-
super({ maxZoom: t }), this.state = { zoom: -1 }, this.superCluster = new
|
|
1569
|
+
var { maxZoom: t, radius: s = 60 } = e, r = ge(e, ["maxZoom", "radius"]);
|
|
1570
|
+
super({ maxZoom: t }), this.state = { zoom: -1 }, this.superCluster = new qe(Object.assign({ maxZoom: this.maxZoom, radius: s }, r));
|
|
1545
1571
|
}
|
|
1546
1572
|
calculate(e) {
|
|
1547
1573
|
let t = !1;
|
|
@@ -1549,12 +1575,12 @@ class pt extends qe {
|
|
|
1549
1575
|
if (!A(e.markers, this.markers)) {
|
|
1550
1576
|
t = !0, this.markers = [...e.markers];
|
|
1551
1577
|
const r = this.markers.map((o) => {
|
|
1552
|
-
const
|
|
1578
|
+
const a = k.getPosition(o);
|
|
1553
1579
|
return {
|
|
1554
1580
|
type: "Feature",
|
|
1555
1581
|
geometry: {
|
|
1556
1582
|
type: "Point",
|
|
1557
|
-
coordinates: [
|
|
1583
|
+
coordinates: [a.lng(), a.lat()]
|
|
1558
1584
|
},
|
|
1559
1585
|
properties: { marker: o }
|
|
1560
1586
|
};
|
|
@@ -1575,30 +1601,30 @@ class pt extends qe {
|
|
|
1575
1601
|
const r = s.marker;
|
|
1576
1602
|
return new W({
|
|
1577
1603
|
markers: [r],
|
|
1578
|
-
position:
|
|
1604
|
+
position: k.getPosition(r)
|
|
1579
1605
|
});
|
|
1580
1606
|
}
|
|
1581
1607
|
}
|
|
1582
|
-
class
|
|
1608
|
+
class _t extends gt {
|
|
1583
1609
|
constructor(e) {
|
|
1584
|
-
var { maxZoom: t, radius: s = 60, viewportPadding: r = 60 } = e, o =
|
|
1585
|
-
super({ maxZoom: t, viewportPadding: r }), this.superCluster = new
|
|
1610
|
+
var { maxZoom: t, radius: s = 60, viewportPadding: r = 60 } = e, o = ge(e, ["maxZoom", "radius", "viewportPadding"]);
|
|
1611
|
+
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
1612
|
}
|
|
1587
1613
|
calculate(e) {
|
|
1588
1614
|
const t = {
|
|
1589
1615
|
zoom: Math.round(e.map.getZoom()),
|
|
1590
|
-
view:
|
|
1616
|
+
view: xe(e.map.getBounds(), e.mapCanvasProjection, this.viewportPadding)
|
|
1591
1617
|
};
|
|
1592
1618
|
let s = !A(this.state, t);
|
|
1593
1619
|
if (!A(e.markers, this.markers)) {
|
|
1594
1620
|
s = !0, this.markers = [...e.markers];
|
|
1595
1621
|
const r = this.markers.map((o) => {
|
|
1596
|
-
const
|
|
1622
|
+
const a = k.getPosition(o);
|
|
1597
1623
|
return {
|
|
1598
1624
|
type: "Feature",
|
|
1599
1625
|
geometry: {
|
|
1600
1626
|
type: "Point",
|
|
1601
|
-
coordinates: [
|
|
1627
|
+
coordinates: [a.lng(), a.lat()]
|
|
1602
1628
|
},
|
|
1603
1629
|
properties: { marker: o }
|
|
1604
1630
|
};
|
|
@@ -1610,7 +1636,7 @@ class ft extends dt {
|
|
|
1610
1636
|
cluster({ map: e, mapCanvasProjection: t }) {
|
|
1611
1637
|
const s = {
|
|
1612
1638
|
zoom: Math.round(e.getZoom()),
|
|
1613
|
-
view:
|
|
1639
|
+
view: xe(e.getBounds(), t, this.viewportPadding)
|
|
1614
1640
|
};
|
|
1615
1641
|
return this.superCluster.getClusters(s.view, s.zoom).map((r) => this.transformCluster(r));
|
|
1616
1642
|
}
|
|
@@ -1623,14 +1649,14 @@ class ft extends dt {
|
|
|
1623
1649
|
const r = s.marker;
|
|
1624
1650
|
return new W({
|
|
1625
1651
|
markers: [r],
|
|
1626
|
-
position:
|
|
1652
|
+
position: k.getPosition(r)
|
|
1627
1653
|
});
|
|
1628
1654
|
}
|
|
1629
1655
|
}
|
|
1630
|
-
class
|
|
1656
|
+
class wt {
|
|
1631
1657
|
constructor(e, t) {
|
|
1632
1658
|
this.markers = { sum: e.length };
|
|
1633
|
-
const s = t.map((o) => o.count), r = s.reduce((o,
|
|
1659
|
+
const s = t.map((o) => o.count), r = s.reduce((o, a) => o + a, 0);
|
|
1634
1660
|
this.clusters = {
|
|
1635
1661
|
count: t.length,
|
|
1636
1662
|
markers: {
|
|
@@ -1642,7 +1668,7 @@ class mt {
|
|
|
1642
1668
|
};
|
|
1643
1669
|
}
|
|
1644
1670
|
}
|
|
1645
|
-
class
|
|
1671
|
+
class kt {
|
|
1646
1672
|
/**
|
|
1647
1673
|
* The default render function for the library used by {@link MarkerClusterer}.
|
|
1648
1674
|
*
|
|
@@ -1682,57 +1708,57 @@ class gt {
|
|
|
1682
1708
|
* ```
|
|
1683
1709
|
*/
|
|
1684
1710
|
render({ count: e, position: t }, s, r) {
|
|
1685
|
-
const
|
|
1711
|
+
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
1712
|
<circle cx="120" cy="120" opacity=".6" r="70" />
|
|
1687
1713
|
<circle cx="120" cy="120" opacity=".3" r="90" />
|
|
1688
1714
|
<circle cx="120" cy="120" opacity=".2" r="110" />
|
|
1689
1715
|
<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 (
|
|
1716
|
+
</svg>`, l = `Cluster of ${e} markers`, i = Number(google.maps.Marker.MAX_ZINDEX) + e;
|
|
1717
|
+
if (k.isAdvancedMarkerAvailable(r)) {
|
|
1692
1718
|
const u = document.createElement("div");
|
|
1693
|
-
u.innerHTML =
|
|
1694
|
-
const
|
|
1695
|
-
|
|
1719
|
+
u.innerHTML = a;
|
|
1720
|
+
const c = u.firstElementChild;
|
|
1721
|
+
c.setAttribute("transform", "translate(0 25)");
|
|
1696
1722
|
const h = {
|
|
1697
1723
|
map: r,
|
|
1698
1724
|
position: t,
|
|
1699
|
-
zIndex:
|
|
1700
|
-
title:
|
|
1701
|
-
content:
|
|
1725
|
+
zIndex: i,
|
|
1726
|
+
title: l,
|
|
1727
|
+
content: c
|
|
1702
1728
|
};
|
|
1703
1729
|
return new google.maps.marker.AdvancedMarkerElement(h);
|
|
1704
1730
|
}
|
|
1705
1731
|
const d = {
|
|
1706
1732
|
position: t,
|
|
1707
|
-
zIndex:
|
|
1708
|
-
title:
|
|
1733
|
+
zIndex: i,
|
|
1734
|
+
title: l,
|
|
1709
1735
|
icon: {
|
|
1710
|
-
url: `data:image/svg+xml;base64,${btoa(
|
|
1736
|
+
url: `data:image/svg+xml;base64,${btoa(a)}`,
|
|
1711
1737
|
anchor: new google.maps.Point(25, 25)
|
|
1712
1738
|
}
|
|
1713
1739
|
};
|
|
1714
1740
|
return new google.maps.Marker(d);
|
|
1715
1741
|
}
|
|
1716
1742
|
}
|
|
1717
|
-
function
|
|
1743
|
+
function Ct(n, e) {
|
|
1718
1744
|
for (let t in e.prototype)
|
|
1719
1745
|
n.prototype[t] = e.prototype[t];
|
|
1720
1746
|
}
|
|
1721
|
-
class
|
|
1747
|
+
class ve {
|
|
1722
1748
|
constructor() {
|
|
1723
|
-
|
|
1749
|
+
Ct(ve, google.maps.OverlayView);
|
|
1724
1750
|
}
|
|
1725
1751
|
}
|
|
1726
1752
|
var D;
|
|
1727
1753
|
(function(n) {
|
|
1728
1754
|
n.CLUSTERING_BEGIN = "clusteringbegin", n.CLUSTERING_END = "clusteringend", n.CLUSTER_CLICK = "click";
|
|
1729
1755
|
})(D || (D = {}));
|
|
1730
|
-
const
|
|
1756
|
+
const bt = (n, e, t) => {
|
|
1731
1757
|
t.fitBounds(e.bounds);
|
|
1732
1758
|
};
|
|
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 =
|
|
1759
|
+
class Mt extends ve {
|
|
1760
|
+
constructor({ map: e, markers: t = [], algorithmOptions: s = {}, algorithm: r = new yt(s), renderer: o = new kt(), onClusterClick: a = bt }) {
|
|
1761
|
+
super(), this.markers = [...t], this.clusters = [], this.algorithm = r, this.renderer = o, this.onClusterClick = a, e && this.setMap(e);
|
|
1736
1762
|
}
|
|
1737
1763
|
addMarker(e, t) {
|
|
1738
1764
|
this.markers.includes(e) || (this.markers.push(e), t || this.render());
|
|
@@ -1744,7 +1770,7 @@ class wt extends he {
|
|
|
1744
1770
|
}
|
|
1745
1771
|
removeMarker(e, t) {
|
|
1746
1772
|
const s = this.markers.indexOf(e);
|
|
1747
|
-
return s === -1 ? !1 : (
|
|
1773
|
+
return s === -1 ? !1 : (k.setMap(e, null), this.markers.splice(s, 1), t || this.render(), !0);
|
|
1748
1774
|
}
|
|
1749
1775
|
removeMarkers(e, t) {
|
|
1750
1776
|
let s = !1;
|
|
@@ -1769,12 +1795,12 @@ class wt extends he {
|
|
|
1769
1795
|
});
|
|
1770
1796
|
if (s || s == null) {
|
|
1771
1797
|
const r = /* @__PURE__ */ new Set();
|
|
1772
|
-
for (const
|
|
1773
|
-
|
|
1798
|
+
for (const a of t)
|
|
1799
|
+
a.markers.length == 1 && r.add(a.markers[0]);
|
|
1774
1800
|
const o = [];
|
|
1775
|
-
for (const
|
|
1776
|
-
|
|
1777
|
-
this.clusters = t, this.renderClusters(), requestAnimationFrame(() => o.forEach((
|
|
1801
|
+
for (const a of this.clusters)
|
|
1802
|
+
a.marker != null && (a.markers.length == 1 ? r.has(a.marker) || k.setMap(a.marker, null) : o.push(a.marker));
|
|
1803
|
+
this.clusters = t, this.renderClusters(), requestAnimationFrame(() => o.forEach((a) => k.setMap(a, null)));
|
|
1778
1804
|
}
|
|
1779
1805
|
google.maps.event.trigger(this, D.CLUSTERING_END, this);
|
|
1780
1806
|
}
|
|
@@ -1786,22 +1812,22 @@ class wt extends he {
|
|
|
1786
1812
|
google.maps.event.removeListener(this.idleListener), this.reset();
|
|
1787
1813
|
}
|
|
1788
1814
|
reset() {
|
|
1789
|
-
this.markers.forEach((e) =>
|
|
1815
|
+
this.markers.forEach((e) => k.setMap(e, null)), this.clusters.forEach((e) => e.delete()), this.clusters = [];
|
|
1790
1816
|
}
|
|
1791
1817
|
renderClusters() {
|
|
1792
|
-
const e = new
|
|
1818
|
+
const e = new wt(this.markers, this.clusters), t = this.getMap();
|
|
1793
1819
|
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) =>
|
|
1820
|
+
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
1821
|
"click",
|
|
1796
1822
|
/* istanbul ignore next */
|
|
1797
1823
|
(r) => {
|
|
1798
1824
|
google.maps.event.trigger(this, D.CLUSTER_CLICK, s), this.onClusterClick(r, s, t);
|
|
1799
1825
|
}
|
|
1800
|
-
)),
|
|
1826
|
+
)), k.setMap(s.marker, t);
|
|
1801
1827
|
});
|
|
1802
1828
|
}
|
|
1803
1829
|
}
|
|
1804
|
-
const
|
|
1830
|
+
const Ae = Object.values(D), Nt = P({
|
|
1805
1831
|
name: "MarkerCluster",
|
|
1806
1832
|
props: {
|
|
1807
1833
|
options: {
|
|
@@ -1809,37 +1835,37 @@ const Ee = Object.values(D), Rt = P({
|
|
|
1809
1835
|
default: () => ({})
|
|
1810
1836
|
}
|
|
1811
1837
|
},
|
|
1812
|
-
emits:
|
|
1838
|
+
emits: Ae,
|
|
1813
1839
|
setup(n, { emit: e, expose: t, slots: s }) {
|
|
1814
|
-
const r =
|
|
1815
|
-
return U(
|
|
1840
|
+
const r = v(), o = C(B, v()), a = C(Z, v());
|
|
1841
|
+
return U(fe, r), S(
|
|
1816
1842
|
o,
|
|
1817
1843
|
() => {
|
|
1818
1844
|
o.value && (r.value = x(
|
|
1819
|
-
new
|
|
1845
|
+
new Mt({
|
|
1820
1846
|
map: o.value,
|
|
1821
1847
|
// Better perf than the default `SuperClusterAlgorithm`. See:
|
|
1822
1848
|
// https://github.com/googlemaps/js-markerclusterer/pull/640
|
|
1823
|
-
algorithm: new
|
|
1849
|
+
algorithm: new _t(n.options.algorithmOptions ?? {}),
|
|
1824
1850
|
...n.options
|
|
1825
1851
|
})
|
|
1826
|
-
),
|
|
1827
|
-
var
|
|
1828
|
-
(
|
|
1852
|
+
), Ae.forEach((l) => {
|
|
1853
|
+
var i;
|
|
1854
|
+
(i = r.value) == null || i.addListener(l, (d) => e(l, d));
|
|
1829
1855
|
}));
|
|
1830
1856
|
},
|
|
1831
1857
|
{
|
|
1832
1858
|
immediate: !0
|
|
1833
1859
|
}
|
|
1834
|
-
),
|
|
1835
|
-
var
|
|
1836
|
-
r.value && ((
|
|
1860
|
+
), j(() => {
|
|
1861
|
+
var l;
|
|
1862
|
+
r.value && ((l = a.value) == null || l.event.clearInstanceListeners(r.value), r.value.clearMarkers(), r.value.setMap(null));
|
|
1837
1863
|
}), t({ markerCluster: r }), () => {
|
|
1838
|
-
var
|
|
1839
|
-
return (
|
|
1864
|
+
var l;
|
|
1865
|
+
return (l = s.default) == null ? void 0 : l.call(s);
|
|
1840
1866
|
};
|
|
1841
1867
|
}
|
|
1842
|
-
}),
|
|
1868
|
+
}), Ot = P({
|
|
1843
1869
|
inheritAttrs: !1,
|
|
1844
1870
|
props: {
|
|
1845
1871
|
options: {
|
|
@@ -1848,33 +1874,33 @@ const Ee = Object.values(D), Rt = P({
|
|
|
1848
1874
|
}
|
|
1849
1875
|
},
|
|
1850
1876
|
setup(n, { slots: e, emit: t, expose: s }) {
|
|
1851
|
-
const r =
|
|
1852
|
-
var
|
|
1853
|
-
return (
|
|
1854
|
-
}),
|
|
1877
|
+
const r = v(), o = F(() => {
|
|
1878
|
+
var i;
|
|
1879
|
+
return (i = e.default) == null ? void 0 : i.call(e).some((d) => d.type !== ue);
|
|
1880
|
+
}), a = F(() => ({
|
|
1855
1881
|
...n.options,
|
|
1856
1882
|
element: r.value
|
|
1857
|
-
})),
|
|
1883
|
+
})), l = z(re, [], a, t);
|
|
1858
1884
|
return s({
|
|
1859
|
-
customMarker:
|
|
1860
|
-
}), { customMarkerRef: r, customMarker:
|
|
1885
|
+
customMarker: l
|
|
1886
|
+
}), { customMarkerRef: r, customMarker: l, hasSlotContent: o };
|
|
1861
1887
|
}
|
|
1862
1888
|
});
|
|
1863
|
-
const
|
|
1889
|
+
const Et = {
|
|
1864
1890
|
key: 0,
|
|
1865
1891
|
class: "custom-marker-wrapper"
|
|
1866
1892
|
};
|
|
1867
|
-
function
|
|
1868
|
-
return n.hasSlotContent ? (
|
|
1869
|
-
|
|
1893
|
+
function Pt(n, e, t, s, r, o) {
|
|
1894
|
+
return n.hasSlotContent ? (K(), Y("div", Et, [
|
|
1895
|
+
se("div", de({
|
|
1870
1896
|
ref: "customMarkerRef",
|
|
1871
1897
|
style: { cursor: n.$attrs.onClick ? "pointer" : void 0 }
|
|
1872
1898
|
}, n.$attrs), [
|
|
1873
|
-
|
|
1899
|
+
J(n.$slots, "default", {}, void 0, !0)
|
|
1874
1900
|
], 16)
|
|
1875
|
-
])) :
|
|
1901
|
+
])) : he("", !0);
|
|
1876
1902
|
}
|
|
1877
|
-
const
|
|
1903
|
+
const Ut = /* @__PURE__ */ X(Ot, [["render", Pt], ["__scopeId", "data-v-2d2d343a"]]), Dt = P({
|
|
1878
1904
|
name: "HeatmapLayer",
|
|
1879
1905
|
props: {
|
|
1880
1906
|
options: {
|
|
@@ -1883,17 +1909,17 @@ const jt = /* @__PURE__ */ te(_t, [["render", Ct], ["__scopeId", "data-v-2d2d343
|
|
|
1883
1909
|
}
|
|
1884
1910
|
},
|
|
1885
1911
|
setup(n) {
|
|
1886
|
-
const e =
|
|
1887
|
-
return
|
|
1912
|
+
const e = v(), t = C(B, v()), s = C(Z, v());
|
|
1913
|
+
return S(
|
|
1888
1914
|
[t, () => n.options],
|
|
1889
|
-
([r, o], [
|
|
1915
|
+
([r, o], [a, l]) => {
|
|
1890
1916
|
var d;
|
|
1891
|
-
const
|
|
1892
|
-
if (t.value && s.value &&
|
|
1917
|
+
const i = !A(o, l) || t.value !== a;
|
|
1918
|
+
if (t.value && s.value && i) {
|
|
1893
1919
|
const u = structuredClone(o);
|
|
1894
1920
|
if (u.data && !(u.data instanceof s.value.MVCArray)) {
|
|
1895
|
-
const
|
|
1896
|
-
u.data = (d = u.data) == null ? void 0 : d.map((h) => h instanceof
|
|
1921
|
+
const c = s.value.LatLng;
|
|
1922
|
+
u.data = (d = u.data) == null ? void 0 : d.map((h) => h instanceof c || "location" in h && (h.location instanceof c || h.location === null) ? h : "location" in h ? { ...h, location: new c(h.location) } : new c(h));
|
|
1897
1923
|
}
|
|
1898
1924
|
e.value ? e.value.setOptions(u) : e.value = x(
|
|
1899
1925
|
new s.value.visualization.HeatmapLayer({
|
|
@@ -1904,23 +1930,23 @@ const jt = /* @__PURE__ */ te(_t, [["render", Ct], ["__scopeId", "data-v-2d2d343
|
|
|
1904
1930
|
}
|
|
1905
1931
|
},
|
|
1906
1932
|
{ immediate: !0 }
|
|
1907
|
-
),
|
|
1933
|
+
), j(() => {
|
|
1908
1934
|
e.value && e.value.setMap(null);
|
|
1909
1935
|
}), { heatmapLayer: e };
|
|
1910
1936
|
},
|
|
1911
1937
|
render: () => null
|
|
1912
1938
|
});
|
|
1913
1939
|
export {
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1940
|
+
It as AdvancedMarker,
|
|
1941
|
+
jt as Circle,
|
|
1942
|
+
Bt as CustomControl,
|
|
1943
|
+
Ut as CustomMarker,
|
|
1944
|
+
At as GoogleMap,
|
|
1945
|
+
Dt as HeatmapLayer,
|
|
1946
|
+
Zt as InfoWindow,
|
|
1947
|
+
Tt as Marker,
|
|
1948
|
+
Nt as MarkerCluster,
|
|
1949
|
+
Rt as Polygon,
|
|
1950
|
+
$t as Polyline,
|
|
1951
|
+
qt as Rectangle
|
|
1926
1952
|
};
|