uni-leaflet 1.1.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.
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
package/app-render.js ADDED
@@ -0,0 +1,577 @@
1
+ import * as LModule from 'leaflet';
2
+
3
+ function resolveLeaflet(raw) {
4
+ if (raw && typeof raw.map === 'function') return raw;
5
+ if (raw && raw.default && typeof raw.default.map === 'function') return raw.default;
6
+ if (typeof window !== 'undefined' && window.L && typeof window.L.map === 'function') {
7
+ return window.L;
8
+ }
9
+ if (typeof globalThis !== 'undefined' && globalThis.L && typeof globalThis.L.map === 'function') {
10
+ return globalThis.L;
11
+ }
12
+ return (raw && raw.default) ? raw.default : raw;
13
+ }
14
+
15
+ const L = resolveLeaflet(LModule);
16
+
17
+ // Inject essential Leaflet layout CSS into Webview document
18
+ function ensureLeafletStyles() {
19
+ if (typeof document === 'undefined') return;
20
+ if (document.getElementById('uni-leaflet-core-styles')) return;
21
+
22
+ const style = document.createElement('style');
23
+ style.id = 'uni-leaflet-core-styles';
24
+ style.innerHTML = `
25
+ .leaflet-pane,
26
+ .leaflet-tile,
27
+ .leaflet-marker-icon,
28
+ .leaflet-marker-shadow,
29
+ .leaflet-tile-container,
30
+ .leaflet-pane > svg,
31
+ .leaflet-pane > canvas,
32
+ .leaflet-zoom-box,
33
+ .leaflet-image-layer,
34
+ .leaflet-layer {
35
+ position: absolute !important;
36
+ left: 0 !important;
37
+ top: 0 !important;
38
+ }
39
+ .leaflet-container {
40
+ overflow: hidden !important;
41
+ width: 100% !important;
42
+ height: 100% !important;
43
+ position: relative !important;
44
+ touch-action: none !important;
45
+ -webkit-tap-highlight-color: transparent !important;
46
+ user-select: none !important;
47
+ -webkit-user-select: none !important;
48
+ background: #f2efe9 !important;
49
+ cursor: grab;
50
+ }
51
+ .leaflet-tile,
52
+ .leaflet-marker-icon,
53
+ .leaflet-marker-shadow {
54
+ user-select: none !important;
55
+ -webkit-user-select: none !important;
56
+ -webkit-user-drag: none !important;
57
+ }
58
+ .leaflet-tile {
59
+ filter: inherit !important;
60
+ visibility: hidden;
61
+ max-width: none !important;
62
+ max-height: none !important;
63
+ width: 256px !important;
64
+ height: 256px !important;
65
+ padding: 0 !important;
66
+ margin: 0 !important;
67
+ border: none !important;
68
+ box-sizing: content-box !important;
69
+ pointer-events: none !important;
70
+ }
71
+ .leaflet-tile-loaded {
72
+ visibility: inherit !important;
73
+ }
74
+ .leaflet-tile-container {
75
+ pointer-events: none !important;
76
+ }
77
+ .leaflet-zoom-animated {
78
+ transform-origin: 0 0 !important;
79
+ -webkit-transform-origin: 0 0 !important;
80
+ }
81
+ .leaflet-pane { z-index: 400; }
82
+ .leaflet-tile-pane { z-index: 200; pointer-events: none !important; }
83
+ .leaflet-overlay-pane { z-index: 400; pointer-events: none !important; }
84
+ .leaflet-shadow-pane { z-index: 500; pointer-events: none !important; }
85
+ .leaflet-marker-pane { z-index: 600; pointer-events: none !important; }
86
+ .leaflet-tooltip-pane { z-index: 650; pointer-events: none !important; }
87
+ .leaflet-popup-pane { z-index: 700; }
88
+ .leaflet-map-pane canvas { z-index: 100; }
89
+ .leaflet-map-pane svg { z-index: 200; pointer-events: none !important; }
90
+
91
+ /* Interactive Elements & Clicks */
92
+ .leaflet-interactive,
93
+ .leaflet-pane > svg path.leaflet-interactive,
94
+ .leaflet-pane > svg polygon.leaflet-interactive,
95
+ .leaflet-pane > svg polyline.leaflet-interactive,
96
+ .leaflet-pane > svg circle.leaflet-interactive,
97
+ .leaflet-marker-pane .leaflet-marker-icon {
98
+ pointer-events: auto !important;
99
+ cursor: pointer !important;
100
+ }
101
+
102
+ .leaflet-tooltip {
103
+ position: absolute !important;
104
+ padding: 4px 8px !important;
105
+ background-color: #fff !important;
106
+ border: 1px solid #fff !important;
107
+ border-radius: 4px !important;
108
+ color: #222 !important;
109
+ white-space: nowrap !important;
110
+ user-select: none !important;
111
+ pointer-events: none !important;
112
+ box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
113
+ }
114
+ .leaflet-tooltip-top {
115
+ margin-top: -6px !important;
116
+ }
117
+
118
+ .uni-overlay-label {
119
+ position: absolute !important;
120
+ background-color: rgba(255, 255, 255, 0.96) !important;
121
+ border: 1px solid #cbd5e1 !important;
122
+ border-radius: 6px !important;
123
+ padding: 3px 8px !important;
124
+ font-size: 12px !important;
125
+ font-weight: 600 !important;
126
+ color: #1e293b !important;
127
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
128
+ white-space: nowrap !important;
129
+ pointer-events: none !important;
130
+ }
131
+
132
+ .leaflet-tooltip-top.uni-overlay-label:before,
133
+ .leaflet-tooltip-top.uni-overlay-label:after {
134
+ content: "" !important;
135
+ position: absolute !important;
136
+ left: 50% !important;
137
+ transform: translateX(-50%) !important;
138
+ width: 0 !important;
139
+ height: 0 !important;
140
+ border-style: solid !important;
141
+ pointer-events: none !important;
142
+ }
143
+
144
+ /* Outer border triangle */
145
+ .leaflet-tooltip-top.uni-overlay-label:before {
146
+ bottom: -6px !important;
147
+ border-width: 6px 5px 0 5px !important;
148
+ border-color: #cbd5e1 transparent transparent transparent !important;
149
+ z-index: 1 !important;
150
+ }
151
+
152
+ /* Inner fill triangle */
153
+ .leaflet-tooltip-top.uni-overlay-label:after {
154
+ bottom: -5px !important;
155
+ border-width: 5px 4px 0 4px !important;
156
+ border-color: rgba(255, 255, 255, 0.96) transparent transparent transparent !important;
157
+ z-index: 2 !important;
158
+ }
159
+ .uni-emoji-marker-icon,
160
+ .uni-custom-svg-icon,
161
+ .uni-custom-html-icon,
162
+ .uni-custom-img-icon,
163
+ .uni-custom-icon,
164
+ .uni-default-pin {
165
+ background: transparent !important;
166
+ border: none !important;
167
+ }
168
+ `;
169
+ document.head.appendChild(style);
170
+ }
171
+
172
+ export default {
173
+ data() {
174
+ return {
175
+ map: null,
176
+ tileLayers: [],
177
+ overlayGroup: null,
178
+ isReady: false,
179
+ cachedProps: null,
180
+ isUserInteracting: false,
181
+ lastReportedCenter: null,
182
+ lastReportedZoom: null,
183
+ moveThrottleTimer: null,
184
+ currentLayersKey: '',
185
+ currentOverlaysKey: '',
186
+ };
187
+ },
188
+ mounted() {
189
+ ensureLeafletStyles();
190
+ this.initLeaflet();
191
+ },
192
+ beforeDestroy() {
193
+ if (this.moveThrottleTimer) {
194
+ clearTimeout(this.moveThrottleTimer);
195
+ this.moveThrottleTimer = null;
196
+ }
197
+ if (this.map) {
198
+ this.map.remove();
199
+ this.map = null;
200
+ }
201
+ },
202
+ methods: {
203
+ initLeaflet() {
204
+ if (this.map) return;
205
+ ensureLeafletStyles();
206
+
207
+ const id = (this.prop && this.prop.appMapId) || (this.cachedProps && this.cachedProps.appMapId);
208
+ const container = (id && document.getElementById(id)) || (this.$el && this.$el.querySelector ? this.$el.querySelector('.uni-leaflet-h5-container') : this.$el);
209
+ if (!container) {
210
+ setTimeout(() => this.initLeaflet(), 60);
211
+ return;
212
+ }
213
+
214
+ const p = this.cachedProps || this.prop || {};
215
+ const center = p.center || [39.9042, 116.4074];
216
+ const zoom = p.zoom || 13;
217
+ const minZoom = p.minZoom ?? 3;
218
+ const maxZoom = p.maxZoom ?? 18;
219
+
220
+ try {
221
+ this.map = L.map(container, {
222
+ center: [center[0], center[1]],
223
+ zoom,
224
+ minZoom,
225
+ maxZoom,
226
+ zoomControl: false,
227
+ attributionControl: false,
228
+ tap: false, // Avoid synthetic tap conflicts with pinch-to-zoom on mobile Webview
229
+ touchZoom: true, // Smooth native multi-touch pinch-to-zoom
230
+ bounceAtZoomLimits: false,
231
+ zoomAnimation: true,
232
+ fadeAnimation: true,
233
+ markerZoomAnimation: true,
234
+ });
235
+
236
+ try {
237
+ this.map.createPane('overlayTilePane');
238
+ const overlayPane = this.map.getPane('overlayTilePane');
239
+ if (overlayPane) {
240
+ overlayPane.style.zIndex = '350';
241
+ overlayPane.style.pointerEvents = 'none';
242
+ }
243
+ } catch (e) {}
244
+
245
+ this.overlayGroup = L.layerGroup().addTo(this.map);
246
+
247
+ // Track user drag/pinch gestures to prevent ping-pong feedback loop
248
+ this.map.on('movestart zoomstart dragstart', () => {
249
+ this.isUserInteracting = true;
250
+ });
251
+
252
+ this.map.on('move', () => {
253
+ const c = this.map.getCenter();
254
+ const z = this.map.getZoom();
255
+ this.lastReportedCenter = [c.lat, c.lng];
256
+ this.lastReportedZoom = z;
257
+
258
+ if (!this.moveThrottleTimer) {
259
+ this.moveThrottleTimer = setTimeout(() => {
260
+ this.moveThrottleTimer = null;
261
+ if (this.map) {
262
+ const cur = this.map.getCenter();
263
+ const curZ = this.map.getZoom();
264
+ this.$ownerInstance && this.$ownerInstance.callMethod('onRender_MapMove', { center: [cur.lat, cur.lng], zoom: curZ });
265
+ }
266
+ }, 100);
267
+ }
268
+ });
269
+
270
+ this.map.on('moveend zoomend dragend', () => {
271
+ if (this.moveThrottleTimer) {
272
+ clearTimeout(this.moveThrottleTimer);
273
+ this.moveThrottleTimer = null;
274
+ }
275
+ const c = this.map.getCenter();
276
+ const z = this.map.getZoom();
277
+ this.lastReportedCenter = [c.lat, c.lng];
278
+ this.lastReportedZoom = z;
279
+
280
+ this.$ownerInstance && this.$ownerInstance.callMethod('onRender_MapMoveEnd', { center: [c.lat, c.lng], zoom: z });
281
+
282
+ setTimeout(() => {
283
+ this.isUserInteracting = false;
284
+ }, 150);
285
+ });
286
+
287
+ this.map.on('zoom', () => {
288
+ this.$ownerInstance && this.$ownerInstance.callMethod('onRender_MapZoom', this.map.getZoom());
289
+ });
290
+
291
+ this.map.on('zoomend', () => {
292
+ this.$ownerInstance && this.$ownerInstance.callMethod('onRender_MapZoomEnd', this.map.getZoom());
293
+ });
294
+
295
+ this.map.on('click', (e) => {
296
+ this.$ownerInstance && this.$ownerInstance.callMethod('onRender_MapClick', {
297
+ latLng: [e.latlng.lat, e.latlng.lng],
298
+ point: { x: e.containerPoint.x, y: e.containerPoint.y }
299
+ });
300
+ });
301
+
302
+ this.isReady = true;
303
+ this.applyProps(p);
304
+
305
+ // Invalidate size on multiple next frames to sync with Webview layout
306
+ if (typeof requestAnimationFrame !== 'undefined') {
307
+ requestAnimationFrame(() => {
308
+ if (this.map) this.map.invalidateSize(true);
309
+ });
310
+ }
311
+ setTimeout(() => {
312
+ if (this.map) this.map.invalidateSize(true);
313
+ }, 120);
314
+ setTimeout(() => {
315
+ if (this.map) this.map.invalidateSize(true);
316
+ }, 300);
317
+
318
+ this.$ownerInstance && this.$ownerInstance.callMethod('onRender_Ready');
319
+ } catch (err) {
320
+ console.error('Leaflet init in renderjs error:', err);
321
+ }
322
+ },
323
+ updateMapProps(newVal) {
324
+ if (!newVal) return;
325
+ this.cachedProps = newVal;
326
+ if (!this.map || !this.isReady) {
327
+ this.initLeaflet();
328
+ return;
329
+ }
330
+ this.applyProps(newVal);
331
+ },
332
+ applyProps(p) {
333
+ if (!this.map || !p) return;
334
+
335
+ // Anti-feedback loop: Don't setView if the user is actively dragging/zooming or if this is an echo
336
+ if (p.center && p.zoom !== undefined) {
337
+ const curCenter = this.map.getCenter();
338
+ const curZoom = this.map.getZoom();
339
+
340
+ const isEcho =
341
+ this.lastReportedCenter &&
342
+ Math.abs(this.lastReportedCenter[0] - p.center[0]) < 1e-4 &&
343
+ Math.abs(this.lastReportedCenter[1] - p.center[1]) < 1e-4 &&
344
+ this.lastReportedZoom !== null &&
345
+ Math.abs(this.lastReportedZoom - p.zoom) < 0.1;
346
+
347
+ if (!this.isUserInteracting && !isEcho) {
348
+ const centerDiff =
349
+ Math.abs(curCenter.lat - p.center[0]) > 1e-4 ||
350
+ Math.abs(curCenter.lng - p.center[1]) > 1e-4;
351
+ const zoomDiff = Math.abs(curZoom - p.zoom) > 0.05;
352
+
353
+ if (centerDiff || zoomDiff) {
354
+ this.map.setView([p.center[0], p.center[1]], p.zoom, { animate: false });
355
+ }
356
+ }
357
+ }
358
+
359
+ // Only rebuild tile layers when tile URLs / configs actually change
360
+ const layersToApply = (p.layers && p.layers.length > 0)
361
+ ? p.layers
362
+ : (p.tileUrl ? [{ url: p.tileUrl, subdomains: p.subdomains }] : []);
363
+ const layersKey = JSON.stringify(layersToApply);
364
+ if (this.currentLayersKey !== layersKey) {
365
+ this.currentLayersKey = layersKey;
366
+ this.setTileLayers(layersToApply);
367
+ }
368
+
369
+ // Only rebuild vector overlays when overlay data actually changes
370
+ const overlaysToApply = {
371
+ markers: p.markers,
372
+ polylines: p.polylines,
373
+ polygons: p.polygons,
374
+ circles: p.circles,
375
+ ...(p.overlays || {}),
376
+ };
377
+ const overlaysKey = JSON.stringify(overlaysToApply);
378
+ if (this.currentOverlaysKey !== overlaysKey) {
379
+ this.currentOverlaysKey = overlaysKey;
380
+ this.renderOverlays(overlaysToApply);
381
+ }
382
+ },
383
+ setTileLayers(layers) {
384
+ for (const l of this.tileLayers) {
385
+ try {
386
+ this.map.removeLayer(l);
387
+ } catch (e) {}
388
+ }
389
+ this.tileLayers = [];
390
+
391
+ for (let i = 0; i < layers.length; i++) {
392
+ const cfg = typeof layers[i] === 'string' ? { url: layers[i] } : layers[i];
393
+ const subdomains = cfg.subdomains || ['a', 'b', 'c'];
394
+ const isOverlay = (cfg.zIndex && cfg.zIndex >= 10) || (i > 0);
395
+ const tile = L.tileLayer(cfg.url, {
396
+ subdomains,
397
+ opacity: cfg.opacity !== undefined ? cfg.opacity : 1,
398
+ zIndex: cfg.zIndex || (i + 1),
399
+ pane: isOverlay ? 'overlayTilePane' : 'tilePane',
400
+ tileSize: 256,
401
+ });
402
+ tile.addTo(this.map);
403
+ this.tileLayers.push(tile);
404
+ }
405
+ },
406
+ renderOverlays(overlays) {
407
+ if (!this.overlayGroup) return;
408
+ this.overlayGroup.clearLayers();
409
+
410
+ // Polygons
411
+ if (overlays.polygons) {
412
+ for (const poly of overlays.polygons) {
413
+ if (!poly.latLngs || poly.latLngs.length < 3) continue;
414
+ const lPoly = L.polygon(poly.latLngs, {
415
+ color: poly.color || '#ef4444',
416
+ weight: poly.width || 2,
417
+ fillColor: poly.fillColor || '#ef4444',
418
+ fillOpacity: poly.fillOpacity ?? 0.25,
419
+ interactive: true,
420
+ }).addTo(this.overlayGroup);
421
+ if (poly.label) {
422
+ const labelText = typeof poly.label === 'string' ? poly.label : poly.label.text;
423
+ lPoly.bindTooltip(labelText, { permanent: true, direction: 'center', className: 'uni-overlay-label' });
424
+ }
425
+ lPoly.on('click', (e) => {
426
+ if (e && e.originalEvent) L.DomEvent.stopPropagation(e);
427
+ this.$ownerInstance && this.$ownerInstance.callMethod('onRender_OverlayClick', { type: 'polygon', data: poly });
428
+ });
429
+ }
430
+ }
431
+
432
+ // Circles
433
+ if (overlays.circles) {
434
+ for (const c of overlays.circles) {
435
+ const lCircle = L.circle([c.latLng[0], c.latLng[1]], {
436
+ radius: c.radius,
437
+ color: c.color || '#10b981',
438
+ weight: c.width || 2,
439
+ fillColor: c.fillColor || c.color || '#10b981',
440
+ fillOpacity: c.fillOpacity ?? 0.2,
441
+ interactive: true,
442
+ }).addTo(this.overlayGroup);
443
+ if (c.label) {
444
+ const labelText = typeof c.label === 'string' ? c.label : c.label.text;
445
+ lCircle.bindTooltip(labelText, { permanent: true, direction: 'center', className: 'uni-overlay-label' });
446
+ }
447
+ lCircle.on('click', (e) => {
448
+ if (e && e.originalEvent) L.DomEvent.stopPropagation(e);
449
+ this.$ownerInstance && this.$ownerInstance.callMethod('onRender_OverlayClick', { type: 'circle', data: c });
450
+ });
451
+ }
452
+ }
453
+
454
+ // Polylines
455
+ if (overlays.polylines) {
456
+ for (const line of overlays.polylines) {
457
+ if (!line.latLngs || line.latLngs.length < 2) continue;
458
+ const lLine = L.polyline(line.latLngs, {
459
+ color: line.color || '#3b82f6',
460
+ weight: line.width || 4,
461
+ opacity: line.opacity ?? 1,
462
+ dashArray: line.dashArray ? line.dashArray.join(',') : undefined,
463
+ interactive: true,
464
+ }).addTo(this.overlayGroup);
465
+ if (line.label) {
466
+ const labelText = typeof line.label === 'string' ? line.label : line.label.text;
467
+ lLine.bindTooltip(labelText, { permanent: true, direction: 'center', className: 'uni-overlay-label' });
468
+ }
469
+ lLine.on('click', (e) => {
470
+ if (e && e.originalEvent) L.DomEvent.stopPropagation(e);
471
+ this.$ownerInstance && this.$ownerInstance.callMethod('onRender_OverlayClick', { type: 'polyline', data: line });
472
+ });
473
+ }
474
+ }
475
+
476
+ // Markers
477
+ if (overlays.markers) {
478
+ for (const m of overlays.markers) {
479
+ let icon;
480
+ const size = m.icon && m.icon.size ? m.icon.size : [32, 32];
481
+ const anchor = m.icon && m.icon.anchor ? m.icon.anchor : [size[0] / 2, size[1]];
482
+
483
+ const tooltipAnchor = [size[0] / 2 - anchor[0], -anchor[1]];
484
+
485
+ if (m.icon && m.icon.svg) {
486
+ let svgStr = m.icon.svg.trim();
487
+ if (svgStr.indexOf('xmlns=') === -1) {
488
+ svgStr = svgStr.replace('<svg', '<svg xmlns="http://www.w3.org/2000/svg"');
489
+ }
490
+ icon = L.divIcon({
491
+ className: 'uni-custom-svg-icon',
492
+ html: '<div style="width:' + size[0] + 'px;height:' + size[1] + 'px;display:flex;align-items:center;justify-content:center;filter:drop-shadow(0 2px 4px rgba(0,0,0,0.3));">' + svgStr + '</div>',
493
+ iconSize: size,
494
+ iconAnchor: anchor,
495
+ tooltipAnchor: tooltipAnchor,
496
+ });
497
+ } else if (m.icon && m.icon.html) {
498
+ icon = L.divIcon({
499
+ className: 'uni-custom-html-icon',
500
+ html: m.icon.html,
501
+ iconSize: size,
502
+ iconAnchor: anchor,
503
+ tooltipAnchor: tooltipAnchor,
504
+ });
505
+ } else if (m.icon && m.icon.url) {
506
+ let finalUrl = m.icon.url;
507
+ if (finalUrl && typeof finalUrl === 'string' && !finalUrl.startsWith('data:') && !finalUrl.startsWith('http://') && !finalUrl.startsWith('https://')) {
508
+ // Strip leading slash so that local resources resolve relative to app bundle www root in App-Plus
509
+ if (finalUrl.startsWith('/')) {
510
+ finalUrl = finalUrl.slice(1);
511
+ }
512
+ }
513
+ const html = '<img src="' + finalUrl + '" style="width:' + size[0] + 'px;height:' + size[1] + 'px;display:block;filter:drop-shadow(0 2px 4px rgba(0,0,0,0.3));" />';
514
+ icon = L.divIcon({
515
+ className: 'uni-custom-img-icon',
516
+ html: html,
517
+ iconSize: size,
518
+ iconAnchor: anchor,
519
+ tooltipAnchor: tooltipAnchor,
520
+ });
521
+ } else if (m.icon && m.icon.text) {
522
+ const fontSize = Math.round(size[0] * 0.72);
523
+ icon = L.divIcon({
524
+ className: 'uni-emoji-marker-icon',
525
+ html: '<div style="font-size:' + fontSize + 'px;line-height:1;text-align:center;pointer-events:auto;filter:drop-shadow(0 2px 4px rgba(0,0,0,0.3));">' + m.icon.text + '</div>',
526
+ iconSize: size,
527
+ iconAnchor: anchor,
528
+ tooltipAnchor: tooltipAnchor,
529
+ });
530
+ } else {
531
+ const pinColor = (m.icon && m.icon.color) ? m.icon.color : '#ef4444';
532
+ const html = '<svg viewBox="0 0 24 32" width="' + size[0] + '" height="' + size[1] + '" style="filter:drop-shadow(0 2px 4px rgba(0,0,0,0.35));">' +
533
+ '<path d="M12 0C5.37 0 0 5.37 0 12c0 9 12 20 12 20s12-11 12-20c0-6.63-5.37-12-12-12z" fill="' + pinColor + '"/>' +
534
+ '<circle cx="12" cy="11" r="4.5" fill="#ffffff"/>' +
535
+ '</svg>';
536
+ icon = L.divIcon({
537
+ html: html,
538
+ className: 'uni-default-pin',
539
+ iconSize: size,
540
+ iconAnchor: anchor,
541
+ tooltipAnchor: tooltipAnchor,
542
+ });
543
+ }
544
+
545
+ const lMarker = L.marker([m.latLng[0], m.latLng[1]], {
546
+ icon: icon,
547
+ interactive: true,
548
+ }).addTo(this.overlayGroup);
549
+ if (m.label) {
550
+ const labelText = typeof m.label === 'string' ? m.label : m.label.text;
551
+ const customOffset = typeof m.label === 'object' && m.label.offset ? m.label.offset : undefined;
552
+ let offset = [0, 0];
553
+ if (customOffset) {
554
+ const ox = customOffset[0] || 0;
555
+ const oy = customOffset[1] || 0;
556
+ if (Math.abs(oy) <= 10) {
557
+ offset = [ox, oy];
558
+ } else {
559
+ offset = [ox, 0];
560
+ }
561
+ }
562
+ lMarker.bindTooltip(labelText, {
563
+ permanent: true,
564
+ direction: 'top',
565
+ offset: offset,
566
+ className: 'uni-overlay-label',
567
+ });
568
+ }
569
+ lMarker.on('click', (e) => {
570
+ if (e && e.originalEvent) L.DomEvent.stopPropagation(e);
571
+ this.$ownerInstance && this.$ownerInstance.callMethod('onRender_OverlayClick', { type: 'marker', data: m });
572
+ });
573
+ }
574
+ }
575
+ }
576
+ }
577
+ };