@heycar/heycars-map 0.8.7 → 0.8.9
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
CHANGED
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
9
9
|
const Vue = require("vue");
|
|
10
10
|
const style = "";
|
|
11
11
|
const name = "@heycar/heycars-map";
|
|
12
|
-
const version = "0.8.
|
|
12
|
+
const version = "0.8.9";
|
|
13
13
|
const type = "module";
|
|
14
14
|
const scripts = {
|
|
15
15
|
dev: "vite -c vite.config.dev.ts",
|
|
@@ -653,7 +653,6 @@ function defineLagecySetup(setup) {
|
|
|
653
653
|
};
|
|
654
654
|
}
|
|
655
655
|
const createElement = Vue.h;
|
|
656
|
-
const LANGUAGE = "zh-CN";
|
|
657
656
|
const AbsoluteAddressBox_css_ts_vanilla = "";
|
|
658
657
|
function _defineProperty(obj, key, value) {
|
|
659
658
|
if (key in obj) {
|
|
@@ -5456,7 +5455,7 @@ const useAmapPlace = (props) => {
|
|
|
5456
5455
|
const { onChange, emptyPlaceName } = props;
|
|
5457
5456
|
const defaultPoint = [...props.pointRef.value];
|
|
5458
5457
|
const pointRef = Vue.ref(defaultPoint);
|
|
5459
|
-
const { readyPromise } = useMapSupplier();
|
|
5458
|
+
const { readyPromise, language } = useMapSupplier();
|
|
5460
5459
|
const { inChina } = useAmapInChina();
|
|
5461
5460
|
const place = Vue.reactive({
|
|
5462
5461
|
lng: pointRef.value[0],
|
|
@@ -5479,7 +5478,7 @@ const useAmapPlace = (props) => {
|
|
|
5479
5478
|
() => [placeKey.value],
|
|
5480
5479
|
async () => {
|
|
5481
5480
|
await readyPromise;
|
|
5482
|
-
const geocoder = new AMap.Geocoder({ lang:
|
|
5481
|
+
const geocoder = new AMap.Geocoder({ lang: language === "en" ? "en" : "zh_cn" });
|
|
5483
5482
|
const [lng, lat] = pointRef.value;
|
|
5484
5483
|
const isChina = inChina([lng, lat]);
|
|
5485
5484
|
geocoder.getAddress(new AMap.LngLat(lng, lat), (status, result) => {
|
|
@@ -5517,7 +5516,7 @@ const useGmapPlace = (props) => {
|
|
|
5517
5516
|
const { onChange, emptyPlaceName } = props;
|
|
5518
5517
|
const defaultPoint = [...props.pointRef.value];
|
|
5519
5518
|
const pointRef = Vue.ref(defaultPoint);
|
|
5520
|
-
const { readyPromise } = useMapSupplier();
|
|
5519
|
+
const { readyPromise, language } = useMapSupplier();
|
|
5521
5520
|
const { idx: placeKey, update } = useUpdate();
|
|
5522
5521
|
const place = Vue.reactive({
|
|
5523
5522
|
lng: pointRef.value[0],
|
|
@@ -5541,7 +5540,7 @@ const useGmapPlace = (props) => {
|
|
|
5541
5540
|
await readyPromise;
|
|
5542
5541
|
const geocoder = new google.maps.Geocoder();
|
|
5543
5542
|
const [lng, lat] = pointRef.value;
|
|
5544
|
-
const { results } = await geocoder.geocode({ language
|
|
5543
|
+
const { results } = await geocoder.geocode({ language, location: { lng, lat } });
|
|
5545
5544
|
const name2 = results[0].formatted_address ? results[0].formatted_address : emptyPlaceName;
|
|
5546
5545
|
const displayName = name2;
|
|
5547
5546
|
place.lng = lng;
|
|
@@ -6140,7 +6139,6 @@ function createLabelDirections(props) {
|
|
|
6140
6139
|
let isDoubleLimited = false;
|
|
6141
6140
|
let prevDx = Infinity;
|
|
6142
6141
|
for (let idx = 0; idx < len; idx++) {
|
|
6143
|
-
debugger;
|
|
6144
6142
|
if (idx === len - 1) {
|
|
6145
6143
|
const direction2 = calcDirection(isLimited, isDoubleLimited, prevDx, prevDirection);
|
|
6146
6144
|
result.push(direction2);
|
|
@@ -6434,6 +6432,8 @@ const RECOMMEND_PLACE_DRAG_LIMIT = 10;
|
|
|
6434
6432
|
const RECOMMEND_PLACE_LARGE_LIMIT = 100;
|
|
6435
6433
|
const RECOMMEND_PLACE_ICON_ZOOM_MIN = 16.25;
|
|
6436
6434
|
const RECOMMEND_PLACE_TEXT_ZOOM_MIN = 16.25;
|
|
6435
|
+
const RECOMMEND_PLACE_ZONE_ICON_MIN = 15.25;
|
|
6436
|
+
const RECOMMEND_PLACE_ZONE_TEXT_MIN = 21;
|
|
6437
6437
|
const DEFAULT_PLACE_NAME = "当前位置";
|
|
6438
6438
|
const DEFAULT_ZOOM = 17;
|
|
6439
6439
|
const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlaceMap2(props, {
|
|
@@ -6658,8 +6658,8 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
6658
6658
|
"attrs": {
|
|
6659
6659
|
"basePlace": centerPlace,
|
|
6660
6660
|
"places": placeCandidates.value,
|
|
6661
|
-
"zoomIconMin": RECOMMEND_PLACE_ICON_ZOOM_MIN,
|
|
6662
|
-
"zoomTextMin": RECOMMEND_PLACE_TEXT_ZOOM_MIN
|
|
6661
|
+
"zoomIconMin": zoneRef.value ? RECOMMEND_PLACE_ZONE_ICON_MIN : RECOMMEND_PLACE_ICON_ZOOM_MIN,
|
|
6662
|
+
"zoomTextMin": zoneRef.value ? RECOMMEND_PLACE_ZONE_TEXT_MIN : RECOMMEND_PLACE_TEXT_ZOOM_MIN
|
|
6663
6663
|
},
|
|
6664
6664
|
"on": {
|
|
6665
6665
|
"click": panToCenterByPlace
|
|
@@ -7418,7 +7418,7 @@ const SectionDriverStartService = defineSetup(function SectionDriverStartService
|
|
|
7418
7418
|
distance,
|
|
7419
7419
|
duration
|
|
7420
7420
|
}) => {
|
|
7421
|
-
var _a;
|
|
7421
|
+
var _a, _b;
|
|
7422
7422
|
spaceLog("angleDifference", "carPosition, routeAngle, driverAngle = ", carPosition, angle, carAngle);
|
|
7423
7423
|
return [Vue.h(DrivingLine, {
|
|
7424
7424
|
"attrs": {
|
|
@@ -7437,7 +7437,7 @@ const SectionDriverStartService = defineSetup(function SectionDriverStartService
|
|
|
7437
7437
|
}), Vue.h(KeyedFitView, {
|
|
7438
7438
|
"attrs": {
|
|
7439
7439
|
"registerOverlay": registerOverlay,
|
|
7440
|
-
"fitViewKey": JSON.stringify(carPosition)
|
|
7440
|
+
"fitViewKey": JSON.stringify((_b = path[0]) != null ? _b : carPosition)
|
|
7441
7441
|
}
|
|
7442
7442
|
})];
|
|
7443
7443
|
}
|
|
@@ -7643,7 +7643,7 @@ const SectionInService = defineSetup(function SectionInService2(props) {
|
|
|
7643
7643
|
distance,
|
|
7644
7644
|
duration
|
|
7645
7645
|
}) => {
|
|
7646
|
-
var _a;
|
|
7646
|
+
var _a, _b;
|
|
7647
7647
|
spaceLog("angleDifference", "carPosition, routeAngle, driverAngle = ", carPosition, angle, carAngle);
|
|
7648
7648
|
return [Vue.h(DrivingLine, {
|
|
7649
7649
|
"attrs": {
|
|
@@ -7662,7 +7662,7 @@ const SectionInService = defineSetup(function SectionInService2(props) {
|
|
|
7662
7662
|
}), Vue.h(KeyedFitView, {
|
|
7663
7663
|
"attrs": {
|
|
7664
7664
|
"registerOverlay": registerOverlay,
|
|
7665
|
-
"fitViewKey": JSON.stringify(carPosition)
|
|
7665
|
+
"fitViewKey": JSON.stringify((_b = path[0]) != null ? _b : carPosition)
|
|
7666
7666
|
}
|
|
7667
7667
|
})];
|
|
7668
7668
|
}
|
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 = "";
|
|
9
9
|
const name = "@heycar/heycars-map";
|
|
10
|
-
const version = "0.8.
|
|
10
|
+
const version = "0.8.9";
|
|
11
11
|
const type = "module";
|
|
12
12
|
const scripts = {
|
|
13
13
|
dev: "vite -c vite.config.dev.ts",
|
|
@@ -651,7 +651,6 @@ function defineLagecySetup(setup) {
|
|
|
651
651
|
};
|
|
652
652
|
}
|
|
653
653
|
const createElement = h;
|
|
654
|
-
const LANGUAGE = "zh-CN";
|
|
655
654
|
const AbsoluteAddressBox_css_ts_vanilla = "";
|
|
656
655
|
function _defineProperty(obj, key, value) {
|
|
657
656
|
if (key in obj) {
|
|
@@ -5454,7 +5453,7 @@ const useAmapPlace = (props) => {
|
|
|
5454
5453
|
const { onChange, emptyPlaceName } = props;
|
|
5455
5454
|
const defaultPoint = [...props.pointRef.value];
|
|
5456
5455
|
const pointRef = ref(defaultPoint);
|
|
5457
|
-
const { readyPromise } = useMapSupplier();
|
|
5456
|
+
const { readyPromise, language } = useMapSupplier();
|
|
5458
5457
|
const { inChina } = useAmapInChina();
|
|
5459
5458
|
const place = reactive({
|
|
5460
5459
|
lng: pointRef.value[0],
|
|
@@ -5477,7 +5476,7 @@ const useAmapPlace = (props) => {
|
|
|
5477
5476
|
() => [placeKey.value],
|
|
5478
5477
|
async () => {
|
|
5479
5478
|
await readyPromise;
|
|
5480
|
-
const geocoder = new AMap.Geocoder({ lang:
|
|
5479
|
+
const geocoder = new AMap.Geocoder({ lang: language === "en" ? "en" : "zh_cn" });
|
|
5481
5480
|
const [lng, lat] = pointRef.value;
|
|
5482
5481
|
const isChina = inChina([lng, lat]);
|
|
5483
5482
|
geocoder.getAddress(new AMap.LngLat(lng, lat), (status, result) => {
|
|
@@ -5515,7 +5514,7 @@ const useGmapPlace = (props) => {
|
|
|
5515
5514
|
const { onChange, emptyPlaceName } = props;
|
|
5516
5515
|
const defaultPoint = [...props.pointRef.value];
|
|
5517
5516
|
const pointRef = ref(defaultPoint);
|
|
5518
|
-
const { readyPromise } = useMapSupplier();
|
|
5517
|
+
const { readyPromise, language } = useMapSupplier();
|
|
5519
5518
|
const { idx: placeKey, update } = useUpdate();
|
|
5520
5519
|
const place = reactive({
|
|
5521
5520
|
lng: pointRef.value[0],
|
|
@@ -5539,7 +5538,7 @@ const useGmapPlace = (props) => {
|
|
|
5539
5538
|
await readyPromise;
|
|
5540
5539
|
const geocoder = new google.maps.Geocoder();
|
|
5541
5540
|
const [lng, lat] = pointRef.value;
|
|
5542
|
-
const { results } = await geocoder.geocode({ language
|
|
5541
|
+
const { results } = await geocoder.geocode({ language, location: { lng, lat } });
|
|
5543
5542
|
const name2 = results[0].formatted_address ? results[0].formatted_address : emptyPlaceName;
|
|
5544
5543
|
const displayName = name2;
|
|
5545
5544
|
place.lng = lng;
|
|
@@ -6138,7 +6137,6 @@ function createLabelDirections(props) {
|
|
|
6138
6137
|
let isDoubleLimited = false;
|
|
6139
6138
|
let prevDx = Infinity;
|
|
6140
6139
|
for (let idx = 0; idx < len; idx++) {
|
|
6141
|
-
debugger;
|
|
6142
6140
|
if (idx === len - 1) {
|
|
6143
6141
|
const direction2 = calcDirection(isLimited, isDoubleLimited, prevDx, prevDirection);
|
|
6144
6142
|
result.push(direction2);
|
|
@@ -6432,6 +6430,8 @@ const RECOMMEND_PLACE_DRAG_LIMIT = 10;
|
|
|
6432
6430
|
const RECOMMEND_PLACE_LARGE_LIMIT = 100;
|
|
6433
6431
|
const RECOMMEND_PLACE_ICON_ZOOM_MIN = 16.25;
|
|
6434
6432
|
const RECOMMEND_PLACE_TEXT_ZOOM_MIN = 16.25;
|
|
6433
|
+
const RECOMMEND_PLACE_ZONE_ICON_MIN = 15.25;
|
|
6434
|
+
const RECOMMEND_PLACE_ZONE_TEXT_MIN = 21;
|
|
6435
6435
|
const DEFAULT_PLACE_NAME = "当前位置";
|
|
6436
6436
|
const DEFAULT_ZOOM = 17;
|
|
6437
6437
|
const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlaceMap2(props, {
|
|
@@ -6656,8 +6656,8 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
6656
6656
|
"attrs": {
|
|
6657
6657
|
"basePlace": centerPlace,
|
|
6658
6658
|
"places": placeCandidates.value,
|
|
6659
|
-
"zoomIconMin": RECOMMEND_PLACE_ICON_ZOOM_MIN,
|
|
6660
|
-
"zoomTextMin": RECOMMEND_PLACE_TEXT_ZOOM_MIN
|
|
6659
|
+
"zoomIconMin": zoneRef.value ? RECOMMEND_PLACE_ZONE_ICON_MIN : RECOMMEND_PLACE_ICON_ZOOM_MIN,
|
|
6660
|
+
"zoomTextMin": zoneRef.value ? RECOMMEND_PLACE_ZONE_TEXT_MIN : RECOMMEND_PLACE_TEXT_ZOOM_MIN
|
|
6661
6661
|
},
|
|
6662
6662
|
"on": {
|
|
6663
6663
|
"click": panToCenterByPlace
|
|
@@ -7416,7 +7416,7 @@ const SectionDriverStartService = defineSetup(function SectionDriverStartService
|
|
|
7416
7416
|
distance,
|
|
7417
7417
|
duration
|
|
7418
7418
|
}) => {
|
|
7419
|
-
var _a;
|
|
7419
|
+
var _a, _b;
|
|
7420
7420
|
spaceLog("angleDifference", "carPosition, routeAngle, driverAngle = ", carPosition, angle, carAngle);
|
|
7421
7421
|
return [h(DrivingLine, {
|
|
7422
7422
|
"attrs": {
|
|
@@ -7435,7 +7435,7 @@ const SectionDriverStartService = defineSetup(function SectionDriverStartService
|
|
|
7435
7435
|
}), h(KeyedFitView, {
|
|
7436
7436
|
"attrs": {
|
|
7437
7437
|
"registerOverlay": registerOverlay,
|
|
7438
|
-
"fitViewKey": JSON.stringify(carPosition)
|
|
7438
|
+
"fitViewKey": JSON.stringify((_b = path[0]) != null ? _b : carPosition)
|
|
7439
7439
|
}
|
|
7440
7440
|
})];
|
|
7441
7441
|
}
|
|
@@ -7641,7 +7641,7 @@ const SectionInService = defineSetup(function SectionInService2(props) {
|
|
|
7641
7641
|
distance,
|
|
7642
7642
|
duration
|
|
7643
7643
|
}) => {
|
|
7644
|
-
var _a;
|
|
7644
|
+
var _a, _b;
|
|
7645
7645
|
spaceLog("angleDifference", "carPosition, routeAngle, driverAngle = ", carPosition, angle, carAngle);
|
|
7646
7646
|
return [h(DrivingLine, {
|
|
7647
7647
|
"attrs": {
|
|
@@ -7660,7 +7660,7 @@ const SectionInService = defineSetup(function SectionInService2(props) {
|
|
|
7660
7660
|
}), h(KeyedFitView, {
|
|
7661
7661
|
"attrs": {
|
|
7662
7662
|
"registerOverlay": registerOverlay,
|
|
7663
|
-
"fitViewKey": JSON.stringify(carPosition)
|
|
7663
|
+
"fitViewKey": JSON.stringify((_b = path[0]) != null ? _b : carPosition)
|
|
7664
7664
|
}
|
|
7665
7665
|
})];
|
|
7666
7666
|
}
|
|
@@ -10,6 +10,8 @@ export declare const RECOMMEND_PLACE_DRAG_LIMIT = 10;
|
|
|
10
10
|
export declare const RECOMMEND_PLACE_LARGE_LIMIT = 100;
|
|
11
11
|
export declare const RECOMMEND_PLACE_ICON_ZOOM_MIN = 16.25;
|
|
12
12
|
export declare const RECOMMEND_PLACE_TEXT_ZOOM_MIN = 16.25;
|
|
13
|
+
export declare const RECOMMEND_PLACE_ZONE_ICON_MIN = 15.25;
|
|
14
|
+
export declare const RECOMMEND_PLACE_ZONE_TEXT_MIN = 21;
|
|
13
15
|
export declare const DEFAULT_PLACE_NAME = "\u5F53\u524D\u4F4D\u7F6E";
|
|
14
16
|
export declare const DEFAULT_ZOOM = 17;
|
|
15
17
|
export interface CenterPlaceSource {
|