vue3-google-map 0.24.1 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -14
- package/dist/index.cjs +3 -3
- package/dist/index.mjs +697 -900
- 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-135889a7]{display:none}.mapdiv .info-window-wrapper[data-v-135889a7]{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 O, ref as y, provide as U, watch as M, 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(), m = new URLSearchParams(), h = () => e || (e = new Promise(async (p, g) => {
|
|
24
|
+
var v;
|
|
25
|
+
await (t = a.createElement("script")), m.set("libraries", [...f] + "");
|
|
26
|
+
for (n in r)
|
|
27
|
+
m.set(n.replace(/[A-Z]/g, (_) => "_" + _[0].toLowerCase()), r[n]);
|
|
28
|
+
m.set("callback", o + ".maps." + l), lt(t, "https://maps.googleapis.com/maps/api/js?" + m), 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) && h().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;
|
|
86
|
-
}
|
|
87
|
-
var ht = ft(), mt = /* @__PURE__ */ pt(ht);
|
|
88
|
-
const qe = "__googleMapsScriptId";
|
|
89
|
-
var U;
|
|
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
|
-
}
|
|
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);
|
|
256
56
|
}
|
|
257
|
-
function
|
|
258
|
-
return class extends
|
|
259
|
-
constructor(
|
|
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 = O({
|
|
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 m = (
|
|
368
|
+
const m = (p) => {
|
|
573
369
|
var g;
|
|
574
|
-
return
|
|
575
|
-
},
|
|
576
|
-
scaleControlOptions:
|
|
577
|
-
panControlOptions: m(
|
|
578
|
-
zoomControlOptions: m(
|
|
579
|
-
rotateControlOptions: m(
|
|
580
|
-
streetViewControlOptions: m(
|
|
581
|
-
fullscreenControlOptions: m(
|
|
582
|
-
cameraControlOptions: m(
|
|
583
|
-
disableDefaultUI:
|
|
370
|
+
return p ? { position: (g = o.value) == null ? void 0 : g.ControlPosition[p] } : {};
|
|
371
|
+
}, h = {
|
|
372
|
+
scaleControlOptions: r.scaleControlStyle ? { style: r.scaleControlStyle } : {},
|
|
373
|
+
panControlOptions: m(r.panControlPosition),
|
|
374
|
+
zoomControlOptions: m(r.zoomControlPosition),
|
|
375
|
+
rotateControlOptions: m(r.rotateControlPosition),
|
|
376
|
+
streetViewControlOptions: m(r.streetViewControlPosition),
|
|
377
|
+
fullscreenControlOptions: m(r.fullscreenControlPosition),
|
|
378
|
+
cameraControlOptions: m(r.cameraControlPosition),
|
|
379
|
+
disableDefaultUI: r.disableDefaultUi
|
|
584
380
|
};
|
|
585
|
-
return { ...u, ...
|
|
586
|
-
}, a =
|
|
381
|
+
return { ...u, ...h };
|
|
382
|
+
}, a = M(
|
|
587
383
|
[o, s],
|
|
588
|
-
([u,
|
|
589
|
-
const m = u,
|
|
590
|
-
m &&
|
|
384
|
+
([u, f]) => {
|
|
385
|
+
const m = u, h = f;
|
|
386
|
+
m && h && (m.event.addListenerOnce(h, "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: m, language: h, libraries: p } = r;
|
|
393
|
+
mt({ key: u, region: f, v: m, language: h, 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 m = yt(o.value);
|
|
398
|
+
o.value[le] = m, be.forEach((p) => {
|
|
399
|
+
var g;
|
|
400
|
+
(g = s.value) == null || g.addListener(p, (v) => e(p, v));
|
|
401
|
+
}), n.value = !0;
|
|
402
|
+
const h = Object.keys(r).filter(
|
|
403
|
+
(p) => !["apiPromise", "apiKey", "version", "libraries", "region", "language", "center", "zoom"].includes(p)
|
|
404
|
+
).map((p) => R(r, p));
|
|
405
|
+
M(
|
|
406
|
+
[() => r.center, () => r.zoom, ...h],
|
|
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 = O({
|
|
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 =
|
|
496
|
+
emits: Se,
|
|
497
|
+
setup(r, { emit: e, expose: t, slots: n }) {
|
|
498
|
+
const s = y(), o = z(() => {
|
|
702
499
|
var m;
|
|
703
|
-
return (m =
|
|
704
|
-
}), i =
|
|
500
|
+
return (m = n.content) == null ? void 0 : m.call(n).some((h) => h.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 M(
|
|
708
505
|
[c, i, l, s],
|
|
709
|
-
async (m, [
|
|
710
|
-
var C, T,
|
|
711
|
-
const
|
|
712
|
-
if (!c.value || !d.value || !
|
|
506
|
+
async (m, [h, 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 !== h;
|
|
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 m,
|
|
734
|
-
a.value && ((m = d.value) == null || m.event.clearInstanceListeners(a.value),
|
|
735
|
-
}),
|
|
529
|
+
), $(() => {
|
|
530
|
+
var m, h;
|
|
531
|
+
a.value && ((m = d.value) == null || m.event.clearInstanceListeners(a.value), f.value ? (h = u.value) == null || h.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 M(
|
|
757
554
|
[o, t],
|
|
758
555
|
(c, [d, u]) => {
|
|
759
|
-
var m,
|
|
760
|
-
const
|
|
761
|
-
if (!(!o.value || !i.value || !
|
|
556
|
+
var m, h, 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 && ((m = l.value) == null || m.removeMarker(s.value), (
|
|
560
|
+
s.value.setOptions(t.value), a.value && ((m = l.value) == null || m.removeMarker(s.value), (h = l.value) == null || h.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 = O({
|
|
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 = O({
|
|
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 = O({
|
|
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 = O({
|
|
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 = O({
|
|
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 = O({
|
|
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 = M(
|
|
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, m) => {
|
|
714
|
+
f === t.value && (d = m);
|
|
715
|
+
}), d !== null && n.value.controls[u].removeAt(d);
|
|
919
716
|
}
|
|
920
717
|
};
|
|
921
|
-
return
|
|
922
|
-
() =>
|
|
718
|
+
return $(() => a(r.position)), M(
|
|
719
|
+
() => r.position,
|
|
923
720
|
(c, d) => {
|
|
924
721
|
a(d), l(c);
|
|
925
722
|
}
|
|
926
|
-
),
|
|
927
|
-
() =>
|
|
723
|
+
), M(
|
|
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 = O({
|
|
951
748
|
inheritAttrs: !1,
|
|
952
749
|
props: {
|
|
953
750
|
options: {
|
|
@@ -958,27 +755,27 @@ 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
|
-
}, m = (
|
|
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
|
+
}, m = (p) => {
|
|
768
|
+
s.value && (s.value.open({ map: i.value, anchor: a.value, ...p }), f(!0));
|
|
769
|
+
}, h = () => {
|
|
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
|
+
M(
|
|
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
781
|
}), a.value || m()) : (s.value = S(
|
|
@@ -988,99 +785,99 @@ const Zr = /* @__PURE__ */ re(Mt, [["render", Pt], ["__scopeId", "data-v-ab9120c
|
|
|
988
785
|
})
|
|
989
786
|
), a.value && (c = a.value.addListener("click", () => {
|
|
990
787
|
m();
|
|
991
|
-
})), (!a.value || d) && m(),
|
|
788
|
+
})), (!a.value || d) && m(), Ie.forEach((P) => {
|
|
992
789
|
var b;
|
|
993
|
-
(b = s.value) == null || b.addListener(
|
|
994
|
-
}), (
|
|
790
|
+
(b = s.value) == null || b.addListener(P, (C) => t(P, C));
|
|
791
|
+
}), (q = s.value) == null || q.addListener("closeclick", () => f(!1))));
|
|
995
792
|
},
|
|
996
793
|
{
|
|
997
794
|
immediate: !0,
|
|
998
795
|
flush: "post"
|
|
999
796
|
}
|
|
1000
|
-
),
|
|
1001
|
-
() =>
|
|
1002
|
-
(
|
|
1003
|
-
|
|
797
|
+
), M(
|
|
798
|
+
() => r.modelValue,
|
|
799
|
+
(p) => {
|
|
800
|
+
p !== d && (p ? m() : h());
|
|
1004
801
|
}
|
|
1005
802
|
);
|
|
1006
|
-
}),
|
|
1007
|
-
var
|
|
1008
|
-
c && c.remove(), s.value && ((
|
|
1009
|
-
}),
|
|
803
|
+
}), $(() => {
|
|
804
|
+
var p;
|
|
805
|
+
c && c.remove(), s.value && ((p = l.value) == null || p.event.clearInstanceListeners(s.value), h());
|
|
806
|
+
}), n({ infoWindow: s, open: m, close: h }), { infoWindow: s, infoWindowRef: o, hasSlotContent: u, open: m, close: h };
|
|
1010
807
|
}
|
|
1011
808
|
});
|
|
1012
|
-
const
|
|
809
|
+
const Tt = {
|
|
1013
810
|
key: 0,
|
|
1014
811
|
class: "info-window-wrapper"
|
|
1015
812
|
};
|
|
1016
|
-
function
|
|
1017
|
-
return
|
|
1018
|
-
|
|
1019
|
-
|
|
813
|
+
function Lt(r, e, t, n, s, o) {
|
|
814
|
+
return r.hasSlotContent ? (G(), V("div", Tt, [
|
|
815
|
+
ie("div", ye({ ref: "infoWindowRef" }, r.$attrs), [
|
|
816
|
+
F(r.$slots, "default", {}, void 0, !0)
|
|
1020
817
|
], 16)
|
|
1021
|
-
])) :
|
|
818
|
+
])) : _e("", !0);
|
|
1022
819
|
}
|
|
1023
|
-
const
|
|
1024
|
-
var
|
|
1025
|
-
function
|
|
1026
|
-
return function(
|
|
1027
|
-
return n
|
|
820
|
+
const Vr = /* @__PURE__ */ te(qt, [["render", Lt], ["__scopeId", "data-v-135889a7"]]);
|
|
821
|
+
var xt = Object.getOwnPropertyNames, It = Object.getOwnPropertySymbols, Rt = Object.prototype.hasOwnProperty;
|
|
822
|
+
function Re(r, e) {
|
|
823
|
+
return function(n, s, o) {
|
|
824
|
+
return r(n, s, o) && e(n, s, o);
|
|
1028
825
|
};
|
|
1029
826
|
}
|
|
1030
|
-
function
|
|
1031
|
-
return function(t,
|
|
1032
|
-
if (!t || !
|
|
1033
|
-
return
|
|
1034
|
-
var o = s.cache, i = o.get(t), l = o.get(
|
|
827
|
+
function ne(r) {
|
|
828
|
+
return function(t, n, s) {
|
|
829
|
+
if (!t || !n || typeof t != "object" || typeof n != "object")
|
|
830
|
+
return r(t, n, s);
|
|
831
|
+
var o = s.cache, i = o.get(t), l = o.get(n);
|
|
1035
832
|
if (i && l)
|
|
1036
|
-
return i ===
|
|
1037
|
-
o.set(t,
|
|
1038
|
-
var a =
|
|
1039
|
-
return o.delete(t), o.delete(
|
|
833
|
+
return i === n && l === t;
|
|
834
|
+
o.set(t, n), o.set(n, t);
|
|
835
|
+
var a = r(t, n, s);
|
|
836
|
+
return o.delete(t), o.delete(n), a;
|
|
1040
837
|
};
|
|
1041
838
|
}
|
|
1042
|
-
function
|
|
1043
|
-
return
|
|
839
|
+
function je(r) {
|
|
840
|
+
return xt(r).concat(It(r));
|
|
1044
841
|
}
|
|
1045
|
-
var
|
|
1046
|
-
return
|
|
842
|
+
var jt = Object.hasOwn || function(r, e) {
|
|
843
|
+
return Rt.call(r, e);
|
|
1047
844
|
};
|
|
1048
|
-
function
|
|
1049
|
-
return
|
|
845
|
+
function Z(r, e) {
|
|
846
|
+
return r === e || !r && !e && r !== r && e !== e;
|
|
1050
847
|
}
|
|
1051
|
-
var
|
|
1052
|
-
function
|
|
1053
|
-
var
|
|
1054
|
-
if (e.length !==
|
|
848
|
+
var Nt = "__v", $t = "__o", Bt = "_owner", Ne = Object.getOwnPropertyDescriptor, $e = Object.keys;
|
|
849
|
+
function Dt(r, e, t) {
|
|
850
|
+
var n = r.length;
|
|
851
|
+
if (e.length !== n)
|
|
1055
852
|
return !1;
|
|
1056
|
-
for (;
|
|
1057
|
-
if (!t.equals(n
|
|
853
|
+
for (; n-- > 0; )
|
|
854
|
+
if (!t.equals(r[n], e[n], n, n, r, e, t))
|
|
1058
855
|
return !1;
|
|
1059
856
|
return !0;
|
|
1060
857
|
}
|
|
1061
|
-
function
|
|
1062
|
-
return
|
|
858
|
+
function Zt(r, e) {
|
|
859
|
+
return Z(r.getTime(), e.getTime());
|
|
1063
860
|
}
|
|
1064
|
-
function
|
|
1065
|
-
return
|
|
861
|
+
function Ut(r, e) {
|
|
862
|
+
return r.name === e.name && r.message === e.message && r.cause === e.cause && r.stack === e.stack;
|
|
1066
863
|
}
|
|
1067
|
-
function
|
|
1068
|
-
return
|
|
864
|
+
function Gt(r, e) {
|
|
865
|
+
return r === e;
|
|
1069
866
|
}
|
|
1070
|
-
function
|
|
1071
|
-
var
|
|
1072
|
-
if (
|
|
867
|
+
function Be(r, e, t) {
|
|
868
|
+
var n = r.size;
|
|
869
|
+
if (n !== e.size)
|
|
1073
870
|
return !1;
|
|
1074
|
-
if (!
|
|
871
|
+
if (!n)
|
|
1075
872
|
return !0;
|
|
1076
|
-
for (var s = new Array(
|
|
873
|
+
for (var s = new Array(n), o = r.entries(), i, l, a = 0; (i = o.next()) && !i.done; ) {
|
|
1077
874
|
for (var c = e.entries(), d = !1, u = 0; (l = c.next()) && !l.done; ) {
|
|
1078
875
|
if (s[u]) {
|
|
1079
876
|
u++;
|
|
1080
877
|
continue;
|
|
1081
878
|
}
|
|
1082
|
-
var
|
|
1083
|
-
if (t.equals(
|
|
879
|
+
var f = i.value, m = l.value;
|
|
880
|
+
if (t.equals(f[0], m[0], a, u, r, e, t) && t.equals(f[1], m[1], f[0], m[0], r, e, t)) {
|
|
1084
881
|
d = s[u] = !0;
|
|
1085
882
|
break;
|
|
1086
883
|
}
|
|
@@ -1092,40 +889,40 @@ function Fe(n, e, t) {
|
|
|
1092
889
|
}
|
|
1093
890
|
return !0;
|
|
1094
891
|
}
|
|
1095
|
-
var
|
|
1096
|
-
function
|
|
1097
|
-
var
|
|
1098
|
-
if (
|
|
892
|
+
var Vt = Z;
|
|
893
|
+
function Ft(r, e, t) {
|
|
894
|
+
var n = $e(r), s = n.length;
|
|
895
|
+
if ($e(e).length !== s)
|
|
1099
896
|
return !1;
|
|
1100
897
|
for (; s-- > 0; )
|
|
1101
|
-
if (!
|
|
898
|
+
if (!Ye(r, e, t, n[s]))
|
|
1102
899
|
return !1;
|
|
1103
900
|
return !0;
|
|
1104
901
|
}
|
|
1105
|
-
function Y(
|
|
1106
|
-
var
|
|
1107
|
-
if (
|
|
902
|
+
function Y(r, e, t) {
|
|
903
|
+
var n = je(r), s = n.length;
|
|
904
|
+
if (je(e).length !== s)
|
|
1108
905
|
return !1;
|
|
1109
906
|
for (var o, i, l; s-- > 0; )
|
|
1110
|
-
if (o =
|
|
907
|
+
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
908
|
return !1;
|
|
1112
909
|
return !0;
|
|
1113
910
|
}
|
|
1114
|
-
function
|
|
1115
|
-
return
|
|
911
|
+
function zt(r, e) {
|
|
912
|
+
return Z(r.valueOf(), e.valueOf());
|
|
1116
913
|
}
|
|
1117
|
-
function
|
|
1118
|
-
return
|
|
914
|
+
function Wt(r, e) {
|
|
915
|
+
return r.source === e.source && r.flags === e.flags;
|
|
1119
916
|
}
|
|
1120
|
-
function
|
|
1121
|
-
var
|
|
1122
|
-
if (
|
|
917
|
+
function De(r, e, t) {
|
|
918
|
+
var n = r.size;
|
|
919
|
+
if (n !== e.size)
|
|
1123
920
|
return !1;
|
|
1124
|
-
if (!
|
|
921
|
+
if (!n)
|
|
1125
922
|
return !0;
|
|
1126
|
-
for (var s = new Array(
|
|
923
|
+
for (var s = new Array(n), o = r.values(), i, l; (i = o.next()) && !i.done; ) {
|
|
1127
924
|
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,
|
|
925
|
+
if (!s[d] && t.equals(i.value, l.value, i.value, l.value, r, e, t)) {
|
|
1129
926
|
c = s[d] = !0;
|
|
1130
927
|
break;
|
|
1131
928
|
}
|
|
@@ -1136,73 +933,73 @@ function Ue(n, e, t) {
|
|
|
1136
933
|
}
|
|
1137
934
|
return !0;
|
|
1138
935
|
}
|
|
1139
|
-
function
|
|
1140
|
-
var t =
|
|
936
|
+
function Ht(r, e) {
|
|
937
|
+
var t = r.length;
|
|
1141
938
|
if (e.length !== t)
|
|
1142
939
|
return !1;
|
|
1143
940
|
for (; t-- > 0; )
|
|
1144
|
-
if (
|
|
941
|
+
if (r[t] !== e[t])
|
|
1145
942
|
return !1;
|
|
1146
943
|
return !0;
|
|
1147
944
|
}
|
|
1148
|
-
function
|
|
1149
|
-
return
|
|
945
|
+
function Kt(r, e) {
|
|
946
|
+
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
947
|
}
|
|
1151
|
-
function
|
|
1152
|
-
return (
|
|
948
|
+
function Ye(r, e, t, n) {
|
|
949
|
+
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
950
|
}
|
|
1154
|
-
var
|
|
1155
|
-
function
|
|
1156
|
-
var e =
|
|
1157
|
-
return function(
|
|
1158
|
-
if (
|
|
951
|
+
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);
|
|
952
|
+
function ur(r) {
|
|
953
|
+
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;
|
|
954
|
+
return function(h, p, g) {
|
|
955
|
+
if (h === p)
|
|
1159
956
|
return !0;
|
|
1160
|
-
if (
|
|
957
|
+
if (h == null || p == null)
|
|
1161
958
|
return !1;
|
|
1162
|
-
var v = typeof
|
|
1163
|
-
if (v !== typeof
|
|
959
|
+
var v = typeof h;
|
|
960
|
+
if (v !== typeof p)
|
|
1164
961
|
return !1;
|
|
1165
962
|
if (v !== "object")
|
|
1166
|
-
return v === "number" ? i(
|
|
1167
|
-
var
|
|
1168
|
-
if (
|
|
963
|
+
return v === "number" ? i(h, p, g) : v === "function" ? s(h, p, g) : !1;
|
|
964
|
+
var _ = h.constructor;
|
|
965
|
+
if (_ !== p.constructor)
|
|
1169
966
|
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
|
|
967
|
+
if (_ === Object)
|
|
968
|
+
return l(h, p, g);
|
|
969
|
+
if (ir(h))
|
|
970
|
+
return e(h, p, g);
|
|
971
|
+
if (Ze != null && Ze(h))
|
|
972
|
+
return u(h, p, g);
|
|
973
|
+
if (_ === Date)
|
|
974
|
+
return t(h, p, g);
|
|
975
|
+
if (_ === RegExp)
|
|
976
|
+
return c(h, p, g);
|
|
977
|
+
if (_ === Map)
|
|
978
|
+
return o(h, p, g);
|
|
979
|
+
if (_ === Set)
|
|
980
|
+
return d(h, p, g);
|
|
981
|
+
var E = lr(h);
|
|
982
|
+
return E === Xt ? t(h, p, g) : E === nr ? c(h, p, g) : E === er ? o(h, p, g) : E === sr ? d(h, p, g) : E === rr ? typeof h.then != "function" && typeof p.then != "function" && l(h, p, g) : E === ar ? f(h, p, g) : E === Qt ? n(h, p, g) : E === Yt ? l(h, p, g) : E === Jt || E === tr || E === or ? a(h, p, g) : !1;
|
|
1186
983
|
};
|
|
1187
984
|
}
|
|
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:
|
|
985
|
+
function cr(r) {
|
|
986
|
+
var e = r.circular, t = r.createCustomConfig, n = r.strict, s = {
|
|
987
|
+
areArraysEqual: n ? Y : Dt,
|
|
988
|
+
areDatesEqual: Zt,
|
|
989
|
+
areErrorsEqual: Ut,
|
|
990
|
+
areFunctionsEqual: Gt,
|
|
991
|
+
areMapsEqual: n ? Re(Be, Y) : Be,
|
|
992
|
+
areNumbersEqual: Vt,
|
|
993
|
+
areObjectsEqual: n ? Y : Ft,
|
|
994
|
+
arePrimitiveWrappersEqual: zt,
|
|
995
|
+
areRegExpsEqual: Wt,
|
|
996
|
+
areSetsEqual: n ? Re(De, Y) : De,
|
|
997
|
+
areTypedArraysEqual: n ? Y : Ht,
|
|
998
|
+
areUrlsEqual: Kt
|
|
1202
999
|
};
|
|
1203
|
-
if (t && (s =
|
|
1204
|
-
var o =
|
|
1205
|
-
s =
|
|
1000
|
+
if (t && (s = Ue({}, s, t(s))), e) {
|
|
1001
|
+
var o = ne(s.areArraysEqual), i = ne(s.areMapsEqual), l = ne(s.areObjectsEqual), a = ne(s.areSetsEqual);
|
|
1002
|
+
s = Ue({}, s, {
|
|
1206
1003
|
areArraysEqual: o,
|
|
1207
1004
|
areMapsEqual: i,
|
|
1208
1005
|
areObjectsEqual: l,
|
|
@@ -1211,18 +1008,18 @@ function lr(n) {
|
|
|
1211
1008
|
}
|
|
1212
1009
|
return s;
|
|
1213
1010
|
}
|
|
1214
|
-
function
|
|
1215
|
-
return function(e, t,
|
|
1216
|
-
return
|
|
1011
|
+
function pr(r) {
|
|
1012
|
+
return function(e, t, n, s, o, i, l) {
|
|
1013
|
+
return r(e, t, l);
|
|
1217
1014
|
};
|
|
1218
1015
|
}
|
|
1219
|
-
function
|
|
1220
|
-
var e =
|
|
1221
|
-
if (
|
|
1016
|
+
function dr(r) {
|
|
1017
|
+
var e = r.circular, t = r.comparator, n = r.createState, s = r.equals, o = r.strict;
|
|
1018
|
+
if (n)
|
|
1222
1019
|
return function(a, c) {
|
|
1223
|
-
var d =
|
|
1020
|
+
var d = n(), u = d.cache, f = u === void 0 ? e ? /* @__PURE__ */ new WeakMap() : void 0 : u, m = d.meta;
|
|
1224
1021
|
return t(a, c, {
|
|
1225
|
-
cache:
|
|
1022
|
+
cache: f,
|
|
1226
1023
|
equals: s,
|
|
1227
1024
|
meta: m,
|
|
1228
1025
|
strict: o
|
|
@@ -1247,43 +1044,43 @@ function cr(n) {
|
|
|
1247
1044
|
return t(a, c, i);
|
|
1248
1045
|
};
|
|
1249
1046
|
}
|
|
1250
|
-
var ae =
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1047
|
+
var ae = j();
|
|
1048
|
+
j({ strict: !0 });
|
|
1049
|
+
j({ circular: !0 });
|
|
1050
|
+
j({
|
|
1254
1051
|
circular: !0,
|
|
1255
1052
|
strict: !0
|
|
1256
1053
|
});
|
|
1257
|
-
|
|
1054
|
+
j({
|
|
1258
1055
|
createInternalComparator: function() {
|
|
1259
|
-
return
|
|
1056
|
+
return Z;
|
|
1260
1057
|
}
|
|
1261
1058
|
});
|
|
1262
|
-
|
|
1059
|
+
j({
|
|
1263
1060
|
strict: !0,
|
|
1264
1061
|
createInternalComparator: function() {
|
|
1265
|
-
return
|
|
1062
|
+
return Z;
|
|
1266
1063
|
}
|
|
1267
1064
|
});
|
|
1268
|
-
|
|
1065
|
+
j({
|
|
1269
1066
|
circular: !0,
|
|
1270
1067
|
createInternalComparator: function() {
|
|
1271
|
-
return
|
|
1068
|
+
return Z;
|
|
1272
1069
|
}
|
|
1273
1070
|
});
|
|
1274
|
-
|
|
1071
|
+
j({
|
|
1275
1072
|
circular: !0,
|
|
1276
1073
|
createInternalComparator: function() {
|
|
1277
|
-
return
|
|
1074
|
+
return Z;
|
|
1278
1075
|
},
|
|
1279
1076
|
strict: !0
|
|
1280
1077
|
});
|
|
1281
|
-
function
|
|
1282
|
-
|
|
1283
|
-
var e =
|
|
1284
|
-
return
|
|
1078
|
+
function j(r) {
|
|
1079
|
+
r === void 0 && (r = {});
|
|
1080
|
+
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);
|
|
1081
|
+
return dr({ circular: t, comparator: a, createState: s, equals: c, strict: i });
|
|
1285
1082
|
}
|
|
1286
|
-
const
|
|
1083
|
+
const Ge = [
|
|
1287
1084
|
Int8Array,
|
|
1288
1085
|
Uint8Array,
|
|
1289
1086
|
Uint8ClampedArray,
|
|
@@ -1293,7 +1090,7 @@ const ze = [
|
|
|
1293
1090
|
Uint32Array,
|
|
1294
1091
|
Float32Array,
|
|
1295
1092
|
Float64Array
|
|
1296
|
-
],
|
|
1093
|
+
], de = 1, J = 8;
|
|
1297
1094
|
class Ce {
|
|
1298
1095
|
/**
|
|
1299
1096
|
* Creates an index from raw `ArrayBuffer` data.
|
|
@@ -1302,13 +1099,13 @@ class Ce {
|
|
|
1302
1099
|
static from(e) {
|
|
1303
1100
|
if (!(e instanceof ArrayBuffer))
|
|
1304
1101
|
throw new Error("Data must be an instance of ArrayBuffer.");
|
|
1305
|
-
const [t,
|
|
1102
|
+
const [t, n] = new Uint8Array(e, 0, 2);
|
|
1306
1103
|
if (t !== 219)
|
|
1307
1104
|
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 =
|
|
1105
|
+
const s = n >> 4;
|
|
1106
|
+
if (s !== de)
|
|
1107
|
+
throw new Error(`Got v${s} data when expected v${de}.`);
|
|
1108
|
+
const o = Ge[n & 15];
|
|
1312
1109
|
if (!o)
|
|
1313
1110
|
throw new Error("Unrecognized array type.");
|
|
1314
1111
|
const [i] = new Uint16Array(e, 2, 1), [l] = new Uint32Array(e, 4, 1);
|
|
@@ -1321,14 +1118,14 @@ class Ce {
|
|
|
1321
1118
|
* @param {TypedArrayConstructor} [ArrayType=Float64Array] The array type used for coordinates storage (`Float64Array` by default).
|
|
1322
1119
|
* @param {ArrayBuffer} [data] (For internal use only)
|
|
1323
1120
|
*/
|
|
1324
|
-
constructor(e, t = 64,
|
|
1121
|
+
constructor(e, t = 64, n = Float64Array, s) {
|
|
1325
1122
|
if (isNaN(e) || e < 0)
|
|
1326
1123
|
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 =
|
|
1124
|
+
this.numItems = +e, this.nodeSize = Math.min(Math.max(+t, 2), 65535), this.ArrayType = n, this.IndexArrayType = e < 65536 ? Uint16Array : Uint32Array;
|
|
1125
|
+
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
1126
|
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,
|
|
1127
|
+
throw new Error(`Unexpected typed array class: ${n}.`);
|
|
1128
|
+
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
1129
|
}
|
|
1333
1130
|
/**
|
|
1334
1131
|
* Add a point to the index.
|
|
@@ -1337,8 +1134,8 @@ class Ce {
|
|
|
1337
1134
|
* @returns {number} An incremental index associated with the added item (starting from `0`).
|
|
1338
1135
|
*/
|
|
1339
1136
|
add(e, t) {
|
|
1340
|
-
const
|
|
1341
|
-
return this.ids[
|
|
1137
|
+
const n = this._pos >> 1;
|
|
1138
|
+
return this.ids[n] = n, this.coords[this._pos++] = e, this.coords[this._pos++] = t, n;
|
|
1342
1139
|
}
|
|
1343
1140
|
/**
|
|
1344
1141
|
* Perform indexing of the added points.
|
|
@@ -1347,7 +1144,7 @@ class Ce {
|
|
|
1347
1144
|
const e = this._pos >> 1;
|
|
1348
1145
|
if (e !== this.numItems)
|
|
1349
1146
|
throw new Error(`Added ${e} items when expected ${this.numItems}.`);
|
|
1350
|
-
return
|
|
1147
|
+
return ge(this.ids, this.coords, this.nodeSize, 0, this.numItems - 1, 0), this._finished = !0, this;
|
|
1351
1148
|
}
|
|
1352
1149
|
/**
|
|
1353
1150
|
* Search the index for items within a given bounding box.
|
|
@@ -1357,21 +1154,21 @@ class Ce {
|
|
|
1357
1154
|
* @param {number} maxY
|
|
1358
1155
|
* @returns {number[]} An array of indices correponding to the found items.
|
|
1359
1156
|
*/
|
|
1360
|
-
range(e, t,
|
|
1157
|
+
range(e, t, n, s) {
|
|
1361
1158
|
if (!this._finished)
|
|
1362
1159
|
throw new Error("Data not yet indexed - call index.finish().");
|
|
1363
1160
|
const { ids: o, coords: i, nodeSize: l } = this, a = [0, o.length - 1, 0], c = [];
|
|
1364
1161
|
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 <=
|
|
1162
|
+
const d = a.pop() || 0, u = a.pop() || 0, f = a.pop() || 0;
|
|
1163
|
+
if (u - f <= l) {
|
|
1164
|
+
for (let g = f; g <= u; g++) {
|
|
1165
|
+
const v = i[2 * g], _ = i[2 * g + 1];
|
|
1166
|
+
v >= e && v <= n && _ >= t && _ <= s && c.push(o[g]);
|
|
1370
1167
|
}
|
|
1371
1168
|
continue;
|
|
1372
1169
|
}
|
|
1373
|
-
const m =
|
|
1374
|
-
|
|
1170
|
+
const m = f + u >> 1, h = i[2 * m], p = i[2 * m + 1];
|
|
1171
|
+
h >= e && h <= n && p >= t && p <= s && c.push(o[m]), (d === 0 ? e <= h : t <= p) && (a.push(f), a.push(m - 1), a.push(1 - d)), (d === 0 ? n >= h : s >= p) && (a.push(m + 1), a.push(u), a.push(1 - d));
|
|
1375
1172
|
}
|
|
1376
1173
|
return c;
|
|
1377
1174
|
}
|
|
@@ -1382,58 +1179,58 @@ class Ce {
|
|
|
1382
1179
|
* @param {number} r Query radius.
|
|
1383
1180
|
* @returns {number[]} An array of indices correponding to the found items.
|
|
1384
1181
|
*/
|
|
1385
|
-
within(e, t,
|
|
1182
|
+
within(e, t, n) {
|
|
1386
1183
|
if (!this._finished)
|
|
1387
1184
|
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 =
|
|
1185
|
+
const { ids: s, coords: o, nodeSize: i } = this, l = [0, s.length - 1, 0], a = [], c = n * n;
|
|
1389
1186
|
for (; l.length; ) {
|
|
1390
|
-
const d = l.pop() || 0, u = l.pop() || 0,
|
|
1391
|
-
if (u -
|
|
1392
|
-
for (let g =
|
|
1393
|
-
|
|
1187
|
+
const d = l.pop() || 0, u = l.pop() || 0, f = l.pop() || 0;
|
|
1188
|
+
if (u - f <= i) {
|
|
1189
|
+
for (let g = f; g <= u; g++)
|
|
1190
|
+
Ve(o[2 * g], o[2 * g + 1], e, t) <= c && a.push(s[g]);
|
|
1394
1191
|
continue;
|
|
1395
1192
|
}
|
|
1396
|
-
const m =
|
|
1397
|
-
|
|
1193
|
+
const m = f + u >> 1, h = o[2 * m], p = o[2 * m + 1];
|
|
1194
|
+
Ve(h, p, e, t) <= c && a.push(s[m]), (d === 0 ? e - n <= h : t - n <= p) && (l.push(f), l.push(m - 1), l.push(1 - d)), (d === 0 ? e + n >= h : t + n >= p) && (l.push(m + 1), l.push(u), l.push(1 - d));
|
|
1398
1195
|
}
|
|
1399
1196
|
return a;
|
|
1400
1197
|
}
|
|
1401
1198
|
}
|
|
1402
|
-
function
|
|
1403
|
-
if (s -
|
|
1199
|
+
function ge(r, e, t, n, s, o) {
|
|
1200
|
+
if (s - n <= t)
|
|
1404
1201
|
return;
|
|
1405
|
-
const i =
|
|
1406
|
-
|
|
1202
|
+
const i = n + s >> 1;
|
|
1203
|
+
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
1204
|
}
|
|
1408
|
-
function
|
|
1409
|
-
for (; s >
|
|
1410
|
-
if (s -
|
|
1411
|
-
const c = s -
|
|
1412
|
-
|
|
1205
|
+
function Je(r, e, t, n, s, o) {
|
|
1206
|
+
for (; s > n; ) {
|
|
1207
|
+
if (s - n > 600) {
|
|
1208
|
+
const c = s - n + 1, d = t - n + 1, u = Math.log(c), f = 0.5 * Math.exp(2 * u / 3), m = 0.5 * Math.sqrt(u * f * (c - f) / c) * (d - c / 2 < 0 ? -1 : 1), h = Math.max(n, Math.floor(t - d * f / c + m)), p = Math.min(s, Math.floor(t + (c - d) * f / c + m));
|
|
1209
|
+
Je(r, e, t, h, p, o);
|
|
1413
1210
|
}
|
|
1414
1211
|
const i = e[2 * t + o];
|
|
1415
|
-
let l =
|
|
1416
|
-
for (
|
|
1417
|
-
for (
|
|
1212
|
+
let l = n, a = s;
|
|
1213
|
+
for (X(r, e, n, t), e[2 * s + o] > i && X(r, e, n, s); l < a; ) {
|
|
1214
|
+
for (X(r, e, l, a), l++, a--; e[2 * l + o] < i; )
|
|
1418
1215
|
l++;
|
|
1419
1216
|
for (; e[2 * a + o] > i; )
|
|
1420
1217
|
a--;
|
|
1421
1218
|
}
|
|
1422
|
-
e[2 *
|
|
1219
|
+
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
1220
|
}
|
|
1424
1221
|
}
|
|
1425
|
-
function
|
|
1426
|
-
|
|
1222
|
+
function X(r, e, t, n) {
|
|
1223
|
+
fe(r, t, n), fe(e, 2 * t, 2 * n), fe(e, 2 * t + 1, 2 * n + 1);
|
|
1427
1224
|
}
|
|
1428
|
-
function
|
|
1429
|
-
const
|
|
1430
|
-
|
|
1225
|
+
function fe(r, e, t) {
|
|
1226
|
+
const n = r[e];
|
|
1227
|
+
r[e] = r[t], r[t] = n;
|
|
1431
1228
|
}
|
|
1432
|
-
function
|
|
1433
|
-
const s =
|
|
1229
|
+
function Ve(r, e, t, n) {
|
|
1230
|
+
const s = r - t, o = e - n;
|
|
1434
1231
|
return s * s + o * o;
|
|
1435
1232
|
}
|
|
1436
|
-
const
|
|
1233
|
+
const fr = {
|
|
1437
1234
|
minZoom: 0,
|
|
1438
1235
|
// min zoom to generate clusters on
|
|
1439
1236
|
maxZoom: 16,
|
|
@@ -1454,15 +1251,15 @@ const dr = {
|
|
|
1454
1251
|
reduce: null,
|
|
1455
1252
|
// (accumulated, props) => { accumulated.sum += props.sum; }
|
|
1456
1253
|
// properties to use for individual points when running the reducer
|
|
1457
|
-
map: (
|
|
1254
|
+
map: (r) => r
|
|
1458
1255
|
// props => ({sum: props.my_value})
|
|
1459
|
-
},
|
|
1460
|
-
class
|
|
1256
|
+
}, Fe = Math.fround || ((r) => (e) => (r[0] = +e, r[0]))(new Float32Array(1)), N = 2, x = 3, he = 4, L = 5, Xe = 6;
|
|
1257
|
+
class Qe {
|
|
1461
1258
|
constructor(e) {
|
|
1462
|
-
this.options = Object.assign(Object.create(
|
|
1259
|
+
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
1260
|
}
|
|
1464
1261
|
load(e) {
|
|
1465
|
-
const { log: t, minZoom:
|
|
1262
|
+
const { log: t, minZoom: n, maxZoom: s } = this.options;
|
|
1466
1263
|
t && console.time("total time");
|
|
1467
1264
|
const o = `prepare ${e.length} points`;
|
|
1468
1265
|
t && console.time(o), this.points = e;
|
|
@@ -1471,9 +1268,9 @@ class rt {
|
|
|
1471
1268
|
const c = e[a];
|
|
1472
1269
|
if (!c.geometry)
|
|
1473
1270
|
continue;
|
|
1474
|
-
const [d, u] = c.geometry.coordinates,
|
|
1271
|
+
const [d, u] = c.geometry.coordinates, f = Fe(se(d)), m = Fe(oe(u));
|
|
1475
1272
|
i.push(
|
|
1476
|
-
|
|
1273
|
+
f,
|
|
1477
1274
|
m,
|
|
1478
1275
|
// projected point coordinates
|
|
1479
1276
|
1 / 0,
|
|
@@ -1488,74 +1285,74 @@ class rt {
|
|
|
1488
1285
|
}
|
|
1489
1286
|
let l = this.trees[s + 1] = this._createTree(i);
|
|
1490
1287
|
t && console.timeEnd(o);
|
|
1491
|
-
for (let a = s; a >=
|
|
1288
|
+
for (let a = s; a >= n; a--) {
|
|
1492
1289
|
const c = +Date.now();
|
|
1493
1290
|
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
1291
|
}
|
|
1495
1292
|
return t && console.timeEnd("total time"), this;
|
|
1496
1293
|
}
|
|
1497
1294
|
getClusters(e, t) {
|
|
1498
|
-
let
|
|
1295
|
+
let n = ((e[0] + 180) % 360 + 360) % 360 - 180;
|
|
1499
1296
|
const s = Math.max(-90, Math.min(90, e[1]));
|
|
1500
1297
|
let o = e[2] === 180 ? 180 : ((e[2] + 180) % 360 + 360) % 360 - 180;
|
|
1501
1298
|
const i = Math.max(-90, Math.min(90, e[3]));
|
|
1502
1299
|
if (e[2] - e[0] >= 360)
|
|
1503
|
-
|
|
1504
|
-
else if (
|
|
1505
|
-
const u = this.getClusters([
|
|
1506
|
-
return u.concat(
|
|
1300
|
+
n = -180, o = 180;
|
|
1301
|
+
else if (n > o) {
|
|
1302
|
+
const u = this.getClusters([n, s, 180, i], t), f = this.getClusters([-180, s, o, i], t);
|
|
1303
|
+
return u.concat(f);
|
|
1507
1304
|
}
|
|
1508
|
-
const l = this.trees[this._limitZoom(t)], a = l.range(
|
|
1305
|
+
const l = this.trees[this._limitZoom(t)], a = l.range(se(n), oe(i), se(o), oe(s)), c = l.data, d = [];
|
|
1509
1306
|
for (const u of a) {
|
|
1510
|
-
const
|
|
1511
|
-
d.push(c[
|
|
1307
|
+
const f = this.stride * u;
|
|
1308
|
+
d.push(c[f + L] > 1 ? ze(c, f, this.clusterProps) : this.points[c[f + x]]);
|
|
1512
1309
|
}
|
|
1513
1310
|
return d;
|
|
1514
1311
|
}
|
|
1515
1312
|
getChildren(e) {
|
|
1516
|
-
const t = this._getOriginId(e),
|
|
1313
|
+
const t = this._getOriginId(e), n = this._getOriginZoom(e), s = "No cluster with the specified id.", o = this.trees[n];
|
|
1517
1314
|
if (!o)
|
|
1518
1315
|
throw new Error(s);
|
|
1519
1316
|
const i = o.data;
|
|
1520
1317
|
if (t * this.stride >= i.length)
|
|
1521
1318
|
throw new Error(s);
|
|
1522
|
-
const l = this.options.radius / (this.options.extent * Math.pow(2,
|
|
1523
|
-
for (const
|
|
1524
|
-
const m =
|
|
1525
|
-
i[m +
|
|
1319
|
+
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 = [];
|
|
1320
|
+
for (const f of d) {
|
|
1321
|
+
const m = f * this.stride;
|
|
1322
|
+
i[m + he] === e && u.push(i[m + L] > 1 ? ze(i, m, this.clusterProps) : this.points[i[m + x]]);
|
|
1526
1323
|
}
|
|
1527
1324
|
if (u.length === 0)
|
|
1528
1325
|
throw new Error(s);
|
|
1529
1326
|
return u;
|
|
1530
1327
|
}
|
|
1531
|
-
getLeaves(e, t,
|
|
1532
|
-
t = t || 10,
|
|
1328
|
+
getLeaves(e, t, n) {
|
|
1329
|
+
t = t || 10, n = n || 0;
|
|
1533
1330
|
const s = [];
|
|
1534
|
-
return this._appendLeaves(s, e, t,
|
|
1331
|
+
return this._appendLeaves(s, e, t, n, 0), s;
|
|
1535
1332
|
}
|
|
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 = (
|
|
1333
|
+
getTile(e, t, n) {
|
|
1334
|
+
const s = this.trees[this._limitZoom(e)], o = Math.pow(2, e), { extent: i, radius: l } = this.options, a = l / i, c = (n - a) / o, d = (n + 1 + a) / o, u = {
|
|
1538
1335
|
features: []
|
|
1539
1336
|
};
|
|
1540
1337
|
return this._addTileFeatures(
|
|
1541
1338
|
s.range((t - a) / o, c, (t + 1 + a) / o, d),
|
|
1542
1339
|
s.data,
|
|
1543
1340
|
t,
|
|
1544
|
-
|
|
1341
|
+
n,
|
|
1545
1342
|
o,
|
|
1546
1343
|
u
|
|
1547
1344
|
), t === 0 && this._addTileFeatures(
|
|
1548
1345
|
s.range(1 - a / o, c, 1, d),
|
|
1549
1346
|
s.data,
|
|
1550
1347
|
o,
|
|
1551
|
-
|
|
1348
|
+
n,
|
|
1552
1349
|
o,
|
|
1553
1350
|
u
|
|
1554
1351
|
), t === o - 1 && this._addTileFeatures(
|
|
1555
1352
|
s.range(0, c, a / o, d),
|
|
1556
1353
|
s.data,
|
|
1557
1354
|
-1,
|
|
1558
|
-
|
|
1355
|
+
n,
|
|
1559
1356
|
o,
|
|
1560
1357
|
u
|
|
1561
1358
|
), u.features.length ? u : null;
|
|
@@ -1563,89 +1360,89 @@ class rt {
|
|
|
1563
1360
|
getClusterExpansionZoom(e) {
|
|
1564
1361
|
let t = this._getOriginZoom(e) - 1;
|
|
1565
1362
|
for (; t <= this.options.maxZoom; ) {
|
|
1566
|
-
const
|
|
1567
|
-
if (t++,
|
|
1363
|
+
const n = this.getChildren(e);
|
|
1364
|
+
if (t++, n.length !== 1)
|
|
1568
1365
|
break;
|
|
1569
|
-
e =
|
|
1366
|
+
e = n[0].properties.cluster_id;
|
|
1570
1367
|
}
|
|
1571
1368
|
return t;
|
|
1572
1369
|
}
|
|
1573
|
-
_appendLeaves(e, t,
|
|
1370
|
+
_appendLeaves(e, t, n, s, o) {
|
|
1574
1371
|
const i = this.getChildren(t);
|
|
1575
1372
|
for (const l of i) {
|
|
1576
1373
|
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,
|
|
1374
|
+
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
1375
|
break;
|
|
1579
1376
|
}
|
|
1580
1377
|
return o;
|
|
1581
1378
|
}
|
|
1582
1379
|
_createTree(e) {
|
|
1583
1380
|
const t = new Ce(e.length / this.stride | 0, this.options.nodeSize, Float32Array);
|
|
1584
|
-
for (let
|
|
1585
|
-
t.add(e[
|
|
1381
|
+
for (let n = 0; n < e.length; n += this.stride)
|
|
1382
|
+
t.add(e[n], e[n + 1]);
|
|
1586
1383
|
return t.finish(), t.data = e, t;
|
|
1587
1384
|
}
|
|
1588
|
-
_addTileFeatures(e, t,
|
|
1385
|
+
_addTileFeatures(e, t, n, s, o, i) {
|
|
1589
1386
|
for (const l of e) {
|
|
1590
1387
|
const a = l * this.stride, c = t[a + L] > 1;
|
|
1591
|
-
let d, u,
|
|
1388
|
+
let d, u, f;
|
|
1592
1389
|
if (c)
|
|
1593
|
-
d =
|
|
1390
|
+
d = et(t, a, this.clusterProps), u = t[a], f = t[a + 1];
|
|
1594
1391
|
else {
|
|
1595
|
-
const
|
|
1596
|
-
d =
|
|
1597
|
-
const [g, v] =
|
|
1598
|
-
u =
|
|
1392
|
+
const p = this.points[t[a + x]];
|
|
1393
|
+
d = p.properties;
|
|
1394
|
+
const [g, v] = p.geometry.coordinates;
|
|
1395
|
+
u = se(g), f = oe(v);
|
|
1599
1396
|
}
|
|
1600
1397
|
const m = {
|
|
1601
1398
|
type: 1,
|
|
1602
1399
|
geometry: [[
|
|
1603
|
-
Math.round(this.options.extent * (u * o -
|
|
1604
|
-
Math.round(this.options.extent * (
|
|
1400
|
+
Math.round(this.options.extent * (u * o - n)),
|
|
1401
|
+
Math.round(this.options.extent * (f * o - s))
|
|
1605
1402
|
]],
|
|
1606
1403
|
tags: d
|
|
1607
1404
|
};
|
|
1608
|
-
let
|
|
1609
|
-
c || this.options.generateId ?
|
|
1405
|
+
let h;
|
|
1406
|
+
c || this.options.generateId ? h = t[a + x] : h = this.points[t[a + x]].id, h !== void 0 && (m.id = h), i.features.push(m);
|
|
1610
1407
|
}
|
|
1611
1408
|
}
|
|
1612
1409
|
_limitZoom(e) {
|
|
1613
1410
|
return Math.max(this.options.minZoom, Math.min(Math.floor(+e), this.options.maxZoom + 1));
|
|
1614
1411
|
}
|
|
1615
1412
|
_cluster(e, t) {
|
|
1616
|
-
const { radius:
|
|
1413
|
+
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
1414
|
for (let u = 0; u < a.length; u += d) {
|
|
1618
|
-
if (a[u +
|
|
1415
|
+
if (a[u + N] <= t)
|
|
1619
1416
|
continue;
|
|
1620
|
-
a[u +
|
|
1621
|
-
const
|
|
1622
|
-
let g =
|
|
1623
|
-
for (const v of
|
|
1624
|
-
const
|
|
1625
|
-
a[
|
|
1417
|
+
a[u + N] = t;
|
|
1418
|
+
const f = a[u], m = a[u + 1], h = e.within(a[u], a[u + 1], l), p = a[u + L];
|
|
1419
|
+
let g = p;
|
|
1420
|
+
for (const v of h) {
|
|
1421
|
+
const _ = v * d;
|
|
1422
|
+
a[_ + N] > t && (g += a[_ + L]);
|
|
1626
1423
|
}
|
|
1627
|
-
if (g >
|
|
1628
|
-
let v =
|
|
1629
|
-
const
|
|
1630
|
-
for (const b of
|
|
1424
|
+
if (g > p && g >= i) {
|
|
1425
|
+
let v = f * p, _ = m * p, E, q = -1;
|
|
1426
|
+
const P = ((u / d | 0) << 5) + (t + 1) + this.points.length;
|
|
1427
|
+
for (const b of h) {
|
|
1631
1428
|
const C = b * d;
|
|
1632
|
-
if (a[C +
|
|
1429
|
+
if (a[C + N] <= t)
|
|
1633
1430
|
continue;
|
|
1634
|
-
a[C +
|
|
1431
|
+
a[C + N] = t;
|
|
1635
1432
|
const T = a[C + L];
|
|
1636
|
-
v += a[C] * T,
|
|
1433
|
+
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
1434
|
}
|
|
1638
|
-
a[u +
|
|
1435
|
+
a[u + he] = P, c.push(v / g, _ / g, 1 / 0, P, -1, g), o && c.push(q);
|
|
1639
1436
|
} else {
|
|
1640
1437
|
for (let v = 0; v < d; v++)
|
|
1641
1438
|
c.push(a[u + v]);
|
|
1642
1439
|
if (g > 1)
|
|
1643
|
-
for (const v of
|
|
1644
|
-
const
|
|
1645
|
-
if (!(a[
|
|
1646
|
-
a[
|
|
1647
|
-
for (let
|
|
1648
|
-
c.push(a[
|
|
1440
|
+
for (const v of h) {
|
|
1441
|
+
const _ = v * d;
|
|
1442
|
+
if (!(a[_ + N] <= t)) {
|
|
1443
|
+
a[_ + N] = t;
|
|
1444
|
+
for (let E = 0; E < d; E++)
|
|
1445
|
+
c.push(a[_ + E]);
|
|
1649
1446
|
}
|
|
1650
1447
|
}
|
|
1651
1448
|
}
|
|
@@ -1660,59 +1457,59 @@ class rt {
|
|
|
1660
1457
|
_getOriginZoom(e) {
|
|
1661
1458
|
return (e - this.points.length) % 32;
|
|
1662
1459
|
}
|
|
1663
|
-
_map(e, t,
|
|
1460
|
+
_map(e, t, n) {
|
|
1664
1461
|
if (e[t + L] > 1) {
|
|
1665
|
-
const i = this.clusterProps[e[t +
|
|
1666
|
-
return
|
|
1462
|
+
const i = this.clusterProps[e[t + Xe]];
|
|
1463
|
+
return n ? Object.assign({}, i) : i;
|
|
1667
1464
|
}
|
|
1668
1465
|
const s = this.points[e[t + x]].properties, o = this.options.map(s);
|
|
1669
|
-
return
|
|
1466
|
+
return n && o === s ? Object.assign({}, o) : o;
|
|
1670
1467
|
}
|
|
1671
1468
|
}
|
|
1672
|
-
function
|
|
1469
|
+
function ze(r, e, t) {
|
|
1673
1470
|
return {
|
|
1674
1471
|
type: "Feature",
|
|
1675
|
-
id:
|
|
1676
|
-
properties:
|
|
1472
|
+
id: r[e + x],
|
|
1473
|
+
properties: et(r, e, t),
|
|
1677
1474
|
geometry: {
|
|
1678
1475
|
type: "Point",
|
|
1679
|
-
coordinates: [
|
|
1476
|
+
coordinates: [hr(r[e]), mr(r[e + 1])]
|
|
1680
1477
|
}
|
|
1681
1478
|
};
|
|
1682
1479
|
}
|
|
1683
|
-
function
|
|
1684
|
-
const
|
|
1480
|
+
function et(r, e, t) {
|
|
1481
|
+
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
1482
|
return Object.assign(i, {
|
|
1686
1483
|
cluster: !0,
|
|
1687
|
-
cluster_id:
|
|
1688
|
-
point_count:
|
|
1484
|
+
cluster_id: r[e + x],
|
|
1485
|
+
point_count: n,
|
|
1689
1486
|
point_count_abbreviated: s
|
|
1690
1487
|
});
|
|
1691
1488
|
}
|
|
1692
|
-
function
|
|
1693
|
-
return
|
|
1489
|
+
function se(r) {
|
|
1490
|
+
return r / 360 + 0.5;
|
|
1694
1491
|
}
|
|
1695
|
-
function
|
|
1696
|
-
const e = Math.sin(
|
|
1492
|
+
function oe(r) {
|
|
1493
|
+
const e = Math.sin(r * Math.PI / 180), t = 0.5 - 0.25 * Math.log((1 + e) / (1 - e)) / Math.PI;
|
|
1697
1494
|
return t < 0 ? 0 : t > 1 ? 1 : t;
|
|
1698
1495
|
}
|
|
1699
|
-
function
|
|
1700
|
-
return (
|
|
1496
|
+
function hr(r) {
|
|
1497
|
+
return (r - 0.5) * 360;
|
|
1701
1498
|
}
|
|
1702
|
-
function
|
|
1703
|
-
const e = (180 -
|
|
1499
|
+
function mr(r) {
|
|
1500
|
+
const e = (180 - r * 360) * Math.PI / 180;
|
|
1704
1501
|
return 360 * Math.atan(Math.exp(e)) / Math.PI - 90;
|
|
1705
1502
|
}
|
|
1706
|
-
function Oe(
|
|
1503
|
+
function Oe(r, e) {
|
|
1707
1504
|
var t = {};
|
|
1708
|
-
for (var
|
|
1709
|
-
Object.prototype.hasOwnProperty.call(
|
|
1710
|
-
if (
|
|
1711
|
-
for (var s = 0,
|
|
1712
|
-
e.indexOf(
|
|
1505
|
+
for (var n in r)
|
|
1506
|
+
Object.prototype.hasOwnProperty.call(r, n) && e.indexOf(n) < 0 && (t[n] = r[n]);
|
|
1507
|
+
if (r != null && typeof Object.getOwnPropertySymbols == "function")
|
|
1508
|
+
for (var s = 0, n = Object.getOwnPropertySymbols(r); s < n.length; s++)
|
|
1509
|
+
e.indexOf(n[s]) < 0 && Object.prototype.propertyIsEnumerable.call(r, n[s]) && (t[n[s]] = r[n[s]]);
|
|
1713
1510
|
return t;
|
|
1714
1511
|
}
|
|
1715
|
-
class
|
|
1512
|
+
class w {
|
|
1716
1513
|
static isAdvancedMarkerAvailable(e) {
|
|
1717
1514
|
return google.maps.marker && e.getMapCapabilities().isAdvancedMarkersAvailable === !0;
|
|
1718
1515
|
}
|
|
@@ -1738,7 +1535,7 @@ class _ {
|
|
|
1738
1535
|
return this.isAdvancedMarker(e) ? !0 : e.getVisible();
|
|
1739
1536
|
}
|
|
1740
1537
|
}
|
|
1741
|
-
class
|
|
1538
|
+
class ee {
|
|
1742
1539
|
constructor({ markers: e, position: t }) {
|
|
1743
1540
|
this.markers = [], e && (this.markers = e), t && (t instanceof google.maps.LatLng ? this._position = t : this._position = new google.maps.LatLng(t));
|
|
1744
1541
|
}
|
|
@@ -1747,7 +1544,7 @@ class te {
|
|
|
1747
1544
|
return;
|
|
1748
1545
|
const e = new google.maps.LatLngBounds(this._position, this._position);
|
|
1749
1546
|
for (const t of this.markers)
|
|
1750
|
-
e.extend(
|
|
1547
|
+
e.extend(w.getPosition(t));
|
|
1751
1548
|
return e;
|
|
1752
1549
|
}
|
|
1753
1550
|
get position() {
|
|
@@ -1757,7 +1554,7 @@ class te {
|
|
|
1757
1554
|
* Get the count of **visible** markers.
|
|
1758
1555
|
*/
|
|
1759
1556
|
get count() {
|
|
1760
|
-
return this.markers.filter((e) =>
|
|
1557
|
+
return this.markers.filter((e) => w.getVisible(e)).length;
|
|
1761
1558
|
}
|
|
1762
1559
|
/**
|
|
1763
1560
|
* Add a marker to the cluster.
|
|
@@ -1769,32 +1566,32 @@ class te {
|
|
|
1769
1566
|
* Cleanup references and remove marker from map.
|
|
1770
1567
|
*/
|
|
1771
1568
|
delete() {
|
|
1772
|
-
this.marker && (
|
|
1569
|
+
this.marker && (w.setMap(this.marker, null), this.marker = void 0), this.markers.length = 0;
|
|
1773
1570
|
}
|
|
1774
1571
|
}
|
|
1775
|
-
function A(
|
|
1776
|
-
if (
|
|
1572
|
+
function A(r, e = "assertion failed") {
|
|
1573
|
+
if (r == null)
|
|
1777
1574
|
throw Error(e);
|
|
1778
1575
|
}
|
|
1779
|
-
const
|
|
1780
|
-
const s =
|
|
1576
|
+
const gr = (r, e, t, n) => {
|
|
1577
|
+
const s = r.getBounds();
|
|
1781
1578
|
A(s);
|
|
1782
|
-
const o =
|
|
1783
|
-
return t.filter((i) => o.contains(
|
|
1784
|
-
},
|
|
1785
|
-
const { northEast:
|
|
1786
|
-
return
|
|
1787
|
-
},
|
|
1788
|
-
const
|
|
1579
|
+
const o = tt(s, e, n);
|
|
1580
|
+
return t.filter((i) => o.contains(w.getPosition(i)));
|
|
1581
|
+
}, tt = (r, e, t) => {
|
|
1582
|
+
const { northEast: n, southWest: s } = yr(r, e), o = _r({ northEast: n, southWest: s }, t);
|
|
1583
|
+
return Er(o, e);
|
|
1584
|
+
}, vr = (r, e, t) => {
|
|
1585
|
+
const n = tt(r, e, t), s = n.getNorthEast(), o = n.getSouthWest();
|
|
1789
1586
|
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(
|
|
1587
|
+
}, yr = (r, e) => {
|
|
1588
|
+
const t = e.fromLatLngToDivPixel(r.getNorthEast()), n = e.fromLatLngToDivPixel(r.getSouthWest());
|
|
1589
|
+
return A(t), A(n), { northEast: t, southWest: n };
|
|
1590
|
+
}, _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) => {
|
|
1591
|
+
const n = t.fromDivPixelToLatLng(e), s = t.fromDivPixelToLatLng(r);
|
|
1592
|
+
return new google.maps.LatLngBounds(n, s);
|
|
1796
1593
|
};
|
|
1797
|
-
class
|
|
1594
|
+
class rt {
|
|
1798
1595
|
constructor({ maxZoom: e = 16 }) {
|
|
1799
1596
|
this.maxZoom = e;
|
|
1800
1597
|
}
|
|
@@ -1811,15 +1608,15 @@ class ot {
|
|
|
1811
1608
|
* ```
|
|
1812
1609
|
*/
|
|
1813
1610
|
noop({ markers: e }) {
|
|
1814
|
-
return
|
|
1611
|
+
return kr(e);
|
|
1815
1612
|
}
|
|
1816
1613
|
}
|
|
1817
|
-
class wr extends
|
|
1614
|
+
class wr extends rt {
|
|
1818
1615
|
constructor(e) {
|
|
1819
|
-
var { viewportPadding: t = 60 } = e,
|
|
1820
|
-
super(
|
|
1616
|
+
var { viewportPadding: t = 60 } = e, n = Oe(e, ["viewportPadding"]);
|
|
1617
|
+
super(n), this.viewportPadding = 60, this.viewportPadding = t;
|
|
1821
1618
|
}
|
|
1822
|
-
calculate({ markers: e, map: t, mapCanvasProjection:
|
|
1619
|
+
calculate({ markers: e, map: t, mapCanvasProjection: n }) {
|
|
1823
1620
|
const s = t.getZoom();
|
|
1824
1621
|
return A(s), s >= this.maxZoom ? {
|
|
1825
1622
|
clusters: this.noop({
|
|
@@ -1828,30 +1625,30 @@ class wr extends ot {
|
|
|
1828
1625
|
changed: !1
|
|
1829
1626
|
} : {
|
|
1830
1627
|
clusters: this.cluster({
|
|
1831
|
-
markers:
|
|
1628
|
+
markers: gr(t, n, e, this.viewportPadding),
|
|
1832
1629
|
map: t,
|
|
1833
|
-
mapCanvasProjection:
|
|
1630
|
+
mapCanvasProjection: n
|
|
1834
1631
|
})
|
|
1835
1632
|
};
|
|
1836
1633
|
}
|
|
1837
1634
|
}
|
|
1838
|
-
const
|
|
1839
|
-
position:
|
|
1635
|
+
const kr = (r) => r.map((t) => new ee({
|
|
1636
|
+
position: w.getPosition(t),
|
|
1840
1637
|
markers: [t]
|
|
1841
1638
|
}));
|
|
1842
|
-
class
|
|
1639
|
+
class Cr extends rt {
|
|
1843
1640
|
constructor(e) {
|
|
1844
|
-
var { maxZoom: t, radius:
|
|
1845
|
-
super({ maxZoom: t }), this.markers = [], this.clusters = [], this.state = { zoom: -1 }, this.superCluster = new
|
|
1641
|
+
var { maxZoom: t, radius: n = 60 } = e, s = Oe(e, ["maxZoom", "radius"]);
|
|
1642
|
+
super({ maxZoom: t }), this.markers = [], this.clusters = [], this.state = { zoom: -1 }, this.superCluster = new Qe(Object.assign({ maxZoom: this.maxZoom, radius: n }, s));
|
|
1846
1643
|
}
|
|
1847
1644
|
calculate(e) {
|
|
1848
|
-
let t = !1,
|
|
1849
|
-
A(
|
|
1850
|
-
const s = { zoom:
|
|
1645
|
+
let t = !1, n = e.map.getZoom();
|
|
1646
|
+
A(n), n = Math.round(n);
|
|
1647
|
+
const s = { zoom: n };
|
|
1851
1648
|
if (!ae(e.markers, this.markers)) {
|
|
1852
1649
|
t = !0, this.markers = [...e.markers];
|
|
1853
1650
|
const o = this.markers.map((i) => {
|
|
1854
|
-
const l =
|
|
1651
|
+
const l = w.getPosition(i);
|
|
1855
1652
|
return {
|
|
1856
1653
|
type: "Feature",
|
|
1857
1654
|
geometry: { type: "Point", coordinates: [l.lng(), l.lat()] },
|
|
@@ -1864,33 +1661,33 @@ class _r extends ot {
|
|
|
1864
1661
|
}
|
|
1865
1662
|
cluster({ map: e }) {
|
|
1866
1663
|
const t = e.getZoom();
|
|
1867
|
-
return A(t), this.superCluster.getClusters([-180, -90, 180, 90], Math.round(t)).map((
|
|
1664
|
+
return A(t), this.superCluster.getClusters([-180, -90, 180, 90], Math.round(t)).map((n) => this.transformCluster(n));
|
|
1868
1665
|
}
|
|
1869
|
-
transformCluster({ geometry: { coordinates: [e, t] }, properties:
|
|
1870
|
-
if (
|
|
1871
|
-
return new
|
|
1872
|
-
markers: this.superCluster.getLeaves(
|
|
1666
|
+
transformCluster({ geometry: { coordinates: [e, t] }, properties: n }) {
|
|
1667
|
+
if (n.cluster)
|
|
1668
|
+
return new ee({
|
|
1669
|
+
markers: this.superCluster.getLeaves(n.cluster_id, 1 / 0).map((o) => o.properties.marker),
|
|
1873
1670
|
position: { lat: t, lng: e }
|
|
1874
1671
|
});
|
|
1875
|
-
const s =
|
|
1876
|
-
return new
|
|
1672
|
+
const s = n.marker;
|
|
1673
|
+
return new ee({
|
|
1877
1674
|
markers: [s],
|
|
1878
|
-
position:
|
|
1675
|
+
position: w.getPosition(s)
|
|
1879
1676
|
});
|
|
1880
1677
|
}
|
|
1881
1678
|
}
|
|
1882
|
-
class
|
|
1679
|
+
class Or extends wr {
|
|
1883
1680
|
constructor(e) {
|
|
1884
|
-
var { maxZoom: t, radius:
|
|
1885
|
-
super({ maxZoom: t, viewportPadding: s }), this.markers = [], this.clusters = [], this.superCluster = new
|
|
1681
|
+
var { maxZoom: t, radius: n = 60, viewportPadding: s = 60 } = e, o = Oe(e, ["maxZoom", "radius", "viewportPadding"]);
|
|
1682
|
+
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
1683
|
}
|
|
1887
1684
|
calculate(e) {
|
|
1888
1685
|
const t = this.getViewportState(e);
|
|
1889
|
-
let
|
|
1686
|
+
let n = !ae(this.state, t);
|
|
1890
1687
|
if (!ae(e.markers, this.markers)) {
|
|
1891
|
-
|
|
1688
|
+
n = !0, this.markers = [...e.markers];
|
|
1892
1689
|
const s = this.markers.map((o) => {
|
|
1893
|
-
const i =
|
|
1690
|
+
const i = w.getPosition(o);
|
|
1894
1691
|
return {
|
|
1895
1692
|
type: "Feature",
|
|
1896
1693
|
geometry: {
|
|
@@ -1902,48 +1699,48 @@ class kr extends wr {
|
|
|
1902
1699
|
});
|
|
1903
1700
|
this.superCluster.load(s);
|
|
1904
1701
|
}
|
|
1905
|
-
return
|
|
1702
|
+
return n && (this.clusters = this.cluster(e), this.state = t), { clusters: this.clusters, changed: n };
|
|
1906
1703
|
}
|
|
1907
1704
|
cluster(e) {
|
|
1908
1705
|
const t = this.getViewportState(e);
|
|
1909
|
-
return this.superCluster.getClusters(t.view, t.zoom).map((
|
|
1706
|
+
return this.superCluster.getClusters(t.view, t.zoom).map((n) => this.transformCluster(n));
|
|
1910
1707
|
}
|
|
1911
|
-
transformCluster({ geometry: { coordinates: [e, t] }, properties:
|
|
1912
|
-
if (
|
|
1913
|
-
return new
|
|
1914
|
-
markers: this.superCluster.getLeaves(
|
|
1708
|
+
transformCluster({ geometry: { coordinates: [e, t] }, properties: n }) {
|
|
1709
|
+
if (n.cluster)
|
|
1710
|
+
return new ee({
|
|
1711
|
+
markers: this.superCluster.getLeaves(n.cluster_id, 1 / 0).map((o) => o.properties.marker),
|
|
1915
1712
|
position: { lat: t, lng: e }
|
|
1916
1713
|
});
|
|
1917
|
-
const s =
|
|
1918
|
-
return new
|
|
1714
|
+
const s = n.marker;
|
|
1715
|
+
return new ee({
|
|
1919
1716
|
markers: [s],
|
|
1920
|
-
position:
|
|
1717
|
+
position: w.getPosition(s)
|
|
1921
1718
|
});
|
|
1922
1719
|
}
|
|
1923
1720
|
getViewportState(e) {
|
|
1924
|
-
const t = e.map.getZoom(),
|
|
1925
|
-
return A(t), A(
|
|
1721
|
+
const t = e.map.getZoom(), n = e.map.getBounds();
|
|
1722
|
+
return A(t), A(n), {
|
|
1926
1723
|
zoom: Math.round(t),
|
|
1927
|
-
view:
|
|
1724
|
+
view: vr(n, e.mapCanvasProjection, this.viewportPadding)
|
|
1928
1725
|
};
|
|
1929
1726
|
}
|
|
1930
1727
|
}
|
|
1931
|
-
class
|
|
1728
|
+
class Mr {
|
|
1932
1729
|
constructor(e, t) {
|
|
1933
1730
|
this.markers = { sum: e.length };
|
|
1934
|
-
const
|
|
1731
|
+
const n = t.map((o) => o.count), s = n.reduce((o, i) => o + i, 0);
|
|
1935
1732
|
this.clusters = {
|
|
1936
1733
|
count: t.length,
|
|
1937
1734
|
markers: {
|
|
1938
1735
|
mean: s / t.length,
|
|
1939
1736
|
sum: s,
|
|
1940
|
-
min: Math.min(...
|
|
1941
|
-
max: Math.max(...
|
|
1737
|
+
min: Math.min(...n),
|
|
1738
|
+
max: Math.max(...n)
|
|
1942
1739
|
}
|
|
1943
1740
|
};
|
|
1944
1741
|
}
|
|
1945
1742
|
}
|
|
1946
|
-
class
|
|
1743
|
+
class Pr {
|
|
1947
1744
|
/**
|
|
1948
1745
|
* The default render function for the library used by {@link MarkerClusterer}.
|
|
1949
1746
|
*
|
|
@@ -1982,24 +1779,24 @@ class Or {
|
|
|
1982
1779
|
* });
|
|
1983
1780
|
* ```
|
|
1984
1781
|
*/
|
|
1985
|
-
render({ count: e, position: t },
|
|
1986
|
-
const i = `<svg fill="${e > Math.max(10,
|
|
1782
|
+
render({ count: e, position: t }, n, s) {
|
|
1783
|
+
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
1784
|
<circle cx="120" cy="120" opacity=".6" r="70" />
|
|
1988
1785
|
<circle cx="120" cy="120" opacity=".3" r="90" />
|
|
1989
1786
|
<circle cx="120" cy="120" opacity=".2" r="110" />
|
|
1990
1787
|
<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
1788
|
</svg>`, l = `Cluster of ${e} markers`, a = Number(google.maps.Marker.MAX_ZINDEX) + e;
|
|
1992
|
-
if (
|
|
1789
|
+
if (w.isAdvancedMarkerAvailable(s)) {
|
|
1993
1790
|
const u = new DOMParser().parseFromString(i, "image/svg+xml").documentElement;
|
|
1994
1791
|
u.setAttribute("transform", "translate(0 25)");
|
|
1995
|
-
const
|
|
1792
|
+
const f = {
|
|
1996
1793
|
map: s,
|
|
1997
1794
|
position: t,
|
|
1998
1795
|
zIndex: a,
|
|
1999
1796
|
title: l,
|
|
2000
1797
|
content: u
|
|
2001
1798
|
};
|
|
2002
|
-
return new google.maps.marker.AdvancedMarkerElement(
|
|
1799
|
+
return new google.maps.marker.AdvancedMarkerElement(f);
|
|
2003
1800
|
}
|
|
2004
1801
|
const c = {
|
|
2005
1802
|
position: t,
|
|
@@ -2013,43 +1810,43 @@ class Or {
|
|
|
2013
1810
|
return new google.maps.Marker(c);
|
|
2014
1811
|
}
|
|
2015
1812
|
}
|
|
2016
|
-
function
|
|
1813
|
+
function br(r, e) {
|
|
2017
1814
|
for (let t in e.prototype)
|
|
2018
|
-
|
|
1815
|
+
r.prototype[t] = e.prototype[t];
|
|
2019
1816
|
}
|
|
2020
1817
|
class Me {
|
|
2021
1818
|
constructor() {
|
|
2022
|
-
|
|
1819
|
+
br(Me, google.maps.OverlayView);
|
|
2023
1820
|
}
|
|
2024
1821
|
}
|
|
2025
1822
|
var I;
|
|
2026
|
-
(function(
|
|
2027
|
-
|
|
1823
|
+
(function(r) {
|
|
1824
|
+
r.CLUSTERING_BEGIN = "clusteringbegin", r.CLUSTERING_END = "clusteringend", r.CLUSTER_CLICK = "click", r.GMP_CLICK = "gmp-click";
|
|
2028
1825
|
})(I || (I = {}));
|
|
2029
|
-
const
|
|
1826
|
+
const Sr = (r, e, t) => {
|
|
2030
1827
|
e.bounds && t.fitBounds(e.bounds);
|
|
2031
1828
|
};
|
|
2032
|
-
class
|
|
2033
|
-
constructor({ map: e, markers: t = [], algorithmOptions:
|
|
1829
|
+
class Ar extends Me {
|
|
1830
|
+
constructor({ map: e, markers: t = [], algorithmOptions: n = {}, algorithm: s = new Cr(n), renderer: o = new Pr(), onClusterClick: i = Sr }) {
|
|
2034
1831
|
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
1832
|
}
|
|
2036
1833
|
addMarker(e, t) {
|
|
2037
1834
|
this.markers.includes(e) || (this.markers.push(e), t || this.render());
|
|
2038
1835
|
}
|
|
2039
1836
|
addMarkers(e, t) {
|
|
2040
|
-
e.forEach((
|
|
2041
|
-
this.addMarker(
|
|
1837
|
+
e.forEach((n) => {
|
|
1838
|
+
this.addMarker(n, !0);
|
|
2042
1839
|
}), t || this.render();
|
|
2043
1840
|
}
|
|
2044
1841
|
removeMarker(e, t) {
|
|
2045
|
-
const
|
|
2046
|
-
return
|
|
1842
|
+
const n = this.markers.indexOf(e);
|
|
1843
|
+
return n === -1 ? !1 : (w.setMap(e, null), this.markers.splice(n, 1), t || this.render(), !0);
|
|
2047
1844
|
}
|
|
2048
1845
|
removeMarkers(e, t) {
|
|
2049
|
-
let
|
|
1846
|
+
let n = !1;
|
|
2050
1847
|
return e.forEach((s) => {
|
|
2051
|
-
|
|
2052
|
-
}),
|
|
1848
|
+
n = this.removeMarker(s, !0) || n;
|
|
1849
|
+
}), n && !t && this.render(), n;
|
|
2053
1850
|
}
|
|
2054
1851
|
clearMarkers(e) {
|
|
2055
1852
|
this.markers.length = 0, e || this.render();
|
|
@@ -2061,19 +1858,19 @@ class Pr extends Me {
|
|
|
2061
1858
|
const e = this.getMap();
|
|
2062
1859
|
if (e instanceof google.maps.Map && e.getProjection()) {
|
|
2063
1860
|
google.maps.event.trigger(this, I.CLUSTERING_BEGIN, this);
|
|
2064
|
-
const { clusters: t, changed:
|
|
1861
|
+
const { clusters: t, changed: n } = this.algorithm.calculate({
|
|
2065
1862
|
markers: this.markers,
|
|
2066
1863
|
map: e,
|
|
2067
1864
|
mapCanvasProjection: this.getProjection()
|
|
2068
1865
|
});
|
|
2069
|
-
if (
|
|
1866
|
+
if (n || n == null) {
|
|
2070
1867
|
const s = /* @__PURE__ */ new Set();
|
|
2071
1868
|
for (const i of t)
|
|
2072
1869
|
i.markers.length == 1 && s.add(i.markers[0]);
|
|
2073
1870
|
const o = [];
|
|
2074
1871
|
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) =>
|
|
1872
|
+
i.marker != null && (i.markers.length == 1 ? s.has(i.marker) || w.setMap(i.marker, null) : o.push(i.marker));
|
|
1873
|
+
this.clusters = t, this.renderClusters(), requestAnimationFrame(() => o.forEach((i) => w.setMap(i, null)));
|
|
2077
1874
|
}
|
|
2078
1875
|
google.maps.event.trigger(this, I.CLUSTERING_END, this);
|
|
2079
1876
|
}
|
|
@@ -2086,28 +1883,28 @@ class Pr extends Me {
|
|
|
2086
1883
|
this.idleListener && google.maps.event.removeListener(this.idleListener), this.reset();
|
|
2087
1884
|
}
|
|
2088
1885
|
reset() {
|
|
2089
|
-
this.markers.forEach((e) =>
|
|
1886
|
+
this.markers.forEach((e) => w.setMap(e, null)), this.clusters.forEach((e) => e.delete()), this.clusters = [];
|
|
2090
1887
|
}
|
|
2091
1888
|
renderClusters() {
|
|
2092
|
-
const e = new
|
|
2093
|
-
this.clusters.forEach((
|
|
2094
|
-
if (
|
|
2095
|
-
|
|
2096
|
-
else if (
|
|
2097
|
-
const s =
|
|
2098
|
-
|
|
1889
|
+
const e = new Mr(this.markers, this.clusters), t = this.getMap();
|
|
1890
|
+
this.clusters.forEach((n) => {
|
|
1891
|
+
if (n.markers.length === 1)
|
|
1892
|
+
n.marker = n.markers[0];
|
|
1893
|
+
else if (n.marker = this.renderer.render(n, e, t), n.markers.forEach((s) => w.setMap(s, null)), this.onClusterClick) {
|
|
1894
|
+
const s = w.isAdvancedMarker(n.marker) ? I.GMP_CLICK : I.CLUSTER_CLICK;
|
|
1895
|
+
n.marker.addListener(
|
|
2099
1896
|
s,
|
|
2100
1897
|
/* istanbul ignore next */
|
|
2101
1898
|
(o) => {
|
|
2102
|
-
google.maps.event.trigger(this, I.CLUSTER_CLICK,
|
|
1899
|
+
google.maps.event.trigger(this, I.CLUSTER_CLICK, n), this.onClusterClick(o, n, t);
|
|
2103
1900
|
}
|
|
2104
1901
|
);
|
|
2105
1902
|
}
|
|
2106
|
-
|
|
1903
|
+
w.setMap(n.marker, t);
|
|
2107
1904
|
});
|
|
2108
1905
|
}
|
|
2109
1906
|
}
|
|
2110
|
-
const
|
|
1907
|
+
const We = Object.values(I), Fr = O({
|
|
2111
1908
|
name: "MarkerCluster",
|
|
2112
1909
|
props: {
|
|
2113
1910
|
options: {
|
|
@@ -2115,21 +1912,21 @@ const Je = Object.values(I), Ur = P({
|
|
|
2115
1912
|
default: () => ({})
|
|
2116
1913
|
}
|
|
2117
1914
|
},
|
|
2118
|
-
emits:
|
|
2119
|
-
setup(
|
|
2120
|
-
const s =
|
|
2121
|
-
return
|
|
1915
|
+
emits: We,
|
|
1916
|
+
setup(r, { emit: e, expose: t, slots: n }) {
|
|
1917
|
+
const s = y(), o = k(B, y()), i = k(D, y());
|
|
1918
|
+
return U(we, s), M(
|
|
2122
1919
|
o,
|
|
2123
1920
|
() => {
|
|
2124
1921
|
o.value && (s.value = S(
|
|
2125
|
-
new
|
|
1922
|
+
new Ar({
|
|
2126
1923
|
map: o.value,
|
|
2127
1924
|
// Better perf than the default `SuperClusterAlgorithm`. See:
|
|
2128
1925
|
// https://github.com/googlemaps/js-markerclusterer/pull/640
|
|
2129
|
-
algorithm: new
|
|
2130
|
-
...
|
|
1926
|
+
algorithm: new Or(r.options.algorithmOptions ?? {}),
|
|
1927
|
+
...r.options
|
|
2131
1928
|
})
|
|
2132
|
-
),
|
|
1929
|
+
), We.forEach((l) => {
|
|
2133
1930
|
var a;
|
|
2134
1931
|
(a = s.value) == null || a.addListener(l, (c) => e(l, c));
|
|
2135
1932
|
}));
|
|
@@ -2137,15 +1934,15 @@ const Je = Object.values(I), Ur = P({
|
|
|
2137
1934
|
{
|
|
2138
1935
|
immediate: !0
|
|
2139
1936
|
}
|
|
2140
|
-
),
|
|
1937
|
+
), $(() => {
|
|
2141
1938
|
var l;
|
|
2142
1939
|
s.value && ((l = i.value) == null || l.event.clearInstanceListeners(s.value), s.value.clearMarkers(), s.value.setMap(null));
|
|
2143
1940
|
}), t({ markerCluster: s }), () => {
|
|
2144
1941
|
var l;
|
|
2145
|
-
return (l =
|
|
1942
|
+
return (l = n.default) == null ? void 0 : l.call(n);
|
|
2146
1943
|
};
|
|
2147
1944
|
}
|
|
2148
|
-
}), qr =
|
|
1945
|
+
}), qr = O({
|
|
2149
1946
|
inheritAttrs: !1,
|
|
2150
1947
|
props: {
|
|
2151
1948
|
options: {
|
|
@@ -2153,34 +1950,34 @@ const Je = Object.values(I), Ur = P({
|
|
|
2153
1950
|
required: !0
|
|
2154
1951
|
}
|
|
2155
1952
|
},
|
|
2156
|
-
setup(
|
|
2157
|
-
const s =
|
|
1953
|
+
setup(r, { slots: e, emit: t, expose: n }) {
|
|
1954
|
+
const s = y(), o = z(() => {
|
|
2158
1955
|
var a;
|
|
2159
|
-
return (a = e.default) == null ? void 0 : a.call(e).some((c) => c.type !==
|
|
2160
|
-
}), i =
|
|
2161
|
-
...
|
|
1956
|
+
return (a = e.default) == null ? void 0 : a.call(e).some((c) => c.type !== ve);
|
|
1957
|
+
}), i = z(() => ({
|
|
1958
|
+
...r.options,
|
|
2162
1959
|
element: s.value
|
|
2163
|
-
})), l =
|
|
2164
|
-
return
|
|
1960
|
+
})), l = H(le, [], i, t);
|
|
1961
|
+
return n({
|
|
2165
1962
|
customMarker: l
|
|
2166
1963
|
}), { customMarkerRef: s, customMarker: l, hasSlotContent: o };
|
|
2167
1964
|
}
|
|
2168
1965
|
});
|
|
2169
|
-
const
|
|
1966
|
+
const Tr = {
|
|
2170
1967
|
key: 0,
|
|
2171
1968
|
class: "custom-marker-wrapper"
|
|
2172
1969
|
};
|
|
2173
|
-
function
|
|
2174
|
-
return
|
|
2175
|
-
|
|
1970
|
+
function Lr(r, e, t, n, s, o) {
|
|
1971
|
+
return r.hasSlotContent ? (G(), V("div", Tr, [
|
|
1972
|
+
ie("div", ye({
|
|
2176
1973
|
ref: "customMarkerRef",
|
|
2177
|
-
style: { cursor:
|
|
2178
|
-
},
|
|
2179
|
-
|
|
1974
|
+
style: { cursor: r.$attrs.onClick ? "pointer" : void 0 }
|
|
1975
|
+
}, r.$attrs), [
|
|
1976
|
+
F(r.$slots, "default", {}, void 0, !0)
|
|
2180
1977
|
], 16)
|
|
2181
|
-
])) :
|
|
1978
|
+
])) : _e("", !0);
|
|
2182
1979
|
}
|
|
2183
|
-
const
|
|
1980
|
+
const zr = /* @__PURE__ */ te(qr, [["render", Lr], ["__scopeId", "data-v-2d2d343a"]]), Wr = O({
|
|
2184
1981
|
name: "HeatmapLayer",
|
|
2185
1982
|
props: {
|
|
2186
1983
|
options: {
|
|
@@ -2188,16 +1985,16 @@ const Gr = /* @__PURE__ */ re(qr, [["render", Ar], ["__scopeId", "data-v-2d2d343
|
|
|
2188
1985
|
default: () => ({})
|
|
2189
1986
|
}
|
|
2190
1987
|
},
|
|
2191
|
-
setup(
|
|
2192
|
-
const e =
|
|
2193
|
-
return
|
|
2194
|
-
[t, () =>
|
|
1988
|
+
setup(r) {
|
|
1989
|
+
const e = y(), t = k(B, y()), n = k(D, y());
|
|
1990
|
+
return M(
|
|
1991
|
+
[t, () => r.options],
|
|
2195
1992
|
([s, o], [i, l]) => {
|
|
2196
|
-
const a = !
|
|
2197
|
-
if (t.value &&
|
|
1993
|
+
const a = !Q(o, l) || t.value !== i;
|
|
1994
|
+
if (t.value && n.value && a) {
|
|
2198
1995
|
let c;
|
|
2199
|
-
if (o.data && !(o.data instanceof
|
|
2200
|
-
const d =
|
|
1996
|
+
if (o.data && !(o.data instanceof n.value.MVCArray)) {
|
|
1997
|
+
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
1998
|
c = {
|
|
2202
1999
|
...o,
|
|
2203
2000
|
data: u
|
|
@@ -2205,7 +2002,7 @@ const Gr = /* @__PURE__ */ re(qr, [["render", Ar], ["__scopeId", "data-v-2d2d343
|
|
|
2205
2002
|
} else
|
|
2206
2003
|
c = o;
|
|
2207
2004
|
e.value ? e.value.setOptions(c) : e.value = S(
|
|
2208
|
-
new
|
|
2005
|
+
new n.value.visualization.HeatmapLayer({
|
|
2209
2006
|
...c,
|
|
2210
2007
|
map: t.value
|
|
2211
2008
|
})
|
|
@@ -2213,26 +2010,26 @@ const Gr = /* @__PURE__ */ re(qr, [["render", Ar], ["__scopeId", "data-v-2d2d343
|
|
|
2213
2010
|
}
|
|
2214
2011
|
},
|
|
2215
2012
|
{ immediate: !0 }
|
|
2216
|
-
),
|
|
2013
|
+
), $(() => {
|
|
2217
2014
|
e.value && e.value.setMap(null);
|
|
2218
2015
|
}), { heatmapLayer: e };
|
|
2219
2016
|
},
|
|
2220
2017
|
render: () => null
|
|
2221
2018
|
});
|
|
2222
2019
|
export {
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2020
|
+
Nr as AdvancedMarker,
|
|
2021
|
+
Ur as Circle,
|
|
2022
|
+
Gr as CustomControl,
|
|
2023
|
+
zr as CustomMarker,
|
|
2024
|
+
jr as GoogleMap,
|
|
2025
|
+
Wr as HeatmapLayer,
|
|
2026
|
+
Vr as InfoWindow,
|
|
2027
|
+
$r as Marker,
|
|
2028
|
+
Fr as MarkerCluster,
|
|
2029
|
+
Dr as Polygon,
|
|
2030
|
+
Br as Polyline,
|
|
2031
|
+
Zr as Rectangle,
|
|
2032
|
+
D as apiSymbol,
|
|
2033
|
+
B as mapSymbol,
|
|
2034
|
+
Ke as mapTilesLoadedSymbol
|
|
2238
2035
|
};
|