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