vue3-google-map 0.17.0 → 0.18.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/LICENSE +21 -0
- package/README.md +43 -3
- package/dist/index.cjs.js +17 -4
- package/dist/index.es.js +605 -512
- package/dist/index.umd.js +17 -4
- package/dist/types/components/CustomMarker.vue.d.ts +1 -0
- package/dist/types/components/GoogleMap.vue.d.ts +1 -1
- package/dist/types/components/InfoWindow.vue.d.ts +9 -2
- package/dist/types/shims-google-maps.d.ts +15 -0
- package/package.json +23 -23
package/dist/index.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
import { defineComponent as
|
|
6
|
-
const
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".mapdiv[data-v-174b771e]{width:100%;height:100%}.info-window-wrapper[data-v-90174664]{display:none}.mapdiv .info-window-wrapper[data-v-90174664]{display:inline-block}.custom-marker-wrapper[data-v-2d2d343a]{display:none}.mapdiv .custom-marker-wrapper[data-v-2d2d343a]{display:inline-block}")),document.head.appendChild(e)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
|
|
2
|
+
var qe = Object.defineProperty;
|
|
3
|
+
var Be = (n, e, t) => e in n ? qe(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
4
|
+
var se = (n, e, t) => (Be(n, typeof e != "symbol" ? e + "" : e, t), t);
|
|
5
|
+
import { defineComponent as P, ref as y, provide as G, watch as O, onMounted as Me, onBeforeUnmount as B, markRaw as I, toRef as N, openBlock as Y, createElementBlock as X, createElementVNode as ae, renderSlot as Q, normalizeProps as Ne, guardReactiveProps as Ze, inject as C, computed as J, withDirectives as De, vShow as Ue, Comment as Ee, mergeProps as Pe, createCommentVNode as Oe } from "vue";
|
|
6
|
+
const Z = Symbol("map"), D = Symbol("api"), xe = Symbol("marker"), Le = Symbol("markerCluster"), ee = Symbol("CustomMarker"), Se = Symbol("mapTilesLoaded"), q = [
|
|
7
7
|
"click",
|
|
8
8
|
"dblclick",
|
|
9
9
|
"drag",
|
|
@@ -16,18 +16,59 @@ const q = Symbol("map"), R = Symbol("api"), xe = Symbol("marker"), Ee = Symbol("
|
|
|
16
16
|
"mouseup",
|
|
17
17
|
"rightclick"
|
|
18
18
|
];
|
|
19
|
-
|
|
19
|
+
/*! *****************************************************************************
|
|
20
|
+
Copyright (c) Microsoft Corporation.
|
|
21
|
+
|
|
22
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
23
|
+
purpose with or without fee is hereby granted.
|
|
24
|
+
|
|
25
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
26
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
27
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
28
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
29
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
30
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
31
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
32
|
+
***************************************************************************** */
|
|
33
|
+
function Fe(n, e, t, s) {
|
|
34
|
+
function r(o) {
|
|
35
|
+
return o instanceof t ? o : new t(function(a) {
|
|
36
|
+
a(o);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
return new (t || (t = Promise))(function(o, a) {
|
|
40
|
+
function l(u) {
|
|
41
|
+
try {
|
|
42
|
+
d(s.next(u));
|
|
43
|
+
} catch (c) {
|
|
44
|
+
a(c);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function i(u) {
|
|
48
|
+
try {
|
|
49
|
+
d(s.throw(u));
|
|
50
|
+
} catch (c) {
|
|
51
|
+
a(c);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function d(u) {
|
|
55
|
+
u.done ? o(u.value) : r(u.value).then(l, i);
|
|
56
|
+
}
|
|
57
|
+
d((s = s.apply(n, e || [])).next());
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
var Ve = function n(e, t) {
|
|
20
61
|
if (e === t)
|
|
21
62
|
return !0;
|
|
22
63
|
if (e && t && typeof e == "object" && typeof t == "object") {
|
|
23
64
|
if (e.constructor !== t.constructor)
|
|
24
65
|
return !1;
|
|
25
|
-
var s, r,
|
|
66
|
+
var s, r, o;
|
|
26
67
|
if (Array.isArray(e)) {
|
|
27
68
|
if (s = e.length, s != t.length)
|
|
28
69
|
return !1;
|
|
29
70
|
for (r = s; r-- !== 0; )
|
|
30
|
-
if (!
|
|
71
|
+
if (!n(e[r], t[r]))
|
|
31
72
|
return !1;
|
|
32
73
|
return !0;
|
|
33
74
|
}
|
|
@@ -37,22 +78,26 @@ var De = function o(e, t) {
|
|
|
37
78
|
return e.valueOf() === t.valueOf();
|
|
38
79
|
if (e.toString !== Object.prototype.toString)
|
|
39
80
|
return e.toString() === t.toString();
|
|
40
|
-
if (
|
|
81
|
+
if (o = Object.keys(e), s = o.length, s !== Object.keys(t).length)
|
|
41
82
|
return !1;
|
|
42
83
|
for (r = s; r-- !== 0; )
|
|
43
|
-
if (!Object.prototype.hasOwnProperty.call(t,
|
|
84
|
+
if (!Object.prototype.hasOwnProperty.call(t, o[r]))
|
|
44
85
|
return !1;
|
|
45
86
|
for (r = s; r-- !== 0; ) {
|
|
46
|
-
var a =
|
|
47
|
-
if (!
|
|
87
|
+
var a = o[r];
|
|
88
|
+
if (!n(e[a], t[a]))
|
|
48
89
|
return !1;
|
|
49
90
|
}
|
|
50
91
|
return !0;
|
|
51
92
|
}
|
|
52
93
|
return e !== e && t !== t;
|
|
53
94
|
};
|
|
54
|
-
const
|
|
55
|
-
|
|
95
|
+
const de = "__googleMapsScriptId";
|
|
96
|
+
var R;
|
|
97
|
+
(function(n) {
|
|
98
|
+
n[n.INITIALIZED = 0] = "INITIALIZED", n[n.LOADING = 1] = "LOADING", n[n.SUCCESS = 2] = "SUCCESS", n[n.FAILURE = 3] = "FAILURE";
|
|
99
|
+
})(R || (R = {}));
|
|
100
|
+
class T {
|
|
56
101
|
/**
|
|
57
102
|
* Creates an instance of Loader using [[LoaderOptions]]. No defaults are set
|
|
58
103
|
* using this library, instead the defaults are set by the Google Maps
|
|
@@ -62,13 +107,13 @@ class S {
|
|
|
62
107
|
* const loader = Loader({apiKey, version: 'weekly', libraries: ['places']});
|
|
63
108
|
* ```
|
|
64
109
|
*/
|
|
65
|
-
constructor({ apiKey: e,
|
|
66
|
-
if (this.
|
|
67
|
-
if (!
|
|
68
|
-
throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(
|
|
69
|
-
return
|
|
110
|
+
constructor({ apiKey: e, authReferrerPolicy: t, channel: s, client: r, id: o = de, language: a, libraries: l = [], mapIds: i, nonce: d, region: u, retries: c = 3, url: h = "https://maps.googleapis.com/maps/api/js", version: p }) {
|
|
111
|
+
if (this.callbacks = [], this.done = !1, this.loading = !1, this.errors = [], this.apiKey = e, this.authReferrerPolicy = t, this.channel = s, this.client = r, this.id = o || de, this.language = a, this.libraries = l, this.mapIds = i, this.nonce = d, this.region = u, this.retries = c, this.url = h, this.version = p, T.instance) {
|
|
112
|
+
if (!Ve(this.options, T.instance.options))
|
|
113
|
+
throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(T.instance.options)}`);
|
|
114
|
+
return T.instance;
|
|
70
115
|
}
|
|
71
|
-
|
|
116
|
+
T.instance = this;
|
|
72
117
|
}
|
|
73
118
|
get options() {
|
|
74
119
|
return {
|
|
@@ -82,9 +127,13 @@ class S {
|
|
|
82
127
|
region: this.region,
|
|
83
128
|
mapIds: this.mapIds,
|
|
84
129
|
nonce: this.nonce,
|
|
85
|
-
url: this.url
|
|
130
|
+
url: this.url,
|
|
131
|
+
authReferrerPolicy: this.authReferrerPolicy
|
|
86
132
|
};
|
|
87
133
|
}
|
|
134
|
+
get status() {
|
|
135
|
+
return this.errors.length ? R.FAILURE : this.done ? R.SUCCESS : this.loading ? R.LOADING : R.INITIALIZED;
|
|
136
|
+
}
|
|
88
137
|
get failed() {
|
|
89
138
|
return this.done && !this.loading && this.errors.length >= this.retries + 1;
|
|
90
139
|
}
|
|
@@ -92,10 +141,11 @@ class S {
|
|
|
92
141
|
* CreateUrl returns the Google Maps JavaScript API script url given the [[LoaderOptions]].
|
|
93
142
|
*
|
|
94
143
|
* @ignore
|
|
144
|
+
* @deprecated
|
|
95
145
|
*/
|
|
96
146
|
createUrl() {
|
|
97
147
|
let e = this.url;
|
|
98
|
-
return e +=
|
|
148
|
+
return e += "?callback=__googleMapsCallback", 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;
|
|
99
149
|
}
|
|
100
150
|
deleteScript() {
|
|
101
151
|
const e = document.getElementById(this.id);
|
|
@@ -103,6 +153,7 @@ class S {
|
|
|
103
153
|
}
|
|
104
154
|
/**
|
|
105
155
|
* Load the Google Maps JavaScript API script and return a Promise.
|
|
156
|
+
* @deprecated, use importLibrary() instead.
|
|
106
157
|
*/
|
|
107
158
|
load() {
|
|
108
159
|
return this.loadPromise();
|
|
@@ -111,6 +162,7 @@ class S {
|
|
|
111
162
|
* Load the Google Maps JavaScript API script and return a Promise.
|
|
112
163
|
*
|
|
113
164
|
* @ignore
|
|
165
|
+
* @deprecated, use importLibrary() instead.
|
|
114
166
|
*/
|
|
115
167
|
loadPromise() {
|
|
116
168
|
return new Promise((e, t) => {
|
|
@@ -119,8 +171,12 @@ class S {
|
|
|
119
171
|
});
|
|
120
172
|
});
|
|
121
173
|
}
|
|
174
|
+
importLibrary(e) {
|
|
175
|
+
return this.execute(), google.maps.importLibrary(e);
|
|
176
|
+
}
|
|
122
177
|
/**
|
|
123
178
|
* Load the Google Maps JavaScript API script with a callback.
|
|
179
|
+
* @deprecated, use importLibrary() instead.
|
|
124
180
|
*/
|
|
125
181
|
loadCallback(e) {
|
|
126
182
|
this.callbacks.push(e), this.execute();
|
|
@@ -129,12 +185,45 @@ class S {
|
|
|
129
185
|
* Set the script on document.
|
|
130
186
|
*/
|
|
131
187
|
setScript() {
|
|
188
|
+
var e, t;
|
|
132
189
|
if (document.getElementById(this.id)) {
|
|
133
190
|
this.callback();
|
|
134
191
|
return;
|
|
135
192
|
}
|
|
136
|
-
const
|
|
137
|
-
|
|
193
|
+
const s = {
|
|
194
|
+
key: this.apiKey,
|
|
195
|
+
channel: this.channel,
|
|
196
|
+
client: this.client,
|
|
197
|
+
libraries: this.libraries.length && this.libraries,
|
|
198
|
+
v: this.version,
|
|
199
|
+
mapIds: this.mapIds,
|
|
200
|
+
language: this.language,
|
|
201
|
+
region: this.region,
|
|
202
|
+
authReferrerPolicy: this.authReferrerPolicy
|
|
203
|
+
};
|
|
204
|
+
Object.keys(s).forEach(
|
|
205
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
206
|
+
(o) => !s[o] && delete s[o]
|
|
207
|
+
), !((t = (e = window == null ? void 0 : window.google) === null || e === void 0 ? void 0 : e.maps) === null || t === void 0) && t.importLibrary || ((o) => {
|
|
208
|
+
let a, l, i, d = "The Google Maps JavaScript API", u = "google", c = "importLibrary", h = "__ib__", p = document, m = window;
|
|
209
|
+
m = m[u] || (m[u] = {});
|
|
210
|
+
const f = m.maps || (m.maps = {}), g = /* @__PURE__ */ new Set(), v = new URLSearchParams(), w = () => (
|
|
211
|
+
// @ts-ignore
|
|
212
|
+
a || (a = new Promise((_, E) => Fe(this, void 0, void 0, function* () {
|
|
213
|
+
var b;
|
|
214
|
+
yield l = p.createElement("script"), l.id = this.id, v.set("libraries", [...g] + "");
|
|
215
|
+
for (i in o)
|
|
216
|
+
v.set(i.replace(/[A-Z]/g, (x) => "_" + x[0].toLowerCase()), o[i]);
|
|
217
|
+
v.set("callback", u + ".maps." + h), l.src = this.url + "?" + v, f[h] = _, l.onerror = () => a = E(Error(d + " could not load.")), l.nonce = this.nonce || ((b = p.querySelector("script[nonce]")) === null || b === void 0 ? void 0 : b.nonce) || "", p.head.append(l);
|
|
218
|
+
})))
|
|
219
|
+
);
|
|
220
|
+
f[c] ? console.warn(d + " only loads once. Ignoring:", o) : f[c] = (_, ...E) => g.add(_) && w().then(() => f[c](_, ...E));
|
|
221
|
+
})(s);
|
|
222
|
+
const r = this.libraries.map((o) => this.importLibrary(o));
|
|
223
|
+
r.length || r.push(this.importLibrary("core")), Promise.all(r).then(() => this.callback(), (o) => {
|
|
224
|
+
const a = new ErrorEvent("error", { error: o });
|
|
225
|
+
this.loadErrorCallback(a);
|
|
226
|
+
});
|
|
138
227
|
}
|
|
139
228
|
/**
|
|
140
229
|
* Reset the loader state.
|
|
@@ -148,15 +237,12 @@ class S {
|
|
|
148
237
|
loadErrorCallback(e) {
|
|
149
238
|
if (this.errors.push(e), this.errors.length <= this.retries) {
|
|
150
239
|
const t = this.errors.length * Math.pow(2, this.errors.length);
|
|
151
|
-
console.
|
|
240
|
+
console.error(`Failed to load Google Maps script, retrying in ${t} ms.`), setTimeout(() => {
|
|
152
241
|
this.deleteScript(), this.setScript();
|
|
153
242
|
}, t);
|
|
154
243
|
} else
|
|
155
244
|
this.onerrorEvent = e, this.callback();
|
|
156
245
|
}
|
|
157
|
-
setCallback() {
|
|
158
|
-
window.__googleMapsCallback = this.callback.bind(this);
|
|
159
|
-
}
|
|
160
246
|
callback() {
|
|
161
247
|
this.done = !0, this.loading = !1, this.callbacks.forEach((e) => {
|
|
162
248
|
e(this.onerrorEvent);
|
|
@@ -170,21 +256,21 @@ class S {
|
|
|
170
256
|
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();
|
|
171
257
|
return;
|
|
172
258
|
}
|
|
173
|
-
this.loading || (this.loading = !0, this.
|
|
259
|
+
this.loading || (this.loading = !0, this.setScript());
|
|
174
260
|
}
|
|
175
261
|
}
|
|
176
262
|
}
|
|
177
|
-
function
|
|
178
|
-
return class extends
|
|
263
|
+
function ze(n) {
|
|
264
|
+
return class extends n.OverlayView {
|
|
179
265
|
constructor(s) {
|
|
180
266
|
super();
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
const { element: r, ...
|
|
184
|
-
this.element = r, this.opts =
|
|
267
|
+
se(this, "element");
|
|
268
|
+
se(this, "opts");
|
|
269
|
+
const { element: r, ...o } = s;
|
|
270
|
+
this.element = r, this.opts = o, this.opts.map && this.setMap(this.opts.map);
|
|
185
271
|
}
|
|
186
272
|
getPosition() {
|
|
187
|
-
return this.opts.position ? this.opts.position instanceof
|
|
273
|
+
return this.opts.position ? this.opts.position instanceof n.LatLng ? this.opts.position : new n.LatLng(this.opts.position) : null;
|
|
188
274
|
}
|
|
189
275
|
getVisible() {
|
|
190
276
|
if (!this.element)
|
|
@@ -201,52 +287,53 @@ function Ue(o) {
|
|
|
201
287
|
draw() {
|
|
202
288
|
if (!this.element)
|
|
203
289
|
return;
|
|
204
|
-
const
|
|
290
|
+
const s = this.getProjection(), r = s == null ? void 0 : s.fromLatLngToDivPixel(this.getPosition());
|
|
205
291
|
if (r) {
|
|
206
292
|
this.element.style.position = "absolute";
|
|
207
|
-
const
|
|
208
|
-
let
|
|
293
|
+
const o = this.element.offsetHeight, a = this.element.offsetWidth;
|
|
294
|
+
let l, i;
|
|
209
295
|
switch (this.opts.anchorPoint) {
|
|
210
296
|
case "TOP_CENTER":
|
|
211
|
-
|
|
297
|
+
l = r.x - a / 2, i = r.y;
|
|
212
298
|
break;
|
|
213
299
|
case "BOTTOM_CENTER":
|
|
214
|
-
|
|
300
|
+
l = r.x - a / 2, i = r.y - o;
|
|
215
301
|
break;
|
|
216
302
|
case "LEFT_CENTER":
|
|
217
|
-
|
|
303
|
+
l = r.x, i = r.y - o / 2;
|
|
218
304
|
break;
|
|
219
305
|
case "RIGHT_CENTER":
|
|
220
|
-
|
|
306
|
+
l = r.x - a, i = r.y - o / 2;
|
|
221
307
|
break;
|
|
222
308
|
case "TOP_LEFT":
|
|
223
|
-
|
|
309
|
+
l = r.x, i = r.y;
|
|
224
310
|
break;
|
|
225
311
|
case "TOP_RIGHT":
|
|
226
|
-
|
|
312
|
+
l = r.x - a, i = r.y;
|
|
227
313
|
break;
|
|
228
314
|
case "BOTTOM_LEFT":
|
|
229
|
-
|
|
315
|
+
l = r.x, i = r.y - o;
|
|
230
316
|
break;
|
|
231
317
|
case "BOTTOM_RIGHT":
|
|
232
|
-
|
|
318
|
+
l = r.x - a, i = r.y - o;
|
|
233
319
|
break;
|
|
234
320
|
default:
|
|
235
|
-
|
|
321
|
+
l = r.x - a / 2, i = r.y - o / 2;
|
|
236
322
|
}
|
|
237
|
-
this.element.style.left =
|
|
323
|
+
this.element.style.left = l + "px", this.element.style.top = i + "px", this.element.style.transform = `translateX(${this.opts.offsetX || 0}px) translateY(${this.opts.offsetY || 0}px)`, this.opts.zIndex && (this.element.style.zIndex = this.opts.zIndex.toString());
|
|
238
324
|
}
|
|
239
325
|
}
|
|
240
326
|
onRemove() {
|
|
241
327
|
this.element && this.element.remove();
|
|
242
328
|
}
|
|
243
329
|
setOptions(s) {
|
|
244
|
-
|
|
330
|
+
const { element: r, ...o } = s;
|
|
331
|
+
this.element = r, this.opts = o, this.draw();
|
|
245
332
|
}
|
|
246
333
|
};
|
|
247
334
|
}
|
|
248
|
-
let
|
|
249
|
-
const
|
|
335
|
+
let he;
|
|
336
|
+
const pe = [
|
|
250
337
|
"bounds_changed",
|
|
251
338
|
"center_changed",
|
|
252
339
|
"click",
|
|
@@ -266,7 +353,7 @@ const he = [
|
|
|
266
353
|
"tilesloaded",
|
|
267
354
|
"tilt_changed",
|
|
268
355
|
"zoom_changed"
|
|
269
|
-
],
|
|
356
|
+
], Ge = P({
|
|
270
357
|
props: {
|
|
271
358
|
apiPromise: {
|
|
272
359
|
type: Promise
|
|
@@ -454,104 +541,104 @@ const he = [
|
|
|
454
541
|
required: !1
|
|
455
542
|
}
|
|
456
543
|
},
|
|
457
|
-
emits:
|
|
458
|
-
setup(
|
|
459
|
-
const t =
|
|
460
|
-
|
|
461
|
-
const
|
|
462
|
-
const
|
|
463
|
-
Object.keys(
|
|
464
|
-
|
|
544
|
+
emits: pe,
|
|
545
|
+
setup(n, { emit: e }) {
|
|
546
|
+
const t = y(), s = y(!1), r = y(), o = y(), a = y(!1);
|
|
547
|
+
G(Z, r), G(D, o), G(Se, a);
|
|
548
|
+
const l = () => {
|
|
549
|
+
const c = { ...n };
|
|
550
|
+
Object.keys(c).forEach((f) => {
|
|
551
|
+
c[f] === void 0 && delete c[f];
|
|
465
552
|
});
|
|
466
|
-
const p = (
|
|
553
|
+
const p = (f) => {
|
|
467
554
|
var g;
|
|
468
|
-
return
|
|
469
|
-
},
|
|
470
|
-
scaleControlOptions:
|
|
471
|
-
panControlOptions: p(
|
|
472
|
-
zoomControlOptions: p(
|
|
473
|
-
rotateControlOptions: p(
|
|
474
|
-
streetViewControlOptions: p(
|
|
475
|
-
fullscreenControlOptions: p(
|
|
476
|
-
disableDefaultUI:
|
|
555
|
+
return f ? { position: (g = o.value) == null ? void 0 : g.ControlPosition[f] } : {};
|
|
556
|
+
}, m = {
|
|
557
|
+
scaleControlOptions: n.scaleControlStyle ? { style: n.scaleControlStyle } : {},
|
|
558
|
+
panControlOptions: p(n.panControlPosition),
|
|
559
|
+
zoomControlOptions: p(n.zoomControlPosition),
|
|
560
|
+
rotateControlOptions: p(n.rotateControlPosition),
|
|
561
|
+
streetViewControlOptions: p(n.streetViewControlPosition),
|
|
562
|
+
fullscreenControlOptions: p(n.fullscreenControlPosition),
|
|
563
|
+
disableDefaultUI: n.disableDefaultUi
|
|
477
564
|
};
|
|
478
|
-
return { ...
|
|
565
|
+
return { ...c, ...m };
|
|
479
566
|
}, i = O(
|
|
480
|
-
[
|
|
481
|
-
([
|
|
482
|
-
const p =
|
|
483
|
-
p &&
|
|
567
|
+
[o, r],
|
|
568
|
+
([c, h]) => {
|
|
569
|
+
const p = c, m = h;
|
|
570
|
+
p && m && (p.event.addListenerOnce(m, "tilesloaded", () => {
|
|
484
571
|
a.value = !0;
|
|
485
572
|
}), setTimeout(i, 0));
|
|
486
573
|
},
|
|
487
574
|
{ immediate: !0 }
|
|
488
575
|
), d = () => {
|
|
489
576
|
try {
|
|
490
|
-
const { apiKey:
|
|
491
|
-
|
|
492
|
-
} catch (
|
|
493
|
-
console.error(
|
|
577
|
+
const { apiKey: c, region: h, version: p, language: m, libraries: f } = n;
|
|
578
|
+
he = new T({ apiKey: c, region: h, version: p, language: m, libraries: f });
|
|
579
|
+
} catch (c) {
|
|
580
|
+
console.error(c);
|
|
494
581
|
}
|
|
495
|
-
}, u = (
|
|
496
|
-
|
|
497
|
-
const h =
|
|
498
|
-
|
|
499
|
-
var
|
|
500
|
-
(
|
|
582
|
+
}, u = (c) => {
|
|
583
|
+
o.value = I(c.maps), r.value = I(new c.maps.Map(t.value, l()));
|
|
584
|
+
const h = ze(o.value);
|
|
585
|
+
o.value[ee] = h, pe.forEach((m) => {
|
|
586
|
+
var f;
|
|
587
|
+
(f = r.value) == null || f.addListener(m, (g) => e(m, g));
|
|
501
588
|
}), s.value = !0;
|
|
502
|
-
const p = Object.keys(
|
|
503
|
-
(
|
|
504
|
-
).map((
|
|
589
|
+
const p = Object.keys(n).filter(
|
|
590
|
+
(m) => !["apiPromise", "apiKey", "version", "libraries", "region", "language", "center", "zoom"].includes(m)
|
|
591
|
+
).map((m) => N(n, m));
|
|
505
592
|
O(
|
|
506
|
-
[() =>
|
|
507
|
-
([
|
|
508
|
-
var
|
|
509
|
-
const { center: w, zoom:
|
|
510
|
-
(
|
|
511
|
-
const
|
|
512
|
-
|
|
593
|
+
[() => n.center, () => n.zoom, ...p],
|
|
594
|
+
([m, f], [g, v]) => {
|
|
595
|
+
var x, M, F;
|
|
596
|
+
const { center: w, zoom: _, ...E } = l();
|
|
597
|
+
(x = r.value) == null || x.setOptions(E), f !== void 0 && f !== v && ((M = r.value) == null || M.setZoom(f));
|
|
598
|
+
const b = !g || m.lng !== g.lng || m.lat !== g.lat;
|
|
599
|
+
m && b && ((F = r.value) == null || F.panTo(m));
|
|
513
600
|
}
|
|
514
601
|
);
|
|
515
602
|
};
|
|
516
603
|
return Me(() => {
|
|
517
|
-
|
|
518
|
-
}),
|
|
519
|
-
var
|
|
520
|
-
a.value = !1, r.value && ((
|
|
521
|
-
}), { mapRef: t, ready: s, map: r, api:
|
|
604
|
+
n.apiPromise && n.apiPromise instanceof Promise ? n.apiPromise.then(u) : (d(), he.load().then(u));
|
|
605
|
+
}), B(() => {
|
|
606
|
+
var c;
|
|
607
|
+
a.value = !1, r.value && ((c = o.value) == null || c.event.clearInstanceListeners(r.value));
|
|
608
|
+
}), { mapRef: t, ready: s, map: r, api: o, mapTilesLoaded: a };
|
|
522
609
|
}
|
|
523
610
|
});
|
|
524
|
-
const
|
|
525
|
-
const t =
|
|
611
|
+
const te = (n, e) => {
|
|
612
|
+
const t = n.__vccOpts || n;
|
|
526
613
|
for (const [s, r] of e)
|
|
527
614
|
t[s] = r;
|
|
528
615
|
return t;
|
|
529
|
-
},
|
|
616
|
+
}, He = {
|
|
530
617
|
ref: "mapRef",
|
|
531
618
|
class: "mapdiv"
|
|
532
619
|
};
|
|
533
|
-
function
|
|
534
|
-
return
|
|
535
|
-
|
|
536
|
-
|
|
620
|
+
function We(n, e, t, s, r, o) {
|
|
621
|
+
return Y(), X("div", null, [
|
|
622
|
+
ae("div", He, null, 512),
|
|
623
|
+
Q(n.$slots, "default", Ne(Ze({ ready: n.ready, map: n.map, api: n.api, mapTilesLoaded: n.mapTilesLoaded })), void 0, !0)
|
|
537
624
|
]);
|
|
538
625
|
}
|
|
539
|
-
const Ot = /* @__PURE__ */
|
|
540
|
-
function
|
|
541
|
-
return
|
|
626
|
+
const Ot = /* @__PURE__ */ te(Ge, [["render", We], ["__scopeId", "data-v-174b771e"]]);
|
|
627
|
+
function Ke(n) {
|
|
628
|
+
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
542
629
|
}
|
|
543
|
-
var
|
|
630
|
+
var Je = function n(e, t) {
|
|
544
631
|
if (e === t)
|
|
545
632
|
return !0;
|
|
546
633
|
if (e && t && typeof e == "object" && typeof t == "object") {
|
|
547
634
|
if (e.constructor !== t.constructor)
|
|
548
635
|
return !1;
|
|
549
|
-
var s, r,
|
|
636
|
+
var s, r, o;
|
|
550
637
|
if (Array.isArray(e)) {
|
|
551
638
|
if (s = e.length, s != t.length)
|
|
552
639
|
return !1;
|
|
553
640
|
for (r = s; r-- !== 0; )
|
|
554
|
-
if (!
|
|
641
|
+
if (!n(e[r], t[r]))
|
|
555
642
|
return !1;
|
|
556
643
|
return !0;
|
|
557
644
|
}
|
|
@@ -561,51 +648,51 @@ var We = function o(e, t) {
|
|
|
561
648
|
return e.valueOf() === t.valueOf();
|
|
562
649
|
if (e.toString !== Object.prototype.toString)
|
|
563
650
|
return e.toString() === t.toString();
|
|
564
|
-
if (
|
|
651
|
+
if (o = Object.keys(e), s = o.length, s !== Object.keys(t).length)
|
|
565
652
|
return !1;
|
|
566
653
|
for (r = s; r-- !== 0; )
|
|
567
|
-
if (!Object.prototype.hasOwnProperty.call(t,
|
|
654
|
+
if (!Object.prototype.hasOwnProperty.call(t, o[r]))
|
|
568
655
|
return !1;
|
|
569
656
|
for (r = s; r-- !== 0; ) {
|
|
570
|
-
var a =
|
|
571
|
-
if (!
|
|
657
|
+
var a = o[r];
|
|
658
|
+
if (!n(e[a], t[a]))
|
|
572
659
|
return !1;
|
|
573
660
|
}
|
|
574
661
|
return !0;
|
|
575
662
|
}
|
|
576
663
|
return e !== e && t !== t;
|
|
577
664
|
};
|
|
578
|
-
const
|
|
579
|
-
const r =
|
|
580
|
-
() => !!(
|
|
665
|
+
const $ = /* @__PURE__ */ Ke(Je), Ye = (n) => n === "Marker", Xe = (n) => n === ee, U = (n, e, t, s) => {
|
|
666
|
+
const r = y(), o = C(Z, y()), a = C(D, y()), l = C(Le, y()), i = J(
|
|
667
|
+
() => !!(l.value && a.value && (r.value instanceof a.value.Marker || r.value instanceof a.value[ee]))
|
|
581
668
|
);
|
|
582
669
|
return O(
|
|
583
|
-
[
|
|
584
|
-
(d, [u,
|
|
585
|
-
var p,
|
|
586
|
-
const h =
|
|
587
|
-
!
|
|
588
|
-
new a.value[
|
|
589
|
-
) :
|
|
590
|
-
new a.value[
|
|
591
|
-
) : r.value =
|
|
592
|
-
new a.value[
|
|
670
|
+
[o, t],
|
|
671
|
+
(d, [u, c]) => {
|
|
672
|
+
var p, m, f;
|
|
673
|
+
const h = !$(t.value, c) || o.value !== u;
|
|
674
|
+
!o.value || !a.value || !h || (r.value ? (r.value.setOptions(t.value), i.value && ((p = l.value) == null || p.removeMarker(r.value), (m = l.value) == null || m.addMarker(r.value))) : (Ye(n) ? r.value = I(
|
|
675
|
+
new a.value[n](t.value)
|
|
676
|
+
) : Xe(n) ? r.value = I(
|
|
677
|
+
new a.value[n](t.value)
|
|
678
|
+
) : r.value = I(
|
|
679
|
+
new a.value[n]({
|
|
593
680
|
...t.value,
|
|
594
|
-
map:
|
|
681
|
+
map: o.value
|
|
595
682
|
})
|
|
596
|
-
), i.value ? (
|
|
597
|
-
var
|
|
598
|
-
(
|
|
683
|
+
), i.value ? (f = l.value) == null || f.addMarker(r.value) : r.value.setMap(o.value), e.forEach((g) => {
|
|
684
|
+
var v;
|
|
685
|
+
(v = r.value) == null || v.addListener(g, (w) => s(g, w));
|
|
599
686
|
})));
|
|
600
687
|
},
|
|
601
688
|
{
|
|
602
689
|
immediate: !0
|
|
603
690
|
}
|
|
604
|
-
),
|
|
691
|
+
), B(() => {
|
|
605
692
|
var d, u;
|
|
606
|
-
r.value && ((d = a.value) == null || d.event.clearInstanceListeners(r.value), i.value ? (u =
|
|
693
|
+
r.value && ((d = a.value) == null || d.event.clearInstanceListeners(r.value), i.value ? (u = l.value) == null || u.removeMarker(r.value) : r.value.setMap(null));
|
|
607
694
|
}), r;
|
|
608
|
-
},
|
|
695
|
+
}, fe = [
|
|
609
696
|
"animation_changed",
|
|
610
697
|
"click",
|
|
611
698
|
"dblclick",
|
|
@@ -629,7 +716,7 @@ const A = /* @__PURE__ */ He(We), Ke = (o) => o === "Marker", Je = (o) => o ===
|
|
|
629
716
|
"shape_changed",
|
|
630
717
|
"title_changed",
|
|
631
718
|
"visible_changed"
|
|
632
|
-
],
|
|
719
|
+
], xt = P({
|
|
633
720
|
name: "Marker",
|
|
634
721
|
props: {
|
|
635
722
|
options: {
|
|
@@ -637,15 +724,15 @@ const A = /* @__PURE__ */ He(We), Ke = (o) => o === "Marker", Je = (o) => o ===
|
|
|
637
724
|
required: !0
|
|
638
725
|
}
|
|
639
726
|
},
|
|
640
|
-
emits:
|
|
641
|
-
setup(
|
|
642
|
-
const r =
|
|
643
|
-
return
|
|
727
|
+
emits: fe,
|
|
728
|
+
setup(n, { emit: e, expose: t, slots: s }) {
|
|
729
|
+
const r = N(n, "options"), o = U("Marker", fe, r, e);
|
|
730
|
+
return G(xe, o), t({ marker: o }), () => {
|
|
644
731
|
var a;
|
|
645
732
|
return (a = s.default) == null ? void 0 : a.call(s);
|
|
646
733
|
};
|
|
647
734
|
}
|
|
648
|
-
}),
|
|
735
|
+
}), Lt = P({
|
|
649
736
|
name: "Polyline",
|
|
650
737
|
props: {
|
|
651
738
|
options: {
|
|
@@ -653,13 +740,13 @@ const A = /* @__PURE__ */ He(We), Ke = (o) => o === "Marker", Je = (o) => o ===
|
|
|
653
740
|
required: !0
|
|
654
741
|
}
|
|
655
742
|
},
|
|
656
|
-
emits:
|
|
657
|
-
setup(
|
|
658
|
-
const t =
|
|
659
|
-
return { polyline:
|
|
743
|
+
emits: q,
|
|
744
|
+
setup(n, { emit: e }) {
|
|
745
|
+
const t = N(n, "options");
|
|
746
|
+
return { polyline: U("Polyline", q, t, e) };
|
|
660
747
|
},
|
|
661
748
|
render: () => null
|
|
662
|
-
}),
|
|
749
|
+
}), St = P({
|
|
663
750
|
name: "Polygon",
|
|
664
751
|
props: {
|
|
665
752
|
options: {
|
|
@@ -667,13 +754,13 @@ const A = /* @__PURE__ */ He(We), Ke = (o) => o === "Marker", Je = (o) => o ===
|
|
|
667
754
|
required: !0
|
|
668
755
|
}
|
|
669
756
|
},
|
|
670
|
-
emits:
|
|
671
|
-
setup(
|
|
672
|
-
const t =
|
|
673
|
-
return { polygon:
|
|
757
|
+
emits: q,
|
|
758
|
+
setup(n, { emit: e }) {
|
|
759
|
+
const t = N(n, "options");
|
|
760
|
+
return { polygon: U("Polygon", q, t, e) };
|
|
674
761
|
},
|
|
675
762
|
render: () => null
|
|
676
|
-
}),
|
|
763
|
+
}), me = q.concat(["bounds_changed"]), It = P({
|
|
677
764
|
name: "Rectangle",
|
|
678
765
|
props: {
|
|
679
766
|
options: {
|
|
@@ -681,13 +768,13 @@ const A = /* @__PURE__ */ He(We), Ke = (o) => o === "Marker", Je = (o) => o ===
|
|
|
681
768
|
required: !0
|
|
682
769
|
}
|
|
683
770
|
},
|
|
684
|
-
emits:
|
|
685
|
-
setup(
|
|
686
|
-
const t =
|
|
687
|
-
return { rectangle:
|
|
771
|
+
emits: me,
|
|
772
|
+
setup(n, { emit: e }) {
|
|
773
|
+
const t = N(n, "options");
|
|
774
|
+
return { rectangle: U("Rectangle", me, t, e) };
|
|
688
775
|
},
|
|
689
776
|
render: () => null
|
|
690
|
-
}),
|
|
777
|
+
}), ge = q.concat(["center_changed", "radius_changed"]), At = P({
|
|
691
778
|
name: "Circle",
|
|
692
779
|
props: {
|
|
693
780
|
options: {
|
|
@@ -695,13 +782,13 @@ const A = /* @__PURE__ */ He(We), Ke = (o) => o === "Marker", Je = (o) => o ===
|
|
|
695
782
|
required: !0
|
|
696
783
|
}
|
|
697
784
|
},
|
|
698
|
-
emits:
|
|
699
|
-
setup(
|
|
700
|
-
const t =
|
|
701
|
-
return { circle:
|
|
785
|
+
emits: ge,
|
|
786
|
+
setup(n, { emit: e }) {
|
|
787
|
+
const t = N(n, "options");
|
|
788
|
+
return { circle: U("Circle", ge, t, e) };
|
|
702
789
|
},
|
|
703
790
|
render: () => null
|
|
704
|
-
}),
|
|
791
|
+
}), Qe = P({
|
|
705
792
|
props: {
|
|
706
793
|
position: {
|
|
707
794
|
type: String,
|
|
@@ -713,111 +800,117 @@ const A = /* @__PURE__ */ He(We), Ke = (o) => o === "Marker", Je = (o) => o ===
|
|
|
713
800
|
}
|
|
714
801
|
},
|
|
715
802
|
emits: ["content:loaded"],
|
|
716
|
-
setup(
|
|
717
|
-
const t =
|
|
718
|
-
[
|
|
719
|
-
([u,
|
|
720
|
-
|
|
803
|
+
setup(n, { emit: e }) {
|
|
804
|
+
const t = y(null), s = C(Z, y()), r = C(D, y()), o = C(Se, y(!1)), a = y(!1), l = O(
|
|
805
|
+
[o, r, t],
|
|
806
|
+
([u, c, h]) => {
|
|
807
|
+
c && u && h && (i(n.position), a.value = !0, e("content:loaded"), setTimeout(l, 0));
|
|
721
808
|
},
|
|
722
809
|
{ immediate: !0 }
|
|
723
810
|
), i = (u) => {
|
|
724
811
|
if (s.value && r.value && t.value) {
|
|
725
|
-
const
|
|
726
|
-
s.value.controls[
|
|
812
|
+
const c = r.value.ControlPosition[u];
|
|
813
|
+
s.value.controls[c].push(t.value);
|
|
727
814
|
}
|
|
728
815
|
}, d = (u) => {
|
|
729
816
|
if (s.value && r.value) {
|
|
730
|
-
let
|
|
817
|
+
let c = null;
|
|
731
818
|
const h = r.value.ControlPosition[u];
|
|
732
|
-
s.value.controls[h].forEach((p,
|
|
733
|
-
p === t.value && (
|
|
734
|
-
}),
|
|
819
|
+
s.value.controls[h].forEach((p, m) => {
|
|
820
|
+
p === t.value && (c = m);
|
|
821
|
+
}), c !== null && s.value.controls[h].removeAt(c);
|
|
735
822
|
}
|
|
736
823
|
};
|
|
737
|
-
return
|
|
738
|
-
() =>
|
|
739
|
-
(u,
|
|
740
|
-
d(
|
|
824
|
+
return B(() => d(n.position)), O(
|
|
825
|
+
() => n.position,
|
|
826
|
+
(u, c) => {
|
|
827
|
+
d(c), i(u);
|
|
741
828
|
}
|
|
742
829
|
), O(
|
|
743
|
-
() =>
|
|
830
|
+
() => n.index,
|
|
744
831
|
(u) => {
|
|
745
|
-
u && t.value && (t.value.index =
|
|
832
|
+
u && t.value && (t.value.index = n.index);
|
|
746
833
|
}
|
|
747
834
|
), { controlRef: t, showContent: a };
|
|
748
835
|
}
|
|
749
|
-
}),
|
|
750
|
-
function
|
|
751
|
-
return
|
|
752
|
-
|
|
836
|
+
}), et = { ref: "controlRef" };
|
|
837
|
+
function tt(n, e, t, s, r, o) {
|
|
838
|
+
return De((Y(), X("div", et, [
|
|
839
|
+
Q(n.$slots, "default")
|
|
753
840
|
], 512)), [
|
|
754
|
-
[
|
|
841
|
+
[Ue, n.showContent]
|
|
755
842
|
]);
|
|
756
843
|
}
|
|
757
|
-
const
|
|
844
|
+
const Tt = /* @__PURE__ */ te(Qe, [["render", tt]]), ve = ["closeclick", "content_changed", "domready", "position_changed", "visible", "zindex_changed"], st = P({
|
|
758
845
|
inheritAttrs: !1,
|
|
759
846
|
props: {
|
|
760
847
|
options: {
|
|
761
848
|
type: Object,
|
|
762
849
|
default: () => ({})
|
|
850
|
+
},
|
|
851
|
+
modelValue: {
|
|
852
|
+
type: Boolean
|
|
763
853
|
}
|
|
764
854
|
},
|
|
765
|
-
emits:
|
|
766
|
-
setup(
|
|
767
|
-
const r =
|
|
768
|
-
let d;
|
|
769
|
-
const
|
|
770
|
-
var p;
|
|
771
|
-
return (p = e.default) == null ? void 0 : p.call(e).some((f) => f.type !== be);
|
|
772
|
-
}), l = (p) => {
|
|
855
|
+
emits: [...ve, "update:modelValue"],
|
|
856
|
+
setup(n, { slots: e, emit: t, expose: s }) {
|
|
857
|
+
const r = y(), o = y(), a = C(Z, y()), l = C(D, y()), i = C(xe, y());
|
|
858
|
+
let d, u = n.modelValue;
|
|
859
|
+
const c = J(() => {
|
|
773
860
|
var f;
|
|
774
|
-
return (f =
|
|
775
|
-
}, h = () => {
|
|
776
|
-
|
|
777
|
-
|
|
861
|
+
return (f = e.default) == null ? void 0 : f.call(e).some((g) => g.type !== Ee);
|
|
862
|
+
}), h = (f) => {
|
|
863
|
+
u = f, t("update:modelValue", f);
|
|
864
|
+
}, p = (f) => {
|
|
865
|
+
r.value && (r.value.open({ map: a.value, anchor: i.value, ...f }), h(!0));
|
|
866
|
+
}, m = () => {
|
|
867
|
+
r.value && (r.value.close(), h(!1));
|
|
778
868
|
};
|
|
779
869
|
return Me(() => {
|
|
780
870
|
O(
|
|
781
|
-
[a, () =>
|
|
782
|
-
([
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
871
|
+
[a, () => n.options],
|
|
872
|
+
([f, g], [v, w]) => {
|
|
873
|
+
var E;
|
|
874
|
+
const _ = !$(g, w) || a.value !== v;
|
|
875
|
+
a.value && l.value && _ && (r.value ? (r.value.setOptions({
|
|
876
|
+
...g,
|
|
877
|
+
content: c.value ? o.value : g.content
|
|
878
|
+
}), i.value || p()) : (r.value = I(
|
|
879
|
+
new l.value.InfoWindow({
|
|
880
|
+
...g,
|
|
881
|
+
content: c.value ? o.value : g.content
|
|
791
882
|
})
|
|
792
|
-
), i.value
|
|
793
|
-
|
|
794
|
-
})
|
|
795
|
-
var
|
|
796
|
-
(
|
|
797
|
-
})));
|
|
883
|
+
), i.value && (d = i.value.addListener("click", () => {
|
|
884
|
+
p();
|
|
885
|
+
})), (!i.value || u) && p(), ve.forEach((b) => {
|
|
886
|
+
var x;
|
|
887
|
+
(x = r.value) == null || x.addListener(b, (M) => t(b, M));
|
|
888
|
+
}), (E = r.value) == null || E.addListener("closeclick", () => h(!1))));
|
|
798
889
|
},
|
|
799
890
|
{
|
|
800
891
|
immediate: !0
|
|
801
892
|
}
|
|
802
|
-
)
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
893
|
+
), O(() => n.modelValue, (f) => {
|
|
894
|
+
f !== u && (f ? p() : m());
|
|
895
|
+
});
|
|
896
|
+
}), B(() => {
|
|
897
|
+
var f;
|
|
898
|
+
d && d.remove(), r.value && ((f = l.value) == null || f.event.clearInstanceListeners(r.value), m());
|
|
899
|
+
}), s({ infoWindow: r, open: p, close: m }), { infoWindow: r, infoWindowRef: o, hasSlotContent: c, open: p, close: m };
|
|
807
900
|
}
|
|
808
901
|
});
|
|
809
|
-
const
|
|
902
|
+
const rt = {
|
|
810
903
|
key: 0,
|
|
811
904
|
class: "info-window-wrapper"
|
|
812
905
|
};
|
|
813
|
-
function
|
|
814
|
-
return
|
|
815
|
-
|
|
816
|
-
|
|
906
|
+
function nt(n, e, t, s, r, o) {
|
|
907
|
+
return n.hasSlotContent ? (Y(), X("div", rt, [
|
|
908
|
+
ae("div", Pe({ ref: "infoWindowRef" }, n.$attrs), [
|
|
909
|
+
Q(n.$slots, "default", {}, void 0, !0)
|
|
817
910
|
], 16)
|
|
818
|
-
])) :
|
|
911
|
+
])) : Oe("", !0);
|
|
819
912
|
}
|
|
820
|
-
const
|
|
913
|
+
const $t = /* @__PURE__ */ te(st, [["render", nt], ["__scopeId", "data-v-90174664"]]), ye = [
|
|
821
914
|
Int8Array,
|
|
822
915
|
Uint8Array,
|
|
823
916
|
Uint8ClampedArray,
|
|
@@ -827,8 +920,8 @@ const Tt = /* @__PURE__ */ ee(et, [["render", st], ["__scopeId", "data-v-45a4606
|
|
|
827
920
|
Uint32Array,
|
|
828
921
|
Float32Array,
|
|
829
922
|
Float64Array
|
|
830
|
-
],
|
|
831
|
-
class
|
|
923
|
+
], re = 1, V = 8;
|
|
924
|
+
class le {
|
|
832
925
|
/**
|
|
833
926
|
* Creates an index from raw `ArrayBuffer` data.
|
|
834
927
|
* @param {ArrayBuffer} data
|
|
@@ -840,13 +933,13 @@ class ae {
|
|
|
840
933
|
if (t !== 219)
|
|
841
934
|
throw new Error("Data does not appear to be in a KDBush format.");
|
|
842
935
|
const r = s >> 4;
|
|
843
|
-
if (r !==
|
|
844
|
-
throw new Error(`Got v${r} data when expected v${
|
|
845
|
-
const
|
|
846
|
-
if (!
|
|
936
|
+
if (r !== re)
|
|
937
|
+
throw new Error(`Got v${r} data when expected v${re}.`);
|
|
938
|
+
const o = ye[s & 15];
|
|
939
|
+
if (!o)
|
|
847
940
|
throw new Error("Unrecognized array type.");
|
|
848
|
-
const [a] = new Uint16Array(e, 2, 1), [
|
|
849
|
-
return new
|
|
941
|
+
const [a] = new Uint16Array(e, 2, 1), [l] = new Uint32Array(e, 4, 1);
|
|
942
|
+
return new le(l, a, o, e);
|
|
850
943
|
}
|
|
851
944
|
/**
|
|
852
945
|
* Creates an index that will hold a given number of items.
|
|
@@ -859,10 +952,10 @@ class ae {
|
|
|
859
952
|
if (isNaN(e) || e < 0)
|
|
860
953
|
throw new Error(`Unpexpected numItems value: ${e}.`);
|
|
861
954
|
this.numItems = +e, this.nodeSize = Math.min(Math.max(+t, 2), 65535), this.ArrayType = s, this.IndexArrayType = e < 65536 ? Uint16Array : Uint32Array;
|
|
862
|
-
const
|
|
863
|
-
if (
|
|
955
|
+
const o = ye.indexOf(this.ArrayType), a = e * 2 * this.ArrayType.BYTES_PER_ELEMENT, l = e * this.IndexArrayType.BYTES_PER_ELEMENT, i = (8 - l % 8) % 8;
|
|
956
|
+
if (o < 0)
|
|
864
957
|
throw new Error(`Unexpected typed array class: ${s}.`);
|
|
865
|
-
r && r instanceof ArrayBuffer ? (this.data = r, this.ids = new this.IndexArrayType(this.data,
|
|
958
|
+
r && r instanceof ArrayBuffer ? (this.data = r, this.ids = new this.IndexArrayType(this.data, V, e), this.coords = new this.ArrayType(this.data, V + l + i, e * 2), this._pos = e * 2, this._finished = !0) : (this.data = new ArrayBuffer(V + a + l + i), this.ids = new this.IndexArrayType(this.data, V, e), this.coords = new this.ArrayType(this.data, V + l + i, e * 2), this._pos = 0, this._finished = !1, new Uint8Array(this.data, 0, 2).set([219, (re << 4) + o]), new Uint16Array(this.data, 2, 1)[0] = t, new Uint32Array(this.data, 4, 1)[0] = e);
|
|
866
959
|
}
|
|
867
960
|
/**
|
|
868
961
|
* Add a point to the index.
|
|
@@ -881,7 +974,7 @@ class ae {
|
|
|
881
974
|
const e = this._pos >> 1;
|
|
882
975
|
if (e !== this.numItems)
|
|
883
976
|
throw new Error(`Added ${e} items when expected ${this.numItems}.`);
|
|
884
|
-
return
|
|
977
|
+
return ie(this.ids, this.coords, this.nodeSize, 0, this.numItems - 1, 0), this._finished = !0, this;
|
|
885
978
|
}
|
|
886
979
|
/**
|
|
887
980
|
* Search the index for items within a given bounding box.
|
|
@@ -894,18 +987,18 @@ class ae {
|
|
|
894
987
|
range(e, t, s, r) {
|
|
895
988
|
if (!this._finished)
|
|
896
989
|
throw new Error("Data not yet indexed - call index.finish().");
|
|
897
|
-
const { ids:
|
|
990
|
+
const { ids: o, coords: a, nodeSize: l } = this, i = [0, o.length - 1, 0], d = [];
|
|
898
991
|
for (; i.length; ) {
|
|
899
|
-
const u = i.pop() || 0,
|
|
900
|
-
if (
|
|
901
|
-
for (let g = h; g <=
|
|
902
|
-
const
|
|
903
|
-
|
|
992
|
+
const u = i.pop() || 0, c = i.pop() || 0, h = i.pop() || 0;
|
|
993
|
+
if (c - h <= l) {
|
|
994
|
+
for (let g = h; g <= c; g++) {
|
|
995
|
+
const v = a[2 * g], w = a[2 * g + 1];
|
|
996
|
+
v >= e && v <= s && w >= t && w <= r && d.push(o[g]);
|
|
904
997
|
}
|
|
905
998
|
continue;
|
|
906
999
|
}
|
|
907
|
-
const p = h +
|
|
908
|
-
|
|
1000
|
+
const p = h + c >> 1, m = a[2 * p], f = a[2 * p + 1];
|
|
1001
|
+
m >= e && m <= s && f >= t && f <= r && d.push(o[p]), (u === 0 ? e <= m : t <= f) && (i.push(h), i.push(p - 1), i.push(1 - u)), (u === 0 ? s >= m : r >= f) && (i.push(p + 1), i.push(c), i.push(1 - u));
|
|
909
1002
|
}
|
|
910
1003
|
return d;
|
|
911
1004
|
}
|
|
@@ -919,55 +1012,55 @@ class ae {
|
|
|
919
1012
|
within(e, t, s) {
|
|
920
1013
|
if (!this._finished)
|
|
921
1014
|
throw new Error("Data not yet indexed - call index.finish().");
|
|
922
|
-
const { ids: r, coords:
|
|
923
|
-
for (;
|
|
924
|
-
const u =
|
|
925
|
-
if (
|
|
926
|
-
for (let g = h; g <=
|
|
927
|
-
|
|
1015
|
+
const { ids: r, coords: o, nodeSize: a } = this, l = [0, r.length - 1, 0], i = [], d = s * s;
|
|
1016
|
+
for (; l.length; ) {
|
|
1017
|
+
const u = l.pop() || 0, c = l.pop() || 0, h = l.pop() || 0;
|
|
1018
|
+
if (c - h <= a) {
|
|
1019
|
+
for (let g = h; g <= c; g++)
|
|
1020
|
+
we(o[2 * g], o[2 * g + 1], e, t) <= d && i.push(r[g]);
|
|
928
1021
|
continue;
|
|
929
1022
|
}
|
|
930
|
-
const p = h +
|
|
931
|
-
|
|
1023
|
+
const p = h + c >> 1, m = o[2 * p], f = o[2 * p + 1];
|
|
1024
|
+
we(m, f, e, t) <= d && i.push(r[p]), (u === 0 ? e - s <= m : t - s <= f) && (l.push(h), l.push(p - 1), l.push(1 - u)), (u === 0 ? e + s >= m : t + s >= f) && (l.push(p + 1), l.push(c), l.push(1 - u));
|
|
932
1025
|
}
|
|
933
1026
|
return i;
|
|
934
1027
|
}
|
|
935
1028
|
}
|
|
936
|
-
function
|
|
1029
|
+
function ie(n, e, t, s, r, o) {
|
|
937
1030
|
if (r - s <= t)
|
|
938
1031
|
return;
|
|
939
1032
|
const a = s + r >> 1;
|
|
940
|
-
|
|
1033
|
+
Ie(n, e, a, s, r, o), ie(n, e, t, s, a - 1, 1 - o), ie(n, e, t, a + 1, r, 1 - o);
|
|
941
1034
|
}
|
|
942
|
-
function
|
|
1035
|
+
function Ie(n, e, t, s, r, o) {
|
|
943
1036
|
for (; r > s; ) {
|
|
944
1037
|
if (r - s > 600) {
|
|
945
|
-
const d = r - s + 1, u = t - s + 1,
|
|
946
|
-
|
|
1038
|
+
const d = r - s + 1, u = t - s + 1, c = Math.log(d), h = 0.5 * Math.exp(2 * c / 3), p = 0.5 * Math.sqrt(c * h * (d - h) / d) * (u - d / 2 < 0 ? -1 : 1), m = Math.max(s, Math.floor(t - u * h / d + p)), f = Math.min(r, Math.floor(t + (d - u) * h / d + p));
|
|
1039
|
+
Ie(n, e, t, m, f, o);
|
|
947
1040
|
}
|
|
948
|
-
const a = e[2 * t +
|
|
949
|
-
let
|
|
950
|
-
for (
|
|
951
|
-
for (
|
|
952
|
-
|
|
953
|
-
for (; e[2 * i +
|
|
1041
|
+
const a = e[2 * t + o];
|
|
1042
|
+
let l = s, i = r;
|
|
1043
|
+
for (z(n, e, s, t), e[2 * r + o] > a && z(n, e, s, r); l < i; ) {
|
|
1044
|
+
for (z(n, e, l, i), l++, i--; e[2 * l + o] < a; )
|
|
1045
|
+
l++;
|
|
1046
|
+
for (; e[2 * i + o] > a; )
|
|
954
1047
|
i--;
|
|
955
1048
|
}
|
|
956
|
-
e[2 * s +
|
|
1049
|
+
e[2 * s + o] === a ? z(n, e, s, i) : (i++, z(n, e, i, r)), i <= t && (s = i + 1), t <= i && (r = i - 1);
|
|
957
1050
|
}
|
|
958
1051
|
}
|
|
959
|
-
function
|
|
960
|
-
|
|
1052
|
+
function z(n, e, t, s) {
|
|
1053
|
+
ne(n, t, s), ne(e, 2 * t, 2 * s), ne(e, 2 * t + 1, 2 * s + 1);
|
|
961
1054
|
}
|
|
962
|
-
function
|
|
963
|
-
const s =
|
|
964
|
-
|
|
1055
|
+
function ne(n, e, t) {
|
|
1056
|
+
const s = n[e];
|
|
1057
|
+
n[e] = n[t], n[t] = s;
|
|
965
1058
|
}
|
|
966
|
-
function
|
|
967
|
-
const r =
|
|
968
|
-
return r * r +
|
|
1059
|
+
function we(n, e, t, s) {
|
|
1060
|
+
const r = n - t, o = e - s;
|
|
1061
|
+
return r * r + o * o;
|
|
969
1062
|
}
|
|
970
|
-
const
|
|
1063
|
+
const ot = {
|
|
971
1064
|
minZoom: 0,
|
|
972
1065
|
// min zoom to generate clusters on
|
|
973
1066
|
maxZoom: 16,
|
|
@@ -988,24 +1081,24 @@ const rt = {
|
|
|
988
1081
|
reduce: null,
|
|
989
1082
|
// (accumulated, props) => { accumulated.sum += props.sum; }
|
|
990
1083
|
// properties to use for individual points when running the reducer
|
|
991
|
-
map: (
|
|
1084
|
+
map: (n) => n
|
|
992
1085
|
// props => ({sum: props.my_value})
|
|
993
|
-
},
|
|
1086
|
+
}, _e = Math.fround || ((n) => (e) => (n[0] = +e, n[0]))(new Float32Array(1)), A = 2, S = 3, oe = 4, L = 5, Ae = 6;
|
|
994
1087
|
class Te {
|
|
995
1088
|
constructor(e) {
|
|
996
|
-
this.options = Object.assign(Object.create(
|
|
1089
|
+
this.options = Object.assign(Object.create(ot), e), this.trees = new Array(this.options.maxZoom + 1), this.stride = this.options.reduce ? 7 : 6, this.clusterProps = [];
|
|
997
1090
|
}
|
|
998
1091
|
load(e) {
|
|
999
1092
|
const { log: t, minZoom: s, maxZoom: r } = this.options;
|
|
1000
1093
|
t && console.time("total time");
|
|
1001
|
-
const
|
|
1002
|
-
t && console.time(
|
|
1094
|
+
const o = `prepare ${e.length} points`;
|
|
1095
|
+
t && console.time(o), this.points = e;
|
|
1003
1096
|
const a = [];
|
|
1004
1097
|
for (let i = 0; i < e.length; i++) {
|
|
1005
1098
|
const d = e[i];
|
|
1006
1099
|
if (!d.geometry)
|
|
1007
1100
|
continue;
|
|
1008
|
-
const [u,
|
|
1101
|
+
const [u, c] = d.geometry.coordinates, h = _e(W(u)), p = _e(K(c));
|
|
1009
1102
|
a.push(
|
|
1010
1103
|
h,
|
|
1011
1104
|
p,
|
|
@@ -1020,47 +1113,47 @@ class Te {
|
|
|
1020
1113
|
// number of points in a cluster
|
|
1021
1114
|
), this.options.reduce && a.push(0);
|
|
1022
1115
|
}
|
|
1023
|
-
let
|
|
1024
|
-
t && console.timeEnd(
|
|
1116
|
+
let l = this.trees[r + 1] = this._createTree(a);
|
|
1117
|
+
t && console.timeEnd(o);
|
|
1025
1118
|
for (let i = r; i >= s; i--) {
|
|
1026
1119
|
const d = +Date.now();
|
|
1027
|
-
|
|
1120
|
+
l = this.trees[i] = this._createTree(this._cluster(l, i)), t && console.log("z%d: %d clusters in %dms", i, l.numItems, +Date.now() - d);
|
|
1028
1121
|
}
|
|
1029
1122
|
return t && console.timeEnd("total time"), this;
|
|
1030
1123
|
}
|
|
1031
1124
|
getClusters(e, t) {
|
|
1032
1125
|
let s = ((e[0] + 180) % 360 + 360) % 360 - 180;
|
|
1033
1126
|
const r = Math.max(-90, Math.min(90, e[1]));
|
|
1034
|
-
let
|
|
1127
|
+
let o = e[2] === 180 ? 180 : ((e[2] + 180) % 360 + 360) % 360 - 180;
|
|
1035
1128
|
const a = Math.max(-90, Math.min(90, e[3]));
|
|
1036
1129
|
if (e[2] - e[0] >= 360)
|
|
1037
|
-
s = -180,
|
|
1038
|
-
else if (s >
|
|
1039
|
-
const
|
|
1040
|
-
return
|
|
1130
|
+
s = -180, o = 180;
|
|
1131
|
+
else if (s > o) {
|
|
1132
|
+
const c = this.getClusters([s, r, 180, a], t), h = this.getClusters([-180, r, o, a], t);
|
|
1133
|
+
return c.concat(h);
|
|
1041
1134
|
}
|
|
1042
|
-
const
|
|
1043
|
-
for (const
|
|
1044
|
-
const h = this.stride *
|
|
1045
|
-
u.push(d[h +
|
|
1135
|
+
const l = this.trees[this._limitZoom(t)], i = l.range(W(s), K(a), W(o), K(r)), d = l.data, u = [];
|
|
1136
|
+
for (const c of i) {
|
|
1137
|
+
const h = this.stride * c;
|
|
1138
|
+
u.push(d[h + L] > 1 ? ke(d, h, this.clusterProps) : this.points[d[h + S]]);
|
|
1046
1139
|
}
|
|
1047
1140
|
return u;
|
|
1048
1141
|
}
|
|
1049
1142
|
getChildren(e) {
|
|
1050
|
-
const t = this._getOriginId(e), s = this._getOriginZoom(e), r = "No cluster with the specified id.",
|
|
1051
|
-
if (!
|
|
1143
|
+
const t = this._getOriginId(e), s = this._getOriginZoom(e), r = "No cluster with the specified id.", o = this.trees[s];
|
|
1144
|
+
if (!o)
|
|
1052
1145
|
throw new Error(r);
|
|
1053
|
-
const a =
|
|
1146
|
+
const a = o.data;
|
|
1054
1147
|
if (t * this.stride >= a.length)
|
|
1055
1148
|
throw new Error(r);
|
|
1056
|
-
const
|
|
1149
|
+
const l = this.options.radius / (this.options.extent * Math.pow(2, s - 1)), i = a[t * this.stride], d = a[t * this.stride + 1], u = o.within(i, d, l), c = [];
|
|
1057
1150
|
for (const h of u) {
|
|
1058
1151
|
const p = h * this.stride;
|
|
1059
|
-
a[p + oe] === e &&
|
|
1152
|
+
a[p + oe] === e && c.push(a[p + L] > 1 ? ke(a, p, this.clusterProps) : this.points[a[p + S]]);
|
|
1060
1153
|
}
|
|
1061
|
-
if (
|
|
1154
|
+
if (c.length === 0)
|
|
1062
1155
|
throw new Error(r);
|
|
1063
|
-
return
|
|
1156
|
+
return c;
|
|
1064
1157
|
}
|
|
1065
1158
|
getLeaves(e, t, s) {
|
|
1066
1159
|
t = t || 10, s = s || 0;
|
|
@@ -1068,31 +1161,31 @@ class Te {
|
|
|
1068
1161
|
return this._appendLeaves(r, e, t, s, 0), r;
|
|
1069
1162
|
}
|
|
1070
1163
|
getTile(e, t, s) {
|
|
1071
|
-
const r = this.trees[this._limitZoom(e)],
|
|
1164
|
+
const r = this.trees[this._limitZoom(e)], o = Math.pow(2, e), { extent: a, radius: l } = this.options, i = l / a, d = (s - i) / o, u = (s + 1 + i) / o, c = {
|
|
1072
1165
|
features: []
|
|
1073
1166
|
};
|
|
1074
1167
|
return this._addTileFeatures(
|
|
1075
|
-
r.range((t - i) /
|
|
1168
|
+
r.range((t - i) / o, d, (t + 1 + i) / o, u),
|
|
1076
1169
|
r.data,
|
|
1077
1170
|
t,
|
|
1078
1171
|
s,
|
|
1079
|
-
|
|
1080
|
-
|
|
1172
|
+
o,
|
|
1173
|
+
c
|
|
1081
1174
|
), t === 0 && this._addTileFeatures(
|
|
1082
|
-
r.range(1 - i /
|
|
1175
|
+
r.range(1 - i / o, d, 1, u),
|
|
1083
1176
|
r.data,
|
|
1084
|
-
|
|
1177
|
+
o,
|
|
1085
1178
|
s,
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
), t ===
|
|
1089
|
-
r.range(0, d, i /
|
|
1179
|
+
o,
|
|
1180
|
+
c
|
|
1181
|
+
), t === o - 1 && this._addTileFeatures(
|
|
1182
|
+
r.range(0, d, i / o, u),
|
|
1090
1183
|
r.data,
|
|
1091
1184
|
-1,
|
|
1092
1185
|
s,
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
),
|
|
1186
|
+
o,
|
|
1187
|
+
c
|
|
1188
|
+
), c.features.length ? c : null;
|
|
1096
1189
|
}
|
|
1097
1190
|
getClusterExpansionZoom(e) {
|
|
1098
1191
|
let t = this._getOriginZoom(e) - 1;
|
|
@@ -1104,82 +1197,82 @@ class Te {
|
|
|
1104
1197
|
}
|
|
1105
1198
|
return t;
|
|
1106
1199
|
}
|
|
1107
|
-
_appendLeaves(e, t, s, r,
|
|
1200
|
+
_appendLeaves(e, t, s, r, o) {
|
|
1108
1201
|
const a = this.getChildren(t);
|
|
1109
|
-
for (const
|
|
1110
|
-
const i =
|
|
1111
|
-
if (i && i.cluster ?
|
|
1202
|
+
for (const l of a) {
|
|
1203
|
+
const i = l.properties;
|
|
1204
|
+
if (i && i.cluster ? o + i.point_count <= r ? o += i.point_count : o = this._appendLeaves(e, i.cluster_id, s, r, o) : o < r ? o++ : e.push(l), e.length === s)
|
|
1112
1205
|
break;
|
|
1113
1206
|
}
|
|
1114
|
-
return
|
|
1207
|
+
return o;
|
|
1115
1208
|
}
|
|
1116
1209
|
_createTree(e) {
|
|
1117
|
-
const t = new
|
|
1210
|
+
const t = new le(e.length / this.stride | 0, this.options.nodeSize, Float32Array);
|
|
1118
1211
|
for (let s = 0; s < e.length; s += this.stride)
|
|
1119
1212
|
t.add(e[s], e[s + 1]);
|
|
1120
1213
|
return t.finish(), t.data = e, t;
|
|
1121
1214
|
}
|
|
1122
|
-
_addTileFeatures(e, t, s, r,
|
|
1123
|
-
for (const
|
|
1124
|
-
const i =
|
|
1125
|
-
let u,
|
|
1215
|
+
_addTileFeatures(e, t, s, r, o, a) {
|
|
1216
|
+
for (const l of e) {
|
|
1217
|
+
const i = l * this.stride, d = t[i + L] > 1;
|
|
1218
|
+
let u, c, h;
|
|
1126
1219
|
if (d)
|
|
1127
|
-
u =
|
|
1220
|
+
u = $e(t, i, this.clusterProps), c = t[i], h = t[i + 1];
|
|
1128
1221
|
else {
|
|
1129
|
-
const
|
|
1130
|
-
u =
|
|
1131
|
-
const [g,
|
|
1132
|
-
|
|
1222
|
+
const f = this.points[t[i + S]];
|
|
1223
|
+
u = f.properties;
|
|
1224
|
+
const [g, v] = f.geometry.coordinates;
|
|
1225
|
+
c = W(g), h = K(v);
|
|
1133
1226
|
}
|
|
1134
1227
|
const p = {
|
|
1135
1228
|
type: 1,
|
|
1136
1229
|
geometry: [[
|
|
1137
|
-
Math.round(this.options.extent * (
|
|
1138
|
-
Math.round(this.options.extent * (h *
|
|
1230
|
+
Math.round(this.options.extent * (c * o - s)),
|
|
1231
|
+
Math.round(this.options.extent * (h * o - r))
|
|
1139
1232
|
]],
|
|
1140
1233
|
tags: u
|
|
1141
1234
|
};
|
|
1142
|
-
let
|
|
1143
|
-
d || this.options.generateId ?
|
|
1235
|
+
let m;
|
|
1236
|
+
d || this.options.generateId ? m = t[i + S] : m = this.points[t[i + S]].id, m !== void 0 && (p.id = m), a.features.push(p);
|
|
1144
1237
|
}
|
|
1145
1238
|
}
|
|
1146
1239
|
_limitZoom(e) {
|
|
1147
1240
|
return Math.max(this.options.minZoom, Math.min(Math.floor(+e), this.options.maxZoom + 1));
|
|
1148
1241
|
}
|
|
1149
1242
|
_cluster(e, t) {
|
|
1150
|
-
const { radius: s, extent: r, reduce:
|
|
1151
|
-
for (let
|
|
1152
|
-
if (i[
|
|
1243
|
+
const { radius: s, extent: r, reduce: o, minPoints: a } = this.options, l = s / (r * Math.pow(2, t)), i = e.data, d = [], u = this.stride;
|
|
1244
|
+
for (let c = 0; c < i.length; c += u) {
|
|
1245
|
+
if (i[c + A] <= t)
|
|
1153
1246
|
continue;
|
|
1154
|
-
i[
|
|
1155
|
-
const h = i[
|
|
1156
|
-
let g =
|
|
1157
|
-
for (const
|
|
1158
|
-
const w =
|
|
1159
|
-
i[w +
|
|
1247
|
+
i[c + A] = t;
|
|
1248
|
+
const h = i[c], p = i[c + 1], m = e.within(i[c], i[c + 1], l), f = i[c + L];
|
|
1249
|
+
let g = f;
|
|
1250
|
+
for (const v of m) {
|
|
1251
|
+
const w = v * u;
|
|
1252
|
+
i[w + A] > t && (g += i[w + L]);
|
|
1160
1253
|
}
|
|
1161
|
-
if (g >
|
|
1162
|
-
let
|
|
1163
|
-
const
|
|
1164
|
-
for (const
|
|
1165
|
-
const
|
|
1166
|
-
if (i[
|
|
1254
|
+
if (g > f && g >= a) {
|
|
1255
|
+
let v = h * f, w = p * f, _, E = -1;
|
|
1256
|
+
const b = ((c / u | 0) << 5) + (t + 1) + this.points.length;
|
|
1257
|
+
for (const x of m) {
|
|
1258
|
+
const M = x * u;
|
|
1259
|
+
if (i[M + A] <= t)
|
|
1167
1260
|
continue;
|
|
1168
|
-
i[
|
|
1169
|
-
const F = i[
|
|
1170
|
-
|
|
1261
|
+
i[M + A] = t;
|
|
1262
|
+
const F = i[M + L];
|
|
1263
|
+
v += i[M] * F, w += i[M + 1] * F, i[M + oe] = b, o && (_ || (_ = this._map(i, c, !0), E = this.clusterProps.length, this.clusterProps.push(_)), o(_, this._map(i, M)));
|
|
1171
1264
|
}
|
|
1172
|
-
i[
|
|
1265
|
+
i[c + oe] = b, d.push(v / g, w / g, 1 / 0, b, -1, g), o && d.push(E);
|
|
1173
1266
|
} else {
|
|
1174
|
-
for (let
|
|
1175
|
-
d.push(i[
|
|
1267
|
+
for (let v = 0; v < u; v++)
|
|
1268
|
+
d.push(i[c + v]);
|
|
1176
1269
|
if (g > 1)
|
|
1177
|
-
for (const
|
|
1178
|
-
const w =
|
|
1179
|
-
if (!(i[w +
|
|
1180
|
-
i[w +
|
|
1181
|
-
for (let
|
|
1182
|
-
d.push(i[w +
|
|
1270
|
+
for (const v of m) {
|
|
1271
|
+
const w = v * u;
|
|
1272
|
+
if (!(i[w + A] <= t)) {
|
|
1273
|
+
i[w + A] = t;
|
|
1274
|
+
for (let _ = 0; _ < u; _++)
|
|
1275
|
+
d.push(i[w + _]);
|
|
1183
1276
|
}
|
|
1184
1277
|
}
|
|
1185
1278
|
}
|
|
@@ -1195,46 +1288,46 @@ class Te {
|
|
|
1195
1288
|
return (e - this.points.length) % 32;
|
|
1196
1289
|
}
|
|
1197
1290
|
_map(e, t, s) {
|
|
1198
|
-
if (e[t +
|
|
1291
|
+
if (e[t + L] > 1) {
|
|
1199
1292
|
const a = this.clusterProps[e[t + Ae]];
|
|
1200
1293
|
return s ? Object.assign({}, a) : a;
|
|
1201
1294
|
}
|
|
1202
|
-
const r = this.points[e[t +
|
|
1203
|
-
return s &&
|
|
1295
|
+
const r = this.points[e[t + S]].properties, o = this.options.map(r);
|
|
1296
|
+
return s && o === r ? Object.assign({}, o) : o;
|
|
1204
1297
|
}
|
|
1205
1298
|
}
|
|
1206
|
-
function ke(
|
|
1299
|
+
function ke(n, e, t) {
|
|
1207
1300
|
return {
|
|
1208
1301
|
type: "Feature",
|
|
1209
|
-
id:
|
|
1210
|
-
properties:
|
|
1302
|
+
id: n[e + S],
|
|
1303
|
+
properties: $e(n, e, t),
|
|
1211
1304
|
geometry: {
|
|
1212
1305
|
type: "Point",
|
|
1213
|
-
coordinates: [
|
|
1306
|
+
coordinates: [it(n[e]), at(n[e + 1])]
|
|
1214
1307
|
}
|
|
1215
1308
|
};
|
|
1216
1309
|
}
|
|
1217
|
-
function
|
|
1218
|
-
const s =
|
|
1310
|
+
function $e(n, e, t) {
|
|
1311
|
+
const s = n[e + L], r = s >= 1e4 ? `${Math.round(s / 1e3)}k` : s >= 1e3 ? `${Math.round(s / 100) / 10}k` : s, o = n[e + Ae], a = o === -1 ? {} : Object.assign({}, t[o]);
|
|
1219
1312
|
return Object.assign(a, {
|
|
1220
1313
|
cluster: !0,
|
|
1221
|
-
cluster_id:
|
|
1314
|
+
cluster_id: n[e + S],
|
|
1222
1315
|
point_count: s,
|
|
1223
1316
|
point_count_abbreviated: r
|
|
1224
1317
|
});
|
|
1225
1318
|
}
|
|
1226
|
-
function
|
|
1227
|
-
return
|
|
1319
|
+
function W(n) {
|
|
1320
|
+
return n / 360 + 0.5;
|
|
1228
1321
|
}
|
|
1229
|
-
function
|
|
1230
|
-
const e = Math.sin(
|
|
1322
|
+
function K(n) {
|
|
1323
|
+
const e = Math.sin(n * Math.PI / 180), t = 0.5 - 0.25 * Math.log((1 + e) / (1 - e)) / Math.PI;
|
|
1231
1324
|
return t < 0 ? 0 : t > 1 ? 1 : t;
|
|
1232
1325
|
}
|
|
1233
|
-
function
|
|
1234
|
-
return (
|
|
1326
|
+
function it(n) {
|
|
1327
|
+
return (n - 0.5) * 360;
|
|
1235
1328
|
}
|
|
1236
|
-
function
|
|
1237
|
-
const e = (180 -
|
|
1329
|
+
function at(n) {
|
|
1330
|
+
const e = (180 - n * 360) * Math.PI / 180;
|
|
1238
1331
|
return 360 * Math.atan(Math.exp(e)) / Math.PI - 90;
|
|
1239
1332
|
}
|
|
1240
1333
|
/*! *****************************************************************************
|
|
@@ -1251,13 +1344,13 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
1251
1344
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
1252
1345
|
PERFORMANCE OF THIS SOFTWARE.
|
|
1253
1346
|
***************************************************************************** */
|
|
1254
|
-
function
|
|
1347
|
+
function ce(n, e) {
|
|
1255
1348
|
var t = {};
|
|
1256
|
-
for (var s in
|
|
1257
|
-
Object.prototype.hasOwnProperty.call(
|
|
1258
|
-
if (
|
|
1259
|
-
for (var r = 0, s = Object.getOwnPropertySymbols(
|
|
1260
|
-
e.indexOf(s[r]) < 0 && Object.prototype.propertyIsEnumerable.call(
|
|
1349
|
+
for (var s in n)
|
|
1350
|
+
Object.prototype.hasOwnProperty.call(n, s) && e.indexOf(s) < 0 && (t[s] = n[s]);
|
|
1351
|
+
if (n != null && typeof Object.getOwnPropertySymbols == "function")
|
|
1352
|
+
for (var r = 0, s = Object.getOwnPropertySymbols(n); r < s.length; r++)
|
|
1353
|
+
e.indexOf(s[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, s[r]) && (t[s[r]] = n[s[r]]);
|
|
1261
1354
|
return t;
|
|
1262
1355
|
}
|
|
1263
1356
|
class k {
|
|
@@ -1286,7 +1379,7 @@ class k {
|
|
|
1286
1379
|
return this.isAdvancedMarker(e) ? !0 : e.getVisible();
|
|
1287
1380
|
}
|
|
1288
1381
|
}
|
|
1289
|
-
class
|
|
1382
|
+
class H {
|
|
1290
1383
|
constructor({ markers: e, position: t }) {
|
|
1291
1384
|
this.markers = e, t && (t instanceof google.maps.LatLng ? this._position = t : this._position = new google.maps.LatLng(t));
|
|
1292
1385
|
}
|
|
@@ -1320,20 +1413,20 @@ class V {
|
|
|
1320
1413
|
this.marker && (k.setMap(this.marker, null), this.marker = void 0), this.markers.length = 0;
|
|
1321
1414
|
}
|
|
1322
1415
|
}
|
|
1323
|
-
const
|
|
1324
|
-
const r =
|
|
1325
|
-
return t.filter((
|
|
1326
|
-
},
|
|
1327
|
-
const { northEast: s, southWest: r } =
|
|
1328
|
-
return
|
|
1329
|
-
},
|
|
1330
|
-
const s =
|
|
1331
|
-
return [
|
|
1332
|
-
},
|
|
1333
|
-
northEast: e.fromLatLngToDivPixel(
|
|
1334
|
-
southWest: e.fromLatLngToDivPixel(
|
|
1335
|
-
}),
|
|
1336
|
-
const s = t.fromDivPixelToLatLng(e), r = t.fromDivPixelToLatLng(
|
|
1416
|
+
const lt = (n, e, t, s) => {
|
|
1417
|
+
const r = Re(n.getBounds(), e, s);
|
|
1418
|
+
return t.filter((o) => r.contains(k.getPosition(o)));
|
|
1419
|
+
}, Re = (n, e, t) => {
|
|
1420
|
+
const { northEast: s, southWest: r } = ct(n, e), o = ut({ northEast: s, southWest: r }, t);
|
|
1421
|
+
return dt(o, e);
|
|
1422
|
+
}, Ce = (n, e, t) => {
|
|
1423
|
+
const s = Re(n, e, t), r = s.getNorthEast(), o = s.getSouthWest();
|
|
1424
|
+
return [o.lng(), o.lat(), r.lng(), r.lat()];
|
|
1425
|
+
}, ct = (n, e) => ({
|
|
1426
|
+
northEast: e.fromLatLngToDivPixel(n.getNorthEast()),
|
|
1427
|
+
southWest: e.fromLatLngToDivPixel(n.getSouthWest())
|
|
1428
|
+
}), ut = ({ northEast: n, southWest: e }, t) => (n.x += t, n.y -= t, e.x -= t, e.y += t, { northEast: n, southWest: e }), dt = ({ northEast: n, southWest: e }, t) => {
|
|
1429
|
+
const s = t.fromDivPixelToLatLng(e), r = t.fromDivPixelToLatLng(n);
|
|
1337
1430
|
return new google.maps.LatLngBounds(s, r);
|
|
1338
1431
|
};
|
|
1339
1432
|
class je {
|
|
@@ -1353,12 +1446,12 @@ class je {
|
|
|
1353
1446
|
* ```
|
|
1354
1447
|
*/
|
|
1355
1448
|
noop({ markers: e }) {
|
|
1356
|
-
return
|
|
1449
|
+
return pt(e);
|
|
1357
1450
|
}
|
|
1358
1451
|
}
|
|
1359
|
-
class
|
|
1452
|
+
class ht extends je {
|
|
1360
1453
|
constructor(e) {
|
|
1361
|
-
var { viewportPadding: t = 60 } = e, s =
|
|
1454
|
+
var { viewportPadding: t = 60 } = e, s = ce(e, ["viewportPadding"]);
|
|
1362
1455
|
super(s), this.viewportPadding = 60, this.viewportPadding = t;
|
|
1363
1456
|
}
|
|
1364
1457
|
calculate({ markers: e, map: t, mapCanvasProjection: s }) {
|
|
@@ -1369,80 +1462,80 @@ class ut extends je {
|
|
|
1369
1462
|
changed: !1
|
|
1370
1463
|
} : {
|
|
1371
1464
|
clusters: this.cluster({
|
|
1372
|
-
markers:
|
|
1465
|
+
markers: lt(t, s, e, this.viewportPadding),
|
|
1373
1466
|
map: t,
|
|
1374
1467
|
mapCanvasProjection: s
|
|
1375
1468
|
})
|
|
1376
1469
|
};
|
|
1377
1470
|
}
|
|
1378
1471
|
}
|
|
1379
|
-
const
|
|
1472
|
+
const pt = (n) => n.map((t) => new H({
|
|
1380
1473
|
position: k.getPosition(t),
|
|
1381
1474
|
markers: [t]
|
|
1382
1475
|
}));
|
|
1383
|
-
class
|
|
1476
|
+
class ft extends je {
|
|
1384
1477
|
constructor(e) {
|
|
1385
|
-
var { maxZoom: t, radius: s = 60 } = e, r =
|
|
1478
|
+
var { maxZoom: t, radius: s = 60 } = e, r = ce(e, ["maxZoom", "radius"]);
|
|
1386
1479
|
super({ maxZoom: t }), this.state = { zoom: -1 }, this.superCluster = new Te(Object.assign({ maxZoom: this.maxZoom, radius: s }, r));
|
|
1387
1480
|
}
|
|
1388
1481
|
calculate(e) {
|
|
1389
1482
|
let t = !1;
|
|
1390
1483
|
const s = { zoom: e.map.getZoom() };
|
|
1391
|
-
if (
|
|
1484
|
+
if (!$(e.markers, this.markers)) {
|
|
1392
1485
|
t = !0, this.markers = [...e.markers];
|
|
1393
|
-
const r = this.markers.map((
|
|
1394
|
-
const a = k.getPosition(
|
|
1486
|
+
const r = this.markers.map((o) => {
|
|
1487
|
+
const a = k.getPosition(o);
|
|
1395
1488
|
return {
|
|
1396
1489
|
type: "Feature",
|
|
1397
1490
|
geometry: {
|
|
1398
1491
|
type: "Point",
|
|
1399
1492
|
coordinates: [a.lng(), a.lat()]
|
|
1400
1493
|
},
|
|
1401
|
-
properties: { marker:
|
|
1494
|
+
properties: { marker: o }
|
|
1402
1495
|
};
|
|
1403
1496
|
});
|
|
1404
1497
|
this.superCluster.load(r);
|
|
1405
1498
|
}
|
|
1406
|
-
return t || (this.state.zoom <= this.maxZoom || s.zoom <= this.maxZoom) && (t =
|
|
1499
|
+
return t || (this.state.zoom <= this.maxZoom || s.zoom <= this.maxZoom) && (t = !$(this.state, s)), this.state = s, t && (this.clusters = this.cluster(e)), { clusters: this.clusters, changed: t };
|
|
1407
1500
|
}
|
|
1408
1501
|
cluster({ map: e }) {
|
|
1409
1502
|
return this.superCluster.getClusters([-180, -90, 180, 90], Math.round(e.getZoom())).map((t) => this.transformCluster(t));
|
|
1410
1503
|
}
|
|
1411
1504
|
transformCluster({ geometry: { coordinates: [e, t] }, properties: s }) {
|
|
1412
1505
|
if (s.cluster)
|
|
1413
|
-
return new
|
|
1414
|
-
markers: this.superCluster.getLeaves(s.cluster_id, 1 / 0).map((
|
|
1506
|
+
return new H({
|
|
1507
|
+
markers: this.superCluster.getLeaves(s.cluster_id, 1 / 0).map((o) => o.properties.marker),
|
|
1415
1508
|
position: { lat: t, lng: e }
|
|
1416
1509
|
});
|
|
1417
1510
|
const r = s.marker;
|
|
1418
|
-
return new
|
|
1511
|
+
return new H({
|
|
1419
1512
|
markers: [r],
|
|
1420
1513
|
position: k.getPosition(r)
|
|
1421
1514
|
});
|
|
1422
1515
|
}
|
|
1423
1516
|
}
|
|
1424
|
-
class
|
|
1517
|
+
class mt extends ht {
|
|
1425
1518
|
constructor(e) {
|
|
1426
|
-
var { maxZoom: t, radius: s = 60, viewportPadding: r = 60 } = e,
|
|
1427
|
-
super({ maxZoom: t, viewportPadding: r }), this.superCluster = new Te(Object.assign({ maxZoom: this.maxZoom, radius: s },
|
|
1519
|
+
var { maxZoom: t, radius: s = 60, viewportPadding: r = 60 } = e, o = ce(e, ["maxZoom", "radius", "viewportPadding"]);
|
|
1520
|
+
super({ maxZoom: t, viewportPadding: r }), this.superCluster = new Te(Object.assign({ maxZoom: this.maxZoom, radius: s }, o)), this.state = { zoom: -1, view: [0, 0, 0, 0] };
|
|
1428
1521
|
}
|
|
1429
1522
|
calculate(e) {
|
|
1430
1523
|
const t = {
|
|
1431
1524
|
zoom: Math.round(e.map.getZoom()),
|
|
1432
|
-
view:
|
|
1525
|
+
view: Ce(e.map.getBounds(), e.mapCanvasProjection, this.viewportPadding)
|
|
1433
1526
|
};
|
|
1434
|
-
let s =
|
|
1435
|
-
if (
|
|
1527
|
+
let s = !$(this.state, t);
|
|
1528
|
+
if (!$(e.markers, this.markers)) {
|
|
1436
1529
|
s = !0, this.markers = [...e.markers];
|
|
1437
|
-
const r = this.markers.map((
|
|
1438
|
-
const a = k.getPosition(
|
|
1530
|
+
const r = this.markers.map((o) => {
|
|
1531
|
+
const a = k.getPosition(o);
|
|
1439
1532
|
return {
|
|
1440
1533
|
type: "Feature",
|
|
1441
1534
|
geometry: {
|
|
1442
1535
|
type: "Point",
|
|
1443
1536
|
coordinates: [a.lng(), a.lat()]
|
|
1444
1537
|
},
|
|
1445
|
-
properties: { marker:
|
|
1538
|
+
properties: { marker: o }
|
|
1446
1539
|
};
|
|
1447
1540
|
});
|
|
1448
1541
|
this.superCluster.load(r);
|
|
@@ -1452,27 +1545,27 @@ class pt extends ut {
|
|
|
1452
1545
|
cluster({ map: e, mapCanvasProjection: t }) {
|
|
1453
1546
|
const s = {
|
|
1454
1547
|
zoom: Math.round(e.getZoom()),
|
|
1455
|
-
view:
|
|
1548
|
+
view: Ce(e.getBounds(), t, this.viewportPadding)
|
|
1456
1549
|
};
|
|
1457
1550
|
return this.superCluster.getClusters(s.view, s.zoom).map((r) => this.transformCluster(r));
|
|
1458
1551
|
}
|
|
1459
1552
|
transformCluster({ geometry: { coordinates: [e, t] }, properties: s }) {
|
|
1460
1553
|
if (s.cluster)
|
|
1461
|
-
return new
|
|
1462
|
-
markers: this.superCluster.getLeaves(s.cluster_id, 1 / 0).map((
|
|
1554
|
+
return new H({
|
|
1555
|
+
markers: this.superCluster.getLeaves(s.cluster_id, 1 / 0).map((o) => o.properties.marker),
|
|
1463
1556
|
position: { lat: t, lng: e }
|
|
1464
1557
|
});
|
|
1465
1558
|
const r = s.marker;
|
|
1466
|
-
return new
|
|
1559
|
+
return new H({
|
|
1467
1560
|
markers: [r],
|
|
1468
1561
|
position: k.getPosition(r)
|
|
1469
1562
|
});
|
|
1470
1563
|
}
|
|
1471
1564
|
}
|
|
1472
|
-
class
|
|
1565
|
+
class gt {
|
|
1473
1566
|
constructor(e, t) {
|
|
1474
1567
|
this.markers = { sum: e.length };
|
|
1475
|
-
const s = t.map((
|
|
1568
|
+
const s = t.map((o) => o.count), r = s.reduce((o, a) => o + a, 0);
|
|
1476
1569
|
this.clusters = {
|
|
1477
1570
|
count: t.length,
|
|
1478
1571
|
markers: {
|
|
@@ -1484,7 +1577,7 @@ class ft {
|
|
|
1484
1577
|
};
|
|
1485
1578
|
}
|
|
1486
1579
|
}
|
|
1487
|
-
class
|
|
1580
|
+
class vt {
|
|
1488
1581
|
/**
|
|
1489
1582
|
* The default render function for the library used by {@link MarkerClusterer}.
|
|
1490
1583
|
*
|
|
@@ -1529,25 +1622,25 @@ class mt {
|
|
|
1529
1622
|
<circle cx="120" cy="120" opacity=".3" r="90" />
|
|
1530
1623
|
<circle cx="120" cy="120" opacity=".2" r="110" />
|
|
1531
1624
|
<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>
|
|
1532
|
-
</svg>`,
|
|
1625
|
+
</svg>`, l = `Cluster of ${e} markers`, i = Number(google.maps.Marker.MAX_ZINDEX) + e;
|
|
1533
1626
|
if (k.isAdvancedMarkerAvailable(r)) {
|
|
1534
1627
|
const u = document.createElement("div");
|
|
1535
1628
|
u.innerHTML = a;
|
|
1536
|
-
const
|
|
1537
|
-
|
|
1629
|
+
const c = u.firstElementChild;
|
|
1630
|
+
c.setAttribute("transform", "translate(0 25)");
|
|
1538
1631
|
const h = {
|
|
1539
1632
|
map: r,
|
|
1540
1633
|
position: t,
|
|
1541
1634
|
zIndex: i,
|
|
1542
|
-
title:
|
|
1543
|
-
content:
|
|
1635
|
+
title: l,
|
|
1636
|
+
content: c
|
|
1544
1637
|
};
|
|
1545
1638
|
return new google.maps.marker.AdvancedMarkerElement(h);
|
|
1546
1639
|
}
|
|
1547
1640
|
const d = {
|
|
1548
1641
|
position: t,
|
|
1549
1642
|
zIndex: i,
|
|
1550
|
-
title:
|
|
1643
|
+
title: l,
|
|
1551
1644
|
icon: {
|
|
1552
1645
|
url: `data:image/svg+xml;base64,${btoa(a)}`,
|
|
1553
1646
|
anchor: new google.maps.Point(25, 25)
|
|
@@ -1556,25 +1649,25 @@ class mt {
|
|
|
1556
1649
|
return new google.maps.Marker(d);
|
|
1557
1650
|
}
|
|
1558
1651
|
}
|
|
1559
|
-
function
|
|
1652
|
+
function yt(n, e) {
|
|
1560
1653
|
for (let t in e.prototype)
|
|
1561
|
-
|
|
1654
|
+
n.prototype[t] = e.prototype[t];
|
|
1562
1655
|
}
|
|
1563
|
-
class
|
|
1656
|
+
class ue {
|
|
1564
1657
|
constructor() {
|
|
1565
|
-
|
|
1658
|
+
yt(ue, google.maps.OverlayView);
|
|
1566
1659
|
}
|
|
1567
1660
|
}
|
|
1568
|
-
var
|
|
1569
|
-
(function(
|
|
1570
|
-
|
|
1571
|
-
})(
|
|
1572
|
-
const
|
|
1661
|
+
var j;
|
|
1662
|
+
(function(n) {
|
|
1663
|
+
n.CLUSTERING_BEGIN = "clusteringbegin", n.CLUSTERING_END = "clusteringend", n.CLUSTER_CLICK = "click";
|
|
1664
|
+
})(j || (j = {}));
|
|
1665
|
+
const wt = (n, e, t) => {
|
|
1573
1666
|
t.fitBounds(e.bounds);
|
|
1574
1667
|
};
|
|
1575
|
-
class
|
|
1576
|
-
constructor({ map: e, markers: t = [], algorithmOptions: s = {}, algorithm: r = new
|
|
1577
|
-
super(), this.markers = [...t], this.clusters = [], this.algorithm = r, this.renderer =
|
|
1668
|
+
class _t extends ue {
|
|
1669
|
+
constructor({ map: e, markers: t = [], algorithmOptions: s = {}, algorithm: r = new ft(s), renderer: o = new vt(), onClusterClick: a = wt }) {
|
|
1670
|
+
super(), this.markers = [...t], this.clusters = [], this.algorithm = r, this.renderer = o, this.onClusterClick = a, e && this.setMap(e);
|
|
1578
1671
|
}
|
|
1579
1672
|
addMarker(e, t) {
|
|
1580
1673
|
this.markers.includes(e) || (this.markers.push(e), t || this.render());
|
|
@@ -1603,7 +1696,7 @@ class yt extends ce {
|
|
|
1603
1696
|
render() {
|
|
1604
1697
|
const e = this.getMap();
|
|
1605
1698
|
if (e instanceof google.maps.Map && e.getProjection()) {
|
|
1606
|
-
google.maps.event.trigger(this,
|
|
1699
|
+
google.maps.event.trigger(this, j.CLUSTERING_BEGIN, this);
|
|
1607
1700
|
const { clusters: t, changed: s } = this.algorithm.calculate({
|
|
1608
1701
|
markers: this.markers,
|
|
1609
1702
|
map: e,
|
|
@@ -1613,12 +1706,12 @@ class yt extends ce {
|
|
|
1613
1706
|
const r = /* @__PURE__ */ new Set();
|
|
1614
1707
|
for (const a of t)
|
|
1615
1708
|
a.markers.length == 1 && r.add(a.markers[0]);
|
|
1616
|
-
const
|
|
1709
|
+
const o = [];
|
|
1617
1710
|
for (const a of this.clusters)
|
|
1618
|
-
a.marker != null && (a.markers.length == 1 ? r.has(a.marker) || k.setMap(a.marker, null) :
|
|
1619
|
-
this.clusters = t, this.renderClusters(), requestAnimationFrame(() =>
|
|
1711
|
+
a.marker != null && (a.markers.length == 1 ? r.has(a.marker) || k.setMap(a.marker, null) : o.push(a.marker));
|
|
1712
|
+
this.clusters = t, this.renderClusters(), requestAnimationFrame(() => o.forEach((a) => k.setMap(a, null)));
|
|
1620
1713
|
}
|
|
1621
|
-
google.maps.event.trigger(this,
|
|
1714
|
+
google.maps.event.trigger(this, j.CLUSTERING_END, this);
|
|
1622
1715
|
}
|
|
1623
1716
|
}
|
|
1624
1717
|
onAdd() {
|
|
@@ -1631,19 +1724,19 @@ class yt extends ce {
|
|
|
1631
1724
|
this.markers.forEach((e) => k.setMap(e, null)), this.clusters.forEach((e) => e.delete()), this.clusters = [];
|
|
1632
1725
|
}
|
|
1633
1726
|
renderClusters() {
|
|
1634
|
-
const e = new
|
|
1727
|
+
const e = new gt(this.markers, this.clusters), t = this.getMap();
|
|
1635
1728
|
this.clusters.forEach((s) => {
|
|
1636
1729
|
s.markers.length === 1 ? s.marker = s.markers[0] : (s.marker = this.renderer.render(s, e, t), s.markers.forEach((r) => k.setMap(r, null)), this.onClusterClick && s.marker.addListener(
|
|
1637
1730
|
"click",
|
|
1638
1731
|
/* istanbul ignore next */
|
|
1639
1732
|
(r) => {
|
|
1640
|
-
google.maps.event.trigger(this,
|
|
1733
|
+
google.maps.event.trigger(this, j.CLUSTER_CLICK, s), this.onClusterClick(r, s, t);
|
|
1641
1734
|
}
|
|
1642
1735
|
)), k.setMap(s.marker, t);
|
|
1643
1736
|
});
|
|
1644
1737
|
}
|
|
1645
1738
|
}
|
|
1646
|
-
const
|
|
1739
|
+
const be = Object.values(j), Rt = P({
|
|
1647
1740
|
name: "MarkerCluster",
|
|
1648
1741
|
props: {
|
|
1649
1742
|
options: {
|
|
@@ -1651,37 +1744,37 @@ const Ce = Object.values(I), It = M({
|
|
|
1651
1744
|
default: () => ({})
|
|
1652
1745
|
}
|
|
1653
1746
|
},
|
|
1654
|
-
emits:
|
|
1655
|
-
setup(
|
|
1656
|
-
const r =
|
|
1657
|
-
return
|
|
1658
|
-
|
|
1747
|
+
emits: be,
|
|
1748
|
+
setup(n, { emit: e, expose: t, slots: s }) {
|
|
1749
|
+
const r = y(), o = C(Z, y()), a = C(D, y());
|
|
1750
|
+
return G(Le, r), O(
|
|
1751
|
+
o,
|
|
1659
1752
|
() => {
|
|
1660
|
-
|
|
1661
|
-
new
|
|
1662
|
-
map:
|
|
1753
|
+
o.value && (r.value = I(
|
|
1754
|
+
new _t({
|
|
1755
|
+
map: o.value,
|
|
1663
1756
|
// Better perf than the default `SuperClusterAlgorithm`. See:
|
|
1664
1757
|
// https://github.com/googlemaps/js-markerclusterer/pull/640
|
|
1665
|
-
algorithm: new
|
|
1666
|
-
...
|
|
1758
|
+
algorithm: new mt(n.options.algorithmOptions ?? {}),
|
|
1759
|
+
...n.options
|
|
1667
1760
|
})
|
|
1668
|
-
),
|
|
1761
|
+
), be.forEach((l) => {
|
|
1669
1762
|
var i;
|
|
1670
|
-
(i = r.value) == null || i.addListener(
|
|
1763
|
+
(i = r.value) == null || i.addListener(l, (d) => e(l, d));
|
|
1671
1764
|
}));
|
|
1672
1765
|
},
|
|
1673
1766
|
{
|
|
1674
1767
|
immediate: !0
|
|
1675
1768
|
}
|
|
1676
|
-
),
|
|
1677
|
-
var
|
|
1678
|
-
r.value && ((
|
|
1769
|
+
), B(() => {
|
|
1770
|
+
var l;
|
|
1771
|
+
r.value && ((l = a.value) == null || l.event.clearInstanceListeners(r.value), r.value.clearMarkers(), r.value.setMap(null));
|
|
1679
1772
|
}), t({ markerCluster: r }), () => {
|
|
1680
|
-
var
|
|
1681
|
-
return (
|
|
1773
|
+
var l;
|
|
1774
|
+
return (l = s.default) == null ? void 0 : l.call(s);
|
|
1682
1775
|
};
|
|
1683
1776
|
}
|
|
1684
|
-
}),
|
|
1777
|
+
}), kt = P({
|
|
1685
1778
|
inheritAttrs: !1,
|
|
1686
1779
|
props: {
|
|
1687
1780
|
options: {
|
|
@@ -1689,34 +1782,34 @@ const Ce = Object.values(I), It = M({
|
|
|
1689
1782
|
required: !0
|
|
1690
1783
|
}
|
|
1691
1784
|
},
|
|
1692
|
-
setup(
|
|
1693
|
-
const r =
|
|
1785
|
+
setup(n, { slots: e, emit: t, expose: s }) {
|
|
1786
|
+
const r = y(), o = J(() => {
|
|
1694
1787
|
var i;
|
|
1695
|
-
return (i = e.default) == null ? void 0 : i.call(e).some((d) => d.type !==
|
|
1696
|
-
}), a =
|
|
1697
|
-
...
|
|
1788
|
+
return (i = e.default) == null ? void 0 : i.call(e).some((d) => d.type !== Ee);
|
|
1789
|
+
}), a = J(() => ({
|
|
1790
|
+
...n.options,
|
|
1698
1791
|
element: r.value
|
|
1699
|
-
})),
|
|
1792
|
+
})), l = U(ee, [], a, t);
|
|
1700
1793
|
return s({
|
|
1701
|
-
customMarker:
|
|
1702
|
-
}), { customMarkerRef: r, customMarker:
|
|
1794
|
+
customMarker: l
|
|
1795
|
+
}), { customMarkerRef: r, customMarker: l, hasSlotContent: o };
|
|
1703
1796
|
}
|
|
1704
1797
|
});
|
|
1705
|
-
const
|
|
1798
|
+
const Ct = {
|
|
1706
1799
|
key: 0,
|
|
1707
1800
|
class: "custom-marker-wrapper"
|
|
1708
1801
|
};
|
|
1709
|
-
function
|
|
1710
|
-
return
|
|
1711
|
-
|
|
1802
|
+
function bt(n, e, t, s, r, o) {
|
|
1803
|
+
return n.hasSlotContent ? (Y(), X("div", Ct, [
|
|
1804
|
+
ae("div", Pe({
|
|
1712
1805
|
ref: "customMarkerRef",
|
|
1713
|
-
style: { cursor:
|
|
1714
|
-
},
|
|
1715
|
-
|
|
1806
|
+
style: { cursor: n.$attrs.onClick ? "pointer" : void 0 }
|
|
1807
|
+
}, n.$attrs), [
|
|
1808
|
+
Q(n.$slots, "default", {}, void 0, !0)
|
|
1716
1809
|
], 16)
|
|
1717
|
-
])) :
|
|
1810
|
+
])) : Oe("", !0);
|
|
1718
1811
|
}
|
|
1719
|
-
const
|
|
1812
|
+
const jt = /* @__PURE__ */ te(kt, [["render", bt], ["__scopeId", "data-v-2d2d343a"]]), qt = P({
|
|
1720
1813
|
name: "HeatmapLayer",
|
|
1721
1814
|
props: {
|
|
1722
1815
|
options: {
|
|
@@ -1724,20 +1817,20 @@ const $t = /* @__PURE__ */ ee(wt, [["render", _t], ["__scopeId", "data-v-c7599d5
|
|
|
1724
1817
|
default: () => ({})
|
|
1725
1818
|
}
|
|
1726
1819
|
},
|
|
1727
|
-
setup(
|
|
1728
|
-
const e =
|
|
1820
|
+
setup(n) {
|
|
1821
|
+
const e = y(), t = C(Z, y()), s = C(D, y());
|
|
1729
1822
|
return O(
|
|
1730
|
-
[t, () =>
|
|
1731
|
-
([r,
|
|
1823
|
+
[t, () => n.options],
|
|
1824
|
+
([r, o], [a, l]) => {
|
|
1732
1825
|
var d;
|
|
1733
|
-
const i =
|
|
1826
|
+
const i = !$(o, l) || t.value !== a;
|
|
1734
1827
|
if (t.value && s.value && i) {
|
|
1735
|
-
const u = structuredClone(
|
|
1828
|
+
const u = structuredClone(o);
|
|
1736
1829
|
if (u.data && !(u.data instanceof s.value.MVCArray)) {
|
|
1737
|
-
const
|
|
1738
|
-
u.data = (d = u.data) == null ? void 0 : d.map((h) => h instanceof
|
|
1830
|
+
const c = s.value.LatLng;
|
|
1831
|
+
u.data = (d = u.data) == null ? void 0 : d.map((h) => h instanceof c || "location" in h && (h.location instanceof c || h.location === null) ? h : "location" in h ? { ...h, location: new c(h.location) } : new c(h));
|
|
1739
1832
|
}
|
|
1740
|
-
e.value ? e.value.setOptions(u) : e.value =
|
|
1833
|
+
e.value ? e.value.setOptions(u) : e.value = I(
|
|
1741
1834
|
new s.value.visualization.HeatmapLayer({
|
|
1742
1835
|
...u,
|
|
1743
1836
|
map: t.value
|
|
@@ -1746,22 +1839,22 @@ const $t = /* @__PURE__ */ ee(wt, [["render", _t], ["__scopeId", "data-v-c7599d5
|
|
|
1746
1839
|
}
|
|
1747
1840
|
},
|
|
1748
1841
|
{ immediate: !0 }
|
|
1749
|
-
),
|
|
1842
|
+
), B(() => {
|
|
1750
1843
|
e.value && e.value.setMap(null);
|
|
1751
1844
|
}), { heatmapLayer: e };
|
|
1752
1845
|
},
|
|
1753
1846
|
render: () => null
|
|
1754
1847
|
});
|
|
1755
1848
|
export {
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1849
|
+
At as Circle,
|
|
1850
|
+
Tt as CustomControl,
|
|
1851
|
+
jt as CustomMarker,
|
|
1759
1852
|
Ot as GoogleMap,
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1853
|
+
qt as HeatmapLayer,
|
|
1854
|
+
$t as InfoWindow,
|
|
1855
|
+
xt as Marker,
|
|
1856
|
+
Rt as MarkerCluster,
|
|
1857
|
+
St as Polygon,
|
|
1858
|
+
Lt as Polyline,
|
|
1859
|
+
It as Rectangle
|
|
1767
1860
|
};
|