@heycar/heycars-map 0.9.8-fix1 → 0.9.8-memory
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/dist/index.cjs +441 -45
- package/dist/index.js +441 -45
- package/dist/src/Demo/DemoBusinessTaxiService.d.ts +805 -560
- package/dist/src/business-components/FitView/FitView.d.ts +4 -1
- package/dist/src/business-components/PassengerCircle/PassengerCircle.d.ts +825 -825
- package/dist/src/business-components/StartEndPoint/StartEndPoint.d.ts +825 -825
- package/dist/src/business-components/TaxiCar/TaxiCar.d.ts +825 -825
- package/dist/src/components/Amap/Amap.d.ts +8 -7
- package/dist/src/components/Amap/SafeAmap.d.ts +103 -0
- package/dist/src/components/MapProvider/MapProvider.d.ts +2 -1
- package/dist/src/hooks/useHeycarMap.d.ts +5 -1585
- package/dist/src/hooks/useMap.d.ts +4 -794
- package/dist/src/hooks/useMapAngle.d.ts +3 -3
- package/dist/src/hooks/useMapDrag.d.ts +3 -3
- package/dist/src/hooks/useMapFitView.d.ts +108 -108
- package/dist/src/hooks/useMapLngLatToVw.d.ts +3 -3
- package/dist/src/hooks/useMapWheelZoomCenter.d.ts +3 -2
- package/dist/src/hooks/useMapZoom.d.ts +3 -2
- package/dist/src/hooks-business/useBusinessQuotingMap.d.ts +806 -561
- package/dist/src/hooks-business/useBusinessTaxiServiceMap.d.ts +806 -561
- package/dist/src/types/interface.d.ts +4 -2
- package/dist/src/types/my.d.ts +21 -0
- package/dist/src/types/wx.d.ts +1 -0
- package/dist/src/utils/referenceCount.d.ts +8 -0
- package/package.json +1 -1
- package/todo.md +11 -0
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7
7
|
import Vue, { defineComponent, h, computed, inject, provide, watch, onMounted, onUnmounted, watchPostEffect, shallowRef, ref, watchEffect, reactive, toRefs, toRef } from "vue";
|
|
8
8
|
const style_css_ts_vanilla = "";
|
|
9
9
|
const name = "@heycar/heycars-map";
|
|
10
|
-
const version = "0.9.8-
|
|
10
|
+
const version = "0.9.8-memory";
|
|
11
11
|
const type = "module";
|
|
12
12
|
const bin = {
|
|
13
13
|
checkVersion: "./bin/checkVersion.js"
|
|
@@ -1216,7 +1216,7 @@ const pipeDefer = (fn) => (...args) => {
|
|
|
1216
1216
|
setTimeout(() => {
|
|
1217
1217
|
const result = fn == null ? void 0 : fn(...args);
|
|
1218
1218
|
resolve(result);
|
|
1219
|
-
},
|
|
1219
|
+
}, 50);
|
|
1220
1220
|
});
|
|
1221
1221
|
};
|
|
1222
1222
|
const pipeOnlyLastEffect = (fn) => {
|
|
@@ -1385,14 +1385,13 @@ function watchPostEffectForMapProperty(targetRef, props, nameOptions, watchOptio
|
|
|
1385
1385
|
watch(
|
|
1386
1386
|
deps,
|
|
1387
1387
|
(values, prevValues) => {
|
|
1388
|
-
|
|
1389
|
-
if (!target)
|
|
1388
|
+
if (!targetRef.value)
|
|
1390
1389
|
return;
|
|
1391
1390
|
for (const [idx, value] of values.entries()) {
|
|
1392
1391
|
const { name: name2, defaultValue } = nameOptions[idx];
|
|
1393
1392
|
const prev = prevValues[idx];
|
|
1394
1393
|
if (!deepCompareEqualsForMaps(value, prev)) {
|
|
1395
|
-
|
|
1394
|
+
targetRef.value[name2setterName(name2)](value != null ? value : defaultValue);
|
|
1396
1395
|
}
|
|
1397
1396
|
}
|
|
1398
1397
|
},
|
|
@@ -1411,16 +1410,18 @@ function watchNoneImmediatePostEffectForMapProperty(targetRef, props, nameOption
|
|
|
1411
1410
|
}
|
|
1412
1411
|
function watchPostEffectForAMapEvent(targetRef, props, emit, propertyNames) {
|
|
1413
1412
|
watchPostEffect((onCleanup) => {
|
|
1414
|
-
|
|
1415
|
-
if (!target)
|
|
1413
|
+
if (!(targetRef == null ? void 0 : targetRef.value))
|
|
1416
1414
|
return;
|
|
1417
1415
|
const cleanList = [];
|
|
1418
1416
|
for (const name2 of propertyNames) {
|
|
1419
1417
|
const emitEventName = property2emitEventName(name2);
|
|
1420
1418
|
const eventName = property2mapEventName(name2);
|
|
1421
1419
|
const handler = (e) => emit(emitEventName, e);
|
|
1422
|
-
|
|
1423
|
-
cleanList.push(() =>
|
|
1420
|
+
targetRef == null ? void 0 : targetRef.value.on(eventName, handler);
|
|
1421
|
+
cleanList.push(() => {
|
|
1422
|
+
var _a;
|
|
1423
|
+
return (_a = targetRef == null ? void 0 : targetRef.value) == null ? void 0 : _a.off(eventName, handler);
|
|
1424
|
+
});
|
|
1424
1425
|
}
|
|
1425
1426
|
onCleanup(() => {
|
|
1426
1427
|
for (const clean of cleanList)
|
|
@@ -1450,24 +1451,49 @@ function watchPostEffectForGMapEvent(targetRef, props, emit, propertyNames) {
|
|
|
1450
1451
|
const watchPostEffectOnce = (callback) => {
|
|
1451
1452
|
watch(() => 0, callback, { immediate: true, flush: "post" });
|
|
1452
1453
|
};
|
|
1454
|
+
class ReferenceCount {
|
|
1455
|
+
constructor() {
|
|
1456
|
+
__publicField(this, "count", 0);
|
|
1457
|
+
}
|
|
1458
|
+
log() {
|
|
1459
|
+
console.log(`ReferenceCount count = ${this.count}`);
|
|
1460
|
+
}
|
|
1461
|
+
add() {
|
|
1462
|
+
this.count += 1;
|
|
1463
|
+
this.log();
|
|
1464
|
+
}
|
|
1465
|
+
remove() {
|
|
1466
|
+
this.count -= 1;
|
|
1467
|
+
this.log();
|
|
1468
|
+
}
|
|
1469
|
+
}
|
|
1470
|
+
const referenceCount = new ReferenceCount();
|
|
1453
1471
|
const AmapMarker = defineSetup(function AmapMarker2(props, { emit }) {
|
|
1454
1472
|
const { registerOverlay } = props;
|
|
1455
1473
|
const markerRef = shallowRef();
|
|
1456
1474
|
const mapRef = useAmap();
|
|
1457
1475
|
onMounted(() => {
|
|
1476
|
+
referenceCount.add();
|
|
1458
1477
|
markerRef.value = new AMap.Marker({ ...props });
|
|
1459
1478
|
});
|
|
1460
1479
|
onUnmounted(() => {
|
|
1461
|
-
var _a;
|
|
1480
|
+
var _a, _b;
|
|
1481
|
+
referenceCount.remove();
|
|
1462
1482
|
(_a = markerRef.value) == null ? void 0 : _a.setMap(null);
|
|
1483
|
+
(_b = markerRef.value) == null ? void 0 : _b.destroy();
|
|
1484
|
+
markerRef.value = void 0;
|
|
1463
1485
|
});
|
|
1464
1486
|
useMapOverlay({ registerOverlay, overlayRef: markerRef });
|
|
1465
|
-
watchPostEffect(() => {
|
|
1487
|
+
watchPostEffect((onCleanup) => {
|
|
1466
1488
|
var _a;
|
|
1467
1489
|
const map = mapRef == null ? void 0 : mapRef.value;
|
|
1468
|
-
if (!map)
|
|
1490
|
+
if (!(map == null ? void 0 : map.amap))
|
|
1469
1491
|
return;
|
|
1470
|
-
(_a = markerRef.value) == null ? void 0 : _a.setMap(map);
|
|
1492
|
+
(_a = markerRef.value) == null ? void 0 : _a.setMap(map.amap);
|
|
1493
|
+
onCleanup(() => {
|
|
1494
|
+
var _a2;
|
|
1495
|
+
return (_a2 = markerRef.value) == null ? void 0 : _a2.setMap(null);
|
|
1496
|
+
});
|
|
1471
1497
|
});
|
|
1472
1498
|
watchNoneImmediatePostEffectForMapProperty(markerRef, props, [
|
|
1473
1499
|
{ name: "anchor", defaultValue: "" },
|
|
@@ -2315,6 +2341,8 @@ function detectWebGL() {
|
|
|
2315
2341
|
const useAmapLngLatToVw = (props) => {
|
|
2316
2342
|
const apiMapLngLatToVw = (point) => {
|
|
2317
2343
|
const amap2 = props.mapRef.value;
|
|
2344
|
+
if (!(amap2 == null ? void 0 : amap2.amap))
|
|
2345
|
+
return [0, 0];
|
|
2318
2346
|
const sw = innerWidth;
|
|
2319
2347
|
const [x, y] = amap2 == null ? void 0 : amap2.lngLatToContainer(point).toArray();
|
|
2320
2348
|
return [100 * x / sw, 100 * y / sw];
|
|
@@ -2379,6 +2407,316 @@ const useAmapWheelZoomCenter = (props) => {
|
|
|
2379
2407
|
};
|
|
2380
2408
|
const Amap_css_ts_vanilla = "";
|
|
2381
2409
|
var amap = "_1d8ur7t0";
|
|
2410
|
+
class SafeAmap {
|
|
2411
|
+
constructor(elm, options) {
|
|
2412
|
+
__publicField(this, "containerElm");
|
|
2413
|
+
__publicField(this, "amap");
|
|
2414
|
+
this.containerElm = document.createElement("div");
|
|
2415
|
+
this.containerElm.style.position = "absolute";
|
|
2416
|
+
this.containerElm.style.top = "0";
|
|
2417
|
+
this.containerElm.style.left = "0";
|
|
2418
|
+
this.containerElm.style.right = "0";
|
|
2419
|
+
this.containerElm.style.bottom = "0";
|
|
2420
|
+
elm.appendChild(this.containerElm);
|
|
2421
|
+
this.amap = new AMap.Map(this.containerElm, options);
|
|
2422
|
+
}
|
|
2423
|
+
destroy() {
|
|
2424
|
+
var _a, _b, _c;
|
|
2425
|
+
(_b = (_a = this.containerElm) == null ? void 0 : _a.parentNode) == null ? void 0 : _b.removeChild(this.containerElm);
|
|
2426
|
+
(_c = this.amap) == null ? void 0 : _c.destroy();
|
|
2427
|
+
this.containerElm = void 0;
|
|
2428
|
+
this.amap = void 0;
|
|
2429
|
+
}
|
|
2430
|
+
getContainer() {
|
|
2431
|
+
var _a;
|
|
2432
|
+
return (_a = this.containerElm) == null ? void 0 : _a.parentElement;
|
|
2433
|
+
}
|
|
2434
|
+
setCenter(center, immediately, duration) {
|
|
2435
|
+
var _a;
|
|
2436
|
+
return (_a = this.amap) == null ? void 0 : _a.setCenter(center, immediately, duration);
|
|
2437
|
+
}
|
|
2438
|
+
getStyleByUserId(id, zoom) {
|
|
2439
|
+
var _a;
|
|
2440
|
+
return (_a = this.amap) == null ? void 0 : _a.getStyleByUserId(id, zoom);
|
|
2441
|
+
}
|
|
2442
|
+
getCustomTypeByContainerPos(lnglat) {
|
|
2443
|
+
var _a;
|
|
2444
|
+
return (_a = this.amap) == null ? void 0 : _a.getCustomTypeByContainerPos(lnglat);
|
|
2445
|
+
}
|
|
2446
|
+
getScreenShot(width, height) {
|
|
2447
|
+
var _a;
|
|
2448
|
+
return (_a = this.amap) == null ? void 0 : _a.getScreenShot(width, height);
|
|
2449
|
+
}
|
|
2450
|
+
setZoomAndCenter(zoom, center, immediately, duration) {
|
|
2451
|
+
var _a;
|
|
2452
|
+
(_a = this.amap) == null ? void 0 : _a.setZoomAndCenter(zoom, center, immediately, duration);
|
|
2453
|
+
}
|
|
2454
|
+
getBounds() {
|
|
2455
|
+
var _a;
|
|
2456
|
+
return (_a = this.amap) == null ? void 0 : _a.getBounds();
|
|
2457
|
+
}
|
|
2458
|
+
getCenter() {
|
|
2459
|
+
var _a;
|
|
2460
|
+
return (_a = this.amap) == null ? void 0 : _a.getCenter();
|
|
2461
|
+
}
|
|
2462
|
+
getGraphicInfo() {
|
|
2463
|
+
var _a;
|
|
2464
|
+
return (_a = this.amap) == null ? void 0 : _a.getGraphicInfo();
|
|
2465
|
+
}
|
|
2466
|
+
setZoom(zoom, immediately, duration) {
|
|
2467
|
+
var _a;
|
|
2468
|
+
(_a = this.amap) == null ? void 0 : _a.setZoom(zoom, immediately, duration);
|
|
2469
|
+
}
|
|
2470
|
+
getZoom(digits) {
|
|
2471
|
+
var _a;
|
|
2472
|
+
return (_a = this.amap) == null ? void 0 : _a.getZoom(digits);
|
|
2473
|
+
}
|
|
2474
|
+
zoomIn() {
|
|
2475
|
+
var _a;
|
|
2476
|
+
(_a = this.amap) == null ? void 0 : _a.zoomIn();
|
|
2477
|
+
}
|
|
2478
|
+
zoomOut() {
|
|
2479
|
+
var _a;
|
|
2480
|
+
(_a = this.amap) == null ? void 0 : _a.zoomOut();
|
|
2481
|
+
}
|
|
2482
|
+
getPitch() {
|
|
2483
|
+
var _a;
|
|
2484
|
+
return (_a = this.amap) == null ? void 0 : _a.getPitch();
|
|
2485
|
+
}
|
|
2486
|
+
setPitch(pitch, immediately, duration) {
|
|
2487
|
+
var _a;
|
|
2488
|
+
(_a = this.amap) == null ? void 0 : _a.setPitch(pitch, immediately, duration);
|
|
2489
|
+
}
|
|
2490
|
+
getRotation() {
|
|
2491
|
+
var _a;
|
|
2492
|
+
return (_a = this.amap) == null ? void 0 : _a.getRotation();
|
|
2493
|
+
}
|
|
2494
|
+
setRotation(rotation, immediately, duration) {
|
|
2495
|
+
var _a;
|
|
2496
|
+
(_a = this.amap) == null ? void 0 : _a.setRotation(rotation, immediately, duration);
|
|
2497
|
+
}
|
|
2498
|
+
setBounds(bounds, immediately, avoid) {
|
|
2499
|
+
var _a;
|
|
2500
|
+
(_a = this.amap) == null ? void 0 : _a.setBounds(bounds, immediately, avoid);
|
|
2501
|
+
}
|
|
2502
|
+
panTo(lnglat, duration) {
|
|
2503
|
+
var _a;
|
|
2504
|
+
(_a = this.amap) == null ? void 0 : _a.panTo(lnglat, duration);
|
|
2505
|
+
}
|
|
2506
|
+
panBy(x, y, duration) {
|
|
2507
|
+
var _a;
|
|
2508
|
+
(_a = this.amap) == null ? void 0 : _a.panBy(x, y, duration);
|
|
2509
|
+
}
|
|
2510
|
+
add(features) {
|
|
2511
|
+
var _a;
|
|
2512
|
+
(_a = this.amap) == null ? void 0 : _a.add(features);
|
|
2513
|
+
}
|
|
2514
|
+
remove(features) {
|
|
2515
|
+
var _a;
|
|
2516
|
+
(_a = this.amap) == null ? void 0 : _a.remove(features);
|
|
2517
|
+
}
|
|
2518
|
+
lngLatToCoords(lnglat) {
|
|
2519
|
+
var _a;
|
|
2520
|
+
return (_a = this.amap) == null ? void 0 : _a.lngLatToCoords(lnglat);
|
|
2521
|
+
}
|
|
2522
|
+
coordsToLngLat(coords) {
|
|
2523
|
+
var _a;
|
|
2524
|
+
return (_a = this.amap) == null ? void 0 : _a.coordsToLngLat(coords);
|
|
2525
|
+
}
|
|
2526
|
+
lngLatToContainer(lnglat) {
|
|
2527
|
+
var _a;
|
|
2528
|
+
return (_a = this.amap) == null ? void 0 : _a.lngLatToContainer(lnglat);
|
|
2529
|
+
}
|
|
2530
|
+
containerToLngLat(pixel) {
|
|
2531
|
+
var _a;
|
|
2532
|
+
return (_a = this.amap) == null ? void 0 : _a.containerToLngLat(pixel);
|
|
2533
|
+
}
|
|
2534
|
+
coordToContainer(coord) {
|
|
2535
|
+
var _a;
|
|
2536
|
+
return (_a = this.amap) == null ? void 0 : _a.coordToContainer(coord);
|
|
2537
|
+
}
|
|
2538
|
+
containerToCoord(pixel) {
|
|
2539
|
+
var _a;
|
|
2540
|
+
return (_a = this.amap) == null ? void 0 : _a.containerToCoord(pixel);
|
|
2541
|
+
}
|
|
2542
|
+
pixelToLngLat(pixel, z) {
|
|
2543
|
+
var _a;
|
|
2544
|
+
return (_a = this.amap) == null ? void 0 : _a.pixelToLngLat(pixel, z);
|
|
2545
|
+
}
|
|
2546
|
+
lngLatToPixel(lnglat, z) {
|
|
2547
|
+
var _a;
|
|
2548
|
+
return (_a = this.amap) == null ? void 0 : _a.lngLatToPixel(lnglat, z);
|
|
2549
|
+
}
|
|
2550
|
+
getResolution(point) {
|
|
2551
|
+
var _a;
|
|
2552
|
+
return (_a = this.amap) == null ? void 0 : _a.getResolution(point);
|
|
2553
|
+
}
|
|
2554
|
+
getScale(dpi) {
|
|
2555
|
+
var _a;
|
|
2556
|
+
return (_a = this.amap) == null ? void 0 : _a.getScale(dpi);
|
|
2557
|
+
}
|
|
2558
|
+
getCity(cbk, lnglat) {
|
|
2559
|
+
var _a;
|
|
2560
|
+
(_a = this.amap) == null ? void 0 : _a.getCity(cbk, lnglat);
|
|
2561
|
+
}
|
|
2562
|
+
setCity(cityName, cbk) {
|
|
2563
|
+
var _a;
|
|
2564
|
+
(_a = this.amap) == null ? void 0 : _a.setCity(cityName, cbk);
|
|
2565
|
+
}
|
|
2566
|
+
setFitView(overlays, immediately, avoid, maxZoom) {
|
|
2567
|
+
var _a;
|
|
2568
|
+
return (_a = this.amap) == null ? void 0 : _a.setFitView(overlays, immediately, avoid, maxZoom);
|
|
2569
|
+
}
|
|
2570
|
+
getFitZoomAndCenterByOverlays(overlayList, avoid, maxZoom) {
|
|
2571
|
+
var _a;
|
|
2572
|
+
return (_a = this.amap) == null ? void 0 : _a.getFitZoomAndCenterByOverlays(overlayList, avoid, maxZoom);
|
|
2573
|
+
}
|
|
2574
|
+
getFitZoomAndCenterByBounds(bounds, avoid, maxZoom) {
|
|
2575
|
+
var _a;
|
|
2576
|
+
return (_a = this.amap) == null ? void 0 : _a.getFitZoomAndCenterByBounds(bounds, avoid, maxZoom);
|
|
2577
|
+
}
|
|
2578
|
+
addControl(control) {
|
|
2579
|
+
var _a;
|
|
2580
|
+
(_a = this.amap) == null ? void 0 : _a.addControl(control);
|
|
2581
|
+
}
|
|
2582
|
+
removeControl(control) {
|
|
2583
|
+
var _a;
|
|
2584
|
+
(_a = this.amap) == null ? void 0 : _a.removeControl(control);
|
|
2585
|
+
}
|
|
2586
|
+
setMapStyle(value) {
|
|
2587
|
+
var _a;
|
|
2588
|
+
(_a = this.amap) == null ? void 0 : _a.setMapStyle(value);
|
|
2589
|
+
}
|
|
2590
|
+
getMapStyle() {
|
|
2591
|
+
var _a;
|
|
2592
|
+
return (_a = this.amap) == null ? void 0 : _a.getMapStyle();
|
|
2593
|
+
}
|
|
2594
|
+
getAllOverlays(type2) {
|
|
2595
|
+
var _a;
|
|
2596
|
+
return (_a = this.amap) == null ? void 0 : _a.getAllOverlays(type2);
|
|
2597
|
+
}
|
|
2598
|
+
clearMap() {
|
|
2599
|
+
var _a;
|
|
2600
|
+
(_a = this.amap) == null ? void 0 : _a.clearMap();
|
|
2601
|
+
}
|
|
2602
|
+
clearInfoWindow() {
|
|
2603
|
+
var _a;
|
|
2604
|
+
(_a = this.amap) == null ? void 0 : _a.clearInfoWindow();
|
|
2605
|
+
}
|
|
2606
|
+
getFeatures() {
|
|
2607
|
+
var _a;
|
|
2608
|
+
return (_a = this.amap) == null ? void 0 : _a.getFeatures();
|
|
2609
|
+
}
|
|
2610
|
+
setFeatures(features) {
|
|
2611
|
+
var _a;
|
|
2612
|
+
(_a = this.amap) == null ? void 0 : _a.setFeatures(features);
|
|
2613
|
+
}
|
|
2614
|
+
getMapApprovalNumber() {
|
|
2615
|
+
var _a;
|
|
2616
|
+
return (_a = this.amap) == null ? void 0 : _a.getMapApprovalNumber();
|
|
2617
|
+
}
|
|
2618
|
+
setMask(maskPath) {
|
|
2619
|
+
var _a;
|
|
2620
|
+
(_a = this.amap) == null ? void 0 : _a.setMask(maskPath);
|
|
2621
|
+
}
|
|
2622
|
+
setLabelRejectMask(reject) {
|
|
2623
|
+
var _a;
|
|
2624
|
+
(_a = this.amap) == null ? void 0 : _a.setLabelRejectMask(reject);
|
|
2625
|
+
}
|
|
2626
|
+
/**
|
|
2627
|
+
* AMap.coreMap
|
|
2628
|
+
*/
|
|
2629
|
+
getSize() {
|
|
2630
|
+
var _a;
|
|
2631
|
+
return (_a = this.amap) == null ? void 0 : _a.getSize();
|
|
2632
|
+
}
|
|
2633
|
+
addLayer(layer) {
|
|
2634
|
+
var _a;
|
|
2635
|
+
(_a = this.amap) == null ? void 0 : _a.addLayer(layer);
|
|
2636
|
+
}
|
|
2637
|
+
removeLayer(layer) {
|
|
2638
|
+
var _a;
|
|
2639
|
+
(_a = this.amap) == null ? void 0 : _a.removeLayer(layer);
|
|
2640
|
+
}
|
|
2641
|
+
setLayers(layers) {
|
|
2642
|
+
var _a;
|
|
2643
|
+
(_a = this.amap) == null ? void 0 : _a.setLayers(layers);
|
|
2644
|
+
}
|
|
2645
|
+
getLayers() {
|
|
2646
|
+
var _a;
|
|
2647
|
+
return (_a = this.amap) == null ? void 0 : _a.getLayers();
|
|
2648
|
+
}
|
|
2649
|
+
getLayersDangerous() {
|
|
2650
|
+
var _a;
|
|
2651
|
+
return (_a = this.amap) == null ? void 0 : _a.getLayersDangerous();
|
|
2652
|
+
}
|
|
2653
|
+
getStatus() {
|
|
2654
|
+
var _a;
|
|
2655
|
+
return (_a = this.amap) == null ? void 0 : _a.getStatus();
|
|
2656
|
+
}
|
|
2657
|
+
setStatus(status) {
|
|
2658
|
+
var _a;
|
|
2659
|
+
(_a = this.amap) == null ? void 0 : _a.setStatus(status);
|
|
2660
|
+
}
|
|
2661
|
+
getDefaultCursor() {
|
|
2662
|
+
var _a;
|
|
2663
|
+
return (_a = this.amap) == null ? void 0 : _a.getDefaultCursor();
|
|
2664
|
+
}
|
|
2665
|
+
setDefaultCursor(cursor) {
|
|
2666
|
+
var _a;
|
|
2667
|
+
(_a = this.amap) == null ? void 0 : _a.setDefaultCursor(cursor);
|
|
2668
|
+
}
|
|
2669
|
+
getLimitBounds() {
|
|
2670
|
+
var _a;
|
|
2671
|
+
return (_a = this.amap) == null ? void 0 : _a.getLimitBounds();
|
|
2672
|
+
}
|
|
2673
|
+
setLimitBounds(bounds) {
|
|
2674
|
+
var _a;
|
|
2675
|
+
(_a = this.amap) == null ? void 0 : _a.setLimitBounds(bounds);
|
|
2676
|
+
}
|
|
2677
|
+
clearLimitBounds() {
|
|
2678
|
+
var _a;
|
|
2679
|
+
(_a = this.amap) == null ? void 0 : _a.clearLimitBounds();
|
|
2680
|
+
}
|
|
2681
|
+
getZooms() {
|
|
2682
|
+
var _a;
|
|
2683
|
+
return (_a = this.amap) == null ? void 0 : _a.getZooms();
|
|
2684
|
+
}
|
|
2685
|
+
setZooms(zooms) {
|
|
2686
|
+
var _a;
|
|
2687
|
+
(_a = this.amap) == null ? void 0 : _a.setZooms(zooms);
|
|
2688
|
+
}
|
|
2689
|
+
/**
|
|
2690
|
+
* AMap.Event
|
|
2691
|
+
*/
|
|
2692
|
+
on(type2, fn, context2, once) {
|
|
2693
|
+
var _a;
|
|
2694
|
+
(_a = this.amap) == null ? void 0 : _a.on(type2, fn, context2, once);
|
|
2695
|
+
return this;
|
|
2696
|
+
}
|
|
2697
|
+
off(type2, fn, context2) {
|
|
2698
|
+
var _a;
|
|
2699
|
+
(_a = this.amap) == null ? void 0 : _a.off(type2, fn, context2);
|
|
2700
|
+
return this;
|
|
2701
|
+
}
|
|
2702
|
+
hasEvents(type2, fn, context2) {
|
|
2703
|
+
var _a;
|
|
2704
|
+
return !!((_a = this.amap) == null ? void 0 : _a.hasEvents(type2, fn, context2));
|
|
2705
|
+
}
|
|
2706
|
+
clearEvents(type2) {
|
|
2707
|
+
var _a;
|
|
2708
|
+
(_a = this.amap) == null ? void 0 : _a.clearEvents(type2);
|
|
2709
|
+
return this;
|
|
2710
|
+
}
|
|
2711
|
+
emit(type2, data) {
|
|
2712
|
+
var _a;
|
|
2713
|
+
(_a = this.amap) == null ? void 0 : _a.emit(type2, data);
|
|
2714
|
+
return this;
|
|
2715
|
+
}
|
|
2716
|
+
getEvents() {
|
|
2717
|
+
return this.amap.getEvents();
|
|
2718
|
+
}
|
|
2719
|
+
}
|
|
2382
2720
|
const Amap = defineSetup(function Amap2(props, { slots, emit }) {
|
|
2383
2721
|
const {
|
|
2384
2722
|
onDragStart,
|
|
@@ -2422,10 +2760,11 @@ const Amap = defineSetup(function Amap2(props, { slots, emit }) {
|
|
|
2422
2760
|
provideAmap(mapRef);
|
|
2423
2761
|
const { apiMapDistanceVwOfPoints } = useMapLngLatToVw({ mapRef });
|
|
2424
2762
|
useAmapWheelZoomCenter({ mapRef, enableRef: computed(() => !!props.touchZoomCenter) });
|
|
2425
|
-
watchPostEffect(() => {
|
|
2763
|
+
watchPostEffect((onCleanup) => {
|
|
2426
2764
|
if (mapRef.value || !elementRef.value)
|
|
2427
2765
|
return;
|
|
2428
|
-
|
|
2766
|
+
referenceCount.add();
|
|
2767
|
+
const map = new SafeAmap(elementRef.value, {
|
|
2429
2768
|
...defaultOptions,
|
|
2430
2769
|
scrollWheel: defaultOptions.touchZoomCenter ? false : defaultOptions.scrollWheel,
|
|
2431
2770
|
vectorMapForeign
|
|
@@ -2433,6 +2772,13 @@ const Amap = defineSetup(function Amap2(props, { slots, emit }) {
|
|
|
2433
2772
|
window.GlobalAmap = map;
|
|
2434
2773
|
mapRef.value = map;
|
|
2435
2774
|
setMap == null ? void 0 : setMap(map);
|
|
2775
|
+
onCleanup(() => {
|
|
2776
|
+
window.GlobalAmap = void 0;
|
|
2777
|
+
mapRef.value = void 0;
|
|
2778
|
+
setMap == null ? void 0 : setMap(void 0);
|
|
2779
|
+
map == null ? void 0 : map.destroy();
|
|
2780
|
+
referenceCount.remove();
|
|
2781
|
+
});
|
|
2436
2782
|
});
|
|
2437
2783
|
watchNoneImmediatePostEffectForDeepOption(
|
|
2438
2784
|
() => statusOptions.value,
|
|
@@ -2736,18 +3082,26 @@ const AmapPolyline = defineSetup(function AmapPolyline2(props) {
|
|
|
2736
3082
|
const polylineRef = shallowRef();
|
|
2737
3083
|
const mapRef = useAmap();
|
|
2738
3084
|
onMounted(() => {
|
|
3085
|
+
referenceCount.add();
|
|
2739
3086
|
polylineRef.value = new AMap.Polyline({ ...props });
|
|
2740
3087
|
});
|
|
2741
3088
|
onUnmounted(() => {
|
|
2742
|
-
var _a;
|
|
3089
|
+
var _a, _b;
|
|
3090
|
+
referenceCount.remove();
|
|
2743
3091
|
(_a = polylineRef.value) == null ? void 0 : _a.setMap(null);
|
|
3092
|
+
(_b = polylineRef.value) == null ? void 0 : _b.destroy();
|
|
3093
|
+
polylineRef.value = void 0;
|
|
2744
3094
|
});
|
|
2745
|
-
watchPostEffect(() => {
|
|
3095
|
+
watchPostEffect((onCleanup) => {
|
|
2746
3096
|
var _a;
|
|
2747
3097
|
const map = mapRef == null ? void 0 : mapRef.value;
|
|
2748
|
-
if (!map)
|
|
3098
|
+
if (!(map == null ? void 0 : map.amap))
|
|
2749
3099
|
return;
|
|
2750
|
-
(_a = polylineRef.value) == null ? void 0 : _a.setMap(map);
|
|
3100
|
+
(_a = polylineRef.value) == null ? void 0 : _a.setMap(map.amap);
|
|
3101
|
+
onCleanup(() => {
|
|
3102
|
+
var _a2;
|
|
3103
|
+
return (_a2 = polylineRef.value) == null ? void 0 : _a2.setMap(null);
|
|
3104
|
+
});
|
|
2751
3105
|
});
|
|
2752
3106
|
watchNoneImmediatePostEffectForMapProperty(polylineRef, props, [
|
|
2753
3107
|
{ name: "path", defaultValue: [[0, 0]] },
|
|
@@ -3027,7 +3381,7 @@ const useDrivingRoute = (props) => {
|
|
|
3027
3381
|
return supplier === "gmap" ? useGDrivingRoute(props) : useADrivingRoute(props);
|
|
3028
3382
|
};
|
|
3029
3383
|
const amapComputeHeading = (from, to, map) => {
|
|
3030
|
-
if (!map)
|
|
3384
|
+
if (!(map == null ? void 0 : map.amap))
|
|
3031
3385
|
return 0;
|
|
3032
3386
|
const { x: xFrom, y: yFrom } = map.lngLatToContainer(from);
|
|
3033
3387
|
const { x: xTo, y: yTo } = map.lngLatToContainer(to);
|
|
@@ -3119,15 +3473,15 @@ const useAmapFitView = (props) => {
|
|
|
3119
3473
|
const { mapRef, autoFitTimeout } = props;
|
|
3120
3474
|
const overlayGroup = /* @__PURE__ */ new Set();
|
|
3121
3475
|
let timer = void 0;
|
|
3122
|
-
const setFitView = () => {
|
|
3476
|
+
const setFitView = (immediate = false) => {
|
|
3123
3477
|
var _a, _b;
|
|
3124
3478
|
const map = mapRef.value;
|
|
3125
|
-
if (!map)
|
|
3479
|
+
if (!(map == null ? void 0 : map.amap))
|
|
3126
3480
|
return;
|
|
3127
3481
|
const vw = window.innerWidth / 100;
|
|
3128
3482
|
const [top, right, bottom, left] = (_a = props.padding) != null ? _a : [0, 0, 0, 0];
|
|
3129
3483
|
spaceLog("setFitView", "overlayGroup = ", overlayGroup);
|
|
3130
|
-
map.setFitView([...overlayGroup],
|
|
3484
|
+
map.setFitView([...overlayGroup], immediate, [top * vw, bottom * vw, left * vw, right * vw]);
|
|
3131
3485
|
if (overlayGroup.size === 1) {
|
|
3132
3486
|
const [overlay] = [...overlayGroup];
|
|
3133
3487
|
const position = (_b = overlay.getPosition) == null ? void 0 : _b.call(overlay);
|
|
@@ -3307,7 +3661,7 @@ const FitViewOnce = defineSetup(function FitViewOnce2(props, {
|
|
|
3307
3661
|
} = registerOverlay;
|
|
3308
3662
|
onMounted(async () => {
|
|
3309
3663
|
await mapMountedPromise;
|
|
3310
|
-
setFitView();
|
|
3664
|
+
setFitView(!!props.immediate);
|
|
3311
3665
|
});
|
|
3312
3666
|
return () => {
|
|
3313
3667
|
var _a;
|
|
@@ -3389,7 +3743,7 @@ const InterruptableIntervalFitView = defineSetup(function InterruptableIntervalF
|
|
|
3389
3743
|
} = pausableSleep(props.interval));
|
|
3390
3744
|
await sleepPromise;
|
|
3391
3745
|
console.log("InterruptableIntervalFitView setFitView");
|
|
3392
|
-
registerOverlay.setFitView();
|
|
3746
|
+
registerOverlay.setFitView(!!props.immediate);
|
|
3393
3747
|
}
|
|
3394
3748
|
}, {
|
|
3395
3749
|
immediate: true,
|
|
@@ -3576,7 +3930,7 @@ const BusinessQuotingMap = defineLagecySetup(function BusinessQuotingMap2(props,
|
|
|
3576
3930
|
language
|
|
3577
3931
|
} = useMapSupplier();
|
|
3578
3932
|
const fittableRegistryOverlay = createFittableRegisterOverlay(registerOverlay);
|
|
3579
|
-
const deferedSetFitView = pipeDefer(registerOverlay.setFitView);
|
|
3933
|
+
const deferedSetFitView = pipeDefer(() => registerOverlay.setFitView(true));
|
|
3580
3934
|
return () => {
|
|
3581
3935
|
const {
|
|
3582
3936
|
from: inputFromPlace,
|
|
@@ -3829,7 +4183,11 @@ function wechatWatchPosition(onSuccess, onError, option) {
|
|
|
3829
4183
|
isHandled = true;
|
|
3830
4184
|
const isGeoWorking = isGeoWorkingRef.value;
|
|
3831
4185
|
isGeoWorkingRef.value = false;
|
|
3832
|
-
console.warn(
|
|
4186
|
+
console.warn(
|
|
4187
|
+
"MyWarning: wx.getLocation failed errcode, errmsg = ",
|
|
4188
|
+
res.errCode,
|
|
4189
|
+
res.errMsg
|
|
4190
|
+
);
|
|
3833
4191
|
resolve(void 0);
|
|
3834
4192
|
if (!isGeoWorking)
|
|
3835
4193
|
return;
|
|
@@ -3919,6 +4277,25 @@ function compatibleWathPosition(onSuccess, onError, option) {
|
|
|
3919
4277
|
const watchId = navigator.geolocation.watchPosition(onSuccess, onError, option);
|
|
3920
4278
|
return () => navigator.geolocation.clearWatch(watchId);
|
|
3921
4279
|
}
|
|
4280
|
+
window.efg = () => my.getLocation({
|
|
4281
|
+
type: 0,
|
|
4282
|
+
cacheTimeout: 1,
|
|
4283
|
+
success(res) {
|
|
4284
|
+
console.log("my.getLocation success = ", JSON.stringify(res, null, 2));
|
|
4285
|
+
},
|
|
4286
|
+
fail(res) {
|
|
4287
|
+
console.log("my.getLocation fail = ", JSON.stringify(res, null, 2));
|
|
4288
|
+
}
|
|
4289
|
+
});
|
|
4290
|
+
window.abc = () => wx.getLocation({
|
|
4291
|
+
type: "wgs84",
|
|
4292
|
+
success(res) {
|
|
4293
|
+
console.log("wx.getLocation success = ", JSON.stringify(res, null, 2));
|
|
4294
|
+
},
|
|
4295
|
+
fail(res) {
|
|
4296
|
+
console.log("wx.getLocation fail = ", JSON.stringify(res, null, 2));
|
|
4297
|
+
}
|
|
4298
|
+
});
|
|
3922
4299
|
class SingleGeoWatch {
|
|
3923
4300
|
constructor(option) {
|
|
3924
4301
|
__publicField(this, "id", 0);
|
|
@@ -4067,11 +4444,11 @@ const useHeycarAmap = () => {
|
|
|
4067
4444
|
const { apiMapDistanceVwOfPoints } = useMapLngLatToVw({ mapRef: amapRef });
|
|
4068
4445
|
const setMap = (map) => {
|
|
4069
4446
|
amapRef.value = map;
|
|
4070
|
-
amapElementRef.value = map.getContainer();
|
|
4447
|
+
amapElementRef.value = map == null ? void 0 : map.getContainer();
|
|
4071
4448
|
};
|
|
4072
4449
|
const panTo = async (value) => {
|
|
4073
4450
|
const amap2 = amapRef.value;
|
|
4074
|
-
if (!amap2)
|
|
4451
|
+
if (!(amap2 == null ? void 0 : amap2.amap))
|
|
4075
4452
|
return;
|
|
4076
4453
|
const { lng, lat } = amap2.getCenter();
|
|
4077
4454
|
const distanceVw = apiMapDistanceVwOfPoints(value, [lng, lat]);
|
|
@@ -4091,7 +4468,7 @@ const useHeycarGamp = () => {
|
|
|
4091
4468
|
const gmapElementRef = shallowRef();
|
|
4092
4469
|
const setMap = (map) => {
|
|
4093
4470
|
gmapRef.value = map;
|
|
4094
|
-
gmapElementRef.value = map.getDiv();
|
|
4471
|
+
gmapElementRef.value = map == null ? void 0 : map.getDiv();
|
|
4095
4472
|
};
|
|
4096
4473
|
const panTo = (value) => {
|
|
4097
4474
|
var _a;
|
|
@@ -6034,7 +6411,7 @@ const useAmapZoom = (props) => {
|
|
|
6034
6411
|
watch(
|
|
6035
6412
|
() => mapRef.value,
|
|
6036
6413
|
(map) => {
|
|
6037
|
-
if (!map)
|
|
6414
|
+
if (!(map == null ? void 0 : map.amap))
|
|
6038
6415
|
return;
|
|
6039
6416
|
zoomRef.value = map.getZoom();
|
|
6040
6417
|
}
|
|
@@ -6082,20 +6459,28 @@ const AmapPolygon = defineSetup(function AmapPolygon2(props) {
|
|
|
6082
6459
|
const polygonRef = shallowRef();
|
|
6083
6460
|
const mapRef = useAmap();
|
|
6084
6461
|
onMounted(() => {
|
|
6462
|
+
referenceCount.add();
|
|
6085
6463
|
polygonRef.value = new AMap.Polygon();
|
|
6086
6464
|
polygonRef.value.setOptions(props);
|
|
6087
6465
|
});
|
|
6088
6466
|
onUnmounted(() => {
|
|
6089
|
-
var _a;
|
|
6467
|
+
var _a, _b;
|
|
6468
|
+
referenceCount.remove();
|
|
6090
6469
|
(_a = polygonRef.value) == null ? void 0 : _a.setMap(null);
|
|
6470
|
+
(_b = polygonRef.value) == null ? void 0 : _b.destroy();
|
|
6471
|
+
polygonRef.value = void 0;
|
|
6091
6472
|
});
|
|
6092
6473
|
useAmapFixBugPolygonDrag(polygonRef);
|
|
6093
|
-
watchPostEffect(() => {
|
|
6474
|
+
watchPostEffect((onCleanup) => {
|
|
6094
6475
|
var _a;
|
|
6095
6476
|
const map = mapRef == null ? void 0 : mapRef.value;
|
|
6096
|
-
if (!map)
|
|
6477
|
+
if (!(map == null ? void 0 : map.amap))
|
|
6097
6478
|
return;
|
|
6098
|
-
(_a = polygonRef.value) == null ? void 0 : _a.setMap(map);
|
|
6479
|
+
(_a = polygonRef.value) == null ? void 0 : _a.setMap(map.amap);
|
|
6480
|
+
onCleanup(() => {
|
|
6481
|
+
var _a2;
|
|
6482
|
+
return (_a2 = polygonRef.value) == null ? void 0 : _a2.setMap(null);
|
|
6483
|
+
});
|
|
6099
6484
|
});
|
|
6100
6485
|
watchNoneImmediatePostEffectForMapProperty(polygonRef, props, [
|
|
6101
6486
|
{ name: "path", defaultValue: [[0, 0]] },
|
|
@@ -7573,10 +7958,12 @@ const SectionDispatching = defineSetup(function SectionDispatching2(props) {
|
|
|
7573
7958
|
}
|
|
7574
7959
|
}), h(FitViewOnce, {
|
|
7575
7960
|
"attrs": {
|
|
7576
|
-
"registerOverlay": registerOverlay
|
|
7961
|
+
"registerOverlay": registerOverlay,
|
|
7962
|
+
"immediate": true
|
|
7577
7963
|
}
|
|
7578
7964
|
}), h(InterruptableIntervalFitView, {
|
|
7579
7965
|
"attrs": {
|
|
7966
|
+
"immediate": true,
|
|
7580
7967
|
"interval": AUTO_FIT_VIEW_INTERVAL,
|
|
7581
7968
|
"registerOverlay": registerOverlay
|
|
7582
7969
|
}
|
|
@@ -7648,7 +8035,8 @@ const SectionConfirmed = defineSetup(function SectionConfirmed2(props) {
|
|
|
7648
8035
|
}
|
|
7649
8036
|
}), h(FitViewOnce, {
|
|
7650
8037
|
"attrs": {
|
|
7651
|
-
"registerOverlay": registerOverlay
|
|
8038
|
+
"registerOverlay": registerOverlay,
|
|
8039
|
+
"immediate": true
|
|
7652
8040
|
}
|
|
7653
8041
|
}), h(InterruptableIntervalFitView, {
|
|
7654
8042
|
"attrs": {
|
|
@@ -7754,7 +8142,8 @@ const SectionDriverStartService = defineSetup(function SectionDriverStartService
|
|
|
7754
8142
|
}
|
|
7755
8143
|
}), h(FitViewOnce, {
|
|
7756
8144
|
"attrs": {
|
|
7757
|
-
"registerOverlay": registerOverlay
|
|
8145
|
+
"registerOverlay": registerOverlay,
|
|
8146
|
+
"immediate": true
|
|
7758
8147
|
}
|
|
7759
8148
|
}), h(InterruptableIntervalFitView, {
|
|
7760
8149
|
"attrs": {
|
|
@@ -7841,7 +8230,8 @@ const SectionBookDispatched = defineSetup(function SectionBookDispatched2(props)
|
|
|
7841
8230
|
}
|
|
7842
8231
|
}), h(FitViewOnce, {
|
|
7843
8232
|
"attrs": {
|
|
7844
|
-
"registerOverlay": registerOverlay
|
|
8233
|
+
"registerOverlay": registerOverlay,
|
|
8234
|
+
"immediate": true
|
|
7845
8235
|
}
|
|
7846
8236
|
}), h(InterruptableIntervalFitView, {
|
|
7847
8237
|
"attrs": {
|
|
@@ -7914,7 +8304,8 @@ const SectionDriverArrived = defineSetup(function SectionDriverArrived2(props) {
|
|
|
7914
8304
|
}
|
|
7915
8305
|
}), h(FitViewOnce, {
|
|
7916
8306
|
"attrs": {
|
|
7917
|
-
"registerOverlay": registerOverlay
|
|
8307
|
+
"registerOverlay": registerOverlay,
|
|
8308
|
+
"immediate": true
|
|
7918
8309
|
}
|
|
7919
8310
|
}), h(InterruptableIntervalFitView, {
|
|
7920
8311
|
"attrs": {
|
|
@@ -7998,7 +8389,8 @@ const SectionInService = defineSetup(function SectionInService2(props) {
|
|
|
7998
8389
|
}
|
|
7999
8390
|
}), h(FitViewOnce, {
|
|
8000
8391
|
"attrs": {
|
|
8001
|
-
"registerOverlay": registerOverlay
|
|
8392
|
+
"registerOverlay": registerOverlay,
|
|
8393
|
+
"immediate": true
|
|
8002
8394
|
}
|
|
8003
8395
|
}), h(InterruptableIntervalFitView, {
|
|
8004
8396
|
"attrs": {
|
|
@@ -8048,10 +8440,12 @@ const SectionCanceled = defineSetup(function SectionCanceled2(props) {
|
|
|
8048
8440
|
}
|
|
8049
8441
|
}), h(FitViewOnce, {
|
|
8050
8442
|
"attrs": {
|
|
8051
|
-
"registerOverlay": registerOverlay
|
|
8443
|
+
"registerOverlay": registerOverlay,
|
|
8444
|
+
"immediate": true
|
|
8052
8445
|
}
|
|
8053
8446
|
}), h(InterruptableIntervalFitView, {
|
|
8054
8447
|
"attrs": {
|
|
8448
|
+
"immediate": true,
|
|
8055
8449
|
"interval": AUTO_FIT_VIEW_INTERVAL,
|
|
8056
8450
|
"registerOverlay": registerOverlay
|
|
8057
8451
|
}
|
|
@@ -8111,11 +8505,13 @@ const SectionEndService = defineSetup(function SectionEndService2(props) {
|
|
|
8111
8505
|
}
|
|
8112
8506
|
}), h(FitViewOnce, {
|
|
8113
8507
|
"attrs": {
|
|
8114
|
-
"registerOverlay": registerOverlay
|
|
8508
|
+
"registerOverlay": registerOverlay,
|
|
8509
|
+
"immediate": true
|
|
8115
8510
|
}
|
|
8116
8511
|
}), h(InterruptableIntervalFitView, {
|
|
8117
8512
|
"attrs": {
|
|
8118
8513
|
"interval": AUTO_FIT_VIEW_INTERVAL,
|
|
8514
|
+
"immediate": true,
|
|
8119
8515
|
"registerOverlay": registerOverlay
|
|
8120
8516
|
}
|
|
8121
8517
|
})]);
|
|
@@ -8133,7 +8529,7 @@ const BusinessTaxiEndMap = defineSetup(function BusinessTaxiEndMap2(props) {
|
|
|
8133
8529
|
autoFitTimeout: 5e3,
|
|
8134
8530
|
padding: [19, 36, 19, 26]
|
|
8135
8531
|
});
|
|
8136
|
-
const deferedSetFitView = pipeDefer(registerFitVeiw.setFitView);
|
|
8532
|
+
const deferedSetFitView = pipeDefer(() => registerFitVeiw.setFitView(true));
|
|
8137
8533
|
return () => {
|
|
8138
8534
|
const {
|
|
8139
8535
|
from: inputFrom,
|
|
@@ -8172,7 +8568,7 @@ const BusinessTaxiServiceMap = defineLagecySetup(function BusinessTaxiServiceMap
|
|
|
8172
8568
|
renderStartSerivceTitle,
|
|
8173
8569
|
renderInServiceTitle
|
|
8174
8570
|
} = props;
|
|
8175
|
-
const deferedSetFitView = pipeDefer(registerOverlay.setFitView);
|
|
8571
|
+
const deferedSetFitView = pipeDefer(() => registerOverlay.setFitView(true));
|
|
8176
8572
|
const {
|
|
8177
8573
|
setMap,
|
|
8178
8574
|
mapElementRef
|