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