@heycar/heycars-map 0.9.3 → 0.9.4
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 +71 -40
- package/dist/index.js +71 -40
- package/dist/src/api/contants.d.ts +3 -3
- package/dist/src/utils/transform.d.ts +17 -3
- package/package.json +1 -1
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.9.
|
|
12
|
+
const version = "0.9.4";
|
|
13
13
|
const type = "module";
|
|
14
14
|
const scripts = {
|
|
15
15
|
dev: "vite -c vite.config.dev.ts",
|
|
@@ -1110,14 +1110,6 @@ function assertAngle(angle) {
|
|
|
1110
1110
|
return;
|
|
1111
1111
|
throw new Error(`Assertion Error: expect type number | undefined, actual is ${angle}`);
|
|
1112
1112
|
}
|
|
1113
|
-
function assertZone(zone) {
|
|
1114
|
-
try {
|
|
1115
|
-
if (Array.isArray(zone == null ? void 0 : zone.path) && zone.path.every(assertPoint))
|
|
1116
|
-
return;
|
|
1117
|
-
} catch (err) {
|
|
1118
|
-
throw new Error(`Assertion Error: expect type Zone, actual is ${JSON.stringify(zone)}`);
|
|
1119
|
-
}
|
|
1120
|
-
}
|
|
1121
1113
|
const isLatLngLiteral = (value) => {
|
|
1122
1114
|
return value != null && typeof value === "object" && Number.isFinite(value.lat) && Number.isFinite(value.lng);
|
|
1123
1115
|
};
|
|
@@ -1163,9 +1155,9 @@ const pausableSleep = (milliSeconds) => {
|
|
|
1163
1155
|
};
|
|
1164
1156
|
return { sleepPromise: sleepDefered, pause, restart };
|
|
1165
1157
|
};
|
|
1166
|
-
const MAX_ANIMATION_DISTANCE_VW =
|
|
1167
|
-
const MIN_ANIMATION_DURATION =
|
|
1168
|
-
const ANIMATION_DURATION_FOR_100VW =
|
|
1158
|
+
const MAX_ANIMATION_DISTANCE_VW = 300;
|
|
1159
|
+
const MIN_ANIMATION_DURATION = 300;
|
|
1160
|
+
const ANIMATION_DURATION_FOR_100VW = 200;
|
|
1169
1161
|
const ANIMATION_DURATION_PER_ZOOM = 400;
|
|
1170
1162
|
const BEIJIN_POINT = [116.2317, 39.5427];
|
|
1171
1163
|
const ZINDEX_BUBBLE_LAYER = 50;
|
|
@@ -1269,14 +1261,24 @@ const distanceVw2animationDuration = (distance) => {
|
|
|
1269
1261
|
const deltaZoom2animationDuration = (deltaZoom) => {
|
|
1270
1262
|
return Math.max(MIN_ANIMATION_DURATION * 4, Math.abs(deltaZoom) * ANIMATION_DURATION_PER_ZOOM);
|
|
1271
1263
|
};
|
|
1264
|
+
const throwTypeError = (typeName, value, detail) => {
|
|
1265
|
+
if (detail)
|
|
1266
|
+
new Error(
|
|
1267
|
+
`MyTypeError: expect type: ${typeName}, but received: ${JSON.stringify(
|
|
1268
|
+
value
|
|
1269
|
+
)}
|
|
1270
|
+
Type Error Details: ${detail}`
|
|
1271
|
+
);
|
|
1272
|
+
throw new Error(`MyTypeError: expect type: ${typeName}, but received: ${JSON.stringify(value)}`);
|
|
1273
|
+
};
|
|
1272
1274
|
const toPlaceType = (maybePlace) => {
|
|
1273
1275
|
var _a;
|
|
1274
1276
|
const lng = Number(maybePlace.lng);
|
|
1275
1277
|
if (isNaN(lng))
|
|
1276
|
-
|
|
1278
|
+
throwTypeError("Place", maybePlace, "lng is not number");
|
|
1277
1279
|
const lat = Number(maybePlace.lat);
|
|
1278
1280
|
if (isNaN(lat))
|
|
1279
|
-
|
|
1281
|
+
throwTypeError("Place", maybePlace, "lat is not number");
|
|
1280
1282
|
return {
|
|
1281
1283
|
lng,
|
|
1282
1284
|
lat,
|
|
@@ -1284,6 +1286,37 @@ const toPlaceType = (maybePlace) => {
|
|
|
1284
1286
|
displayName: (_a = maybePlace.displayName) != null ? _a : maybePlace.name
|
|
1285
1287
|
};
|
|
1286
1288
|
};
|
|
1289
|
+
const toPointType = (maybePoint) => {
|
|
1290
|
+
const lng = Number(maybePoint == null ? void 0 : maybePoint[0]);
|
|
1291
|
+
const lat = Number(maybePoint == null ? void 0 : maybePoint[1]);
|
|
1292
|
+
if (isNaN(lat) || isNaN(lng))
|
|
1293
|
+
throwTypeError("Point", maybePoint);
|
|
1294
|
+
return [lng, lat];
|
|
1295
|
+
};
|
|
1296
|
+
const toZoneType = (maybeZone) => {
|
|
1297
|
+
try {
|
|
1298
|
+
if (!maybeZone)
|
|
1299
|
+
throwTypeError("Zone", maybeZone);
|
|
1300
|
+
const { name: name2 = "", path } = maybeZone;
|
|
1301
|
+
if (!Array.isArray(path))
|
|
1302
|
+
throwTypeError("Zone", maybeZone);
|
|
1303
|
+
return { name: name2, path: path.map(toPointType) };
|
|
1304
|
+
} catch (err) {
|
|
1305
|
+
return throwTypeError("Zone", maybeZone, err == null ? void 0 : err.message);
|
|
1306
|
+
}
|
|
1307
|
+
};
|
|
1308
|
+
const toRecommendZonePlacesType = (maybeRecomendZonePlaces) => {
|
|
1309
|
+
try {
|
|
1310
|
+
const { available, zone, places } = maybeRecomendZonePlaces;
|
|
1311
|
+
return {
|
|
1312
|
+
available: !!available,
|
|
1313
|
+
zone: zone === void 0 ? zone : toZoneType(zone),
|
|
1314
|
+
places: places === void 0 ? places : places.map(toPlaceType)
|
|
1315
|
+
};
|
|
1316
|
+
} catch (err) {
|
|
1317
|
+
return throwTypeError("RecommendZonePlaces", maybeRecomendZonePlaces, err == null ? void 0 : err.message);
|
|
1318
|
+
}
|
|
1319
|
+
};
|
|
1287
1320
|
const wxGetLocationSuccessResponse2GeolocationPosition = (res) => {
|
|
1288
1321
|
const { longitude, latitude, accuracy } = res;
|
|
1289
1322
|
const speed = Number(res.speed);
|
|
@@ -5853,12 +5886,12 @@ const useMapRecomendPlace = (props) => {
|
|
|
5853
5886
|
});
|
|
5854
5887
|
const findAttachedPlace = async (place) => {
|
|
5855
5888
|
var _a;
|
|
5889
|
+
const inputRecommendZonePlaces = (_a = await getRecomendPlace({ ...place }, context2)) != null ? _a : {};
|
|
5856
5890
|
const {
|
|
5857
|
-
places:
|
|
5891
|
+
places: placeCandidates,
|
|
5858
5892
|
zone,
|
|
5859
5893
|
available = false
|
|
5860
|
-
} = (
|
|
5861
|
-
const placeCandidates = inputPlaceCandidates == null ? void 0 : inputPlaceCandidates.map(toPlaceType);
|
|
5894
|
+
} = toRecommendZonePlacesType(inputRecommendZonePlaces);
|
|
5862
5895
|
if (!available || !placeCandidates) {
|
|
5863
5896
|
return { place: { ...place }, zone, candidates: [], available };
|
|
5864
5897
|
}
|
|
@@ -5919,13 +5952,13 @@ const useMapRecomendPlace = (props) => {
|
|
|
5919
5952
|
};
|
|
5920
5953
|
const updatePlaceCandidates = async (place) => {
|
|
5921
5954
|
var _a;
|
|
5955
|
+
const inputRecommendZonePlaces = (_a = await getRecomendPlace({ ...place }, context2)) != null ? _a : {};
|
|
5922
5956
|
const {
|
|
5923
|
-
places:
|
|
5957
|
+
places: placeCandidates,
|
|
5924
5958
|
zone,
|
|
5925
|
-
available
|
|
5926
|
-
} = (
|
|
5959
|
+
available = false
|
|
5960
|
+
} = toRecommendZonePlacesType(inputRecommendZonePlaces);
|
|
5927
5961
|
const isSameZone = !!zone && isZoneEqual(zone, zoneRef.value);
|
|
5928
|
-
const placeCandidates = inputPlaceCandidates == null ? void 0 : inputPlaceCandidates.map(toPlaceType);
|
|
5929
5962
|
availableRef.value = !!available;
|
|
5930
5963
|
zoneRef.value = zone;
|
|
5931
5964
|
placeCandidatesRef.value = placeCandidates != null ? placeCandidates : [];
|
|
@@ -6729,16 +6762,17 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
6729
6762
|
Object.assign(centerPlace, place);
|
|
6730
6763
|
updateRecommendPlace(place);
|
|
6731
6764
|
};
|
|
6732
|
-
const setCenterPlaceByUserSpecifiedInZone = ({
|
|
6733
|
-
place:
|
|
6734
|
-
recommends
|
|
6765
|
+
const setCenterPlaceByUserSpecifiedInZone = async ({
|
|
6766
|
+
place: inputPlace,
|
|
6767
|
+
recommends: inputRecommends
|
|
6735
6768
|
}) => {
|
|
6736
|
-
const place = toPlaceType(
|
|
6737
|
-
|
|
6769
|
+
const place = toPlaceType(inputPlace);
|
|
6770
|
+
const recommends = toRecommendZonePlacesType(inputRecommends);
|
|
6771
|
+
const isSameZone = recommends.zone && isZoneEqual(recommends.zone, zoneRef.value);
|
|
6772
|
+
if (!isSameZone)
|
|
6773
|
+
setZoom(ZONE_ZOOM);
|
|
6738
6774
|
Object.assign(centerPlace, place);
|
|
6739
6775
|
setPlaceCandidatesAndZone(recommends);
|
|
6740
|
-
if (!isZoneEqual(recommends.zone, zoneRef.value))
|
|
6741
|
-
setZoom(ZONE_ZOOM);
|
|
6742
6776
|
emit("changePlace", {
|
|
6743
6777
|
...place
|
|
6744
6778
|
});
|
|
@@ -6849,7 +6883,6 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
6849
6883
|
isInZone,
|
|
6850
6884
|
isSameZone
|
|
6851
6885
|
}) => {
|
|
6852
|
-
debugger;
|
|
6853
6886
|
centerSource.source = "recomend";
|
|
6854
6887
|
if (isPlaceEqual(place, centerPlace))
|
|
6855
6888
|
panTo(place2point(place));
|
|
@@ -6974,15 +7007,16 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
|
|
|
6974
7007
|
Object.assign(centerPlace, place);
|
|
6975
7008
|
updateRecommendPlace(place);
|
|
6976
7009
|
};
|
|
6977
|
-
const setCenterPlaceByUserSpecifiedInZone = ({
|
|
6978
|
-
place:
|
|
6979
|
-
recommends
|
|
7010
|
+
const setCenterPlaceByUserSpecifiedInZone = async ({
|
|
7011
|
+
place: inputPlace,
|
|
7012
|
+
recommends: inputRecommends
|
|
6980
7013
|
}) => {
|
|
6981
|
-
const place = toPlaceType(
|
|
6982
|
-
|
|
6983
|
-
|
|
6984
|
-
if (!
|
|
7014
|
+
const place = toPlaceType(inputPlace);
|
|
7015
|
+
const recommends = toRecommendZonePlacesType(inputRecommends);
|
|
7016
|
+
const isSameZone = recommends.zone && isZoneEqual(recommends.zone, zoneRef.value);
|
|
7017
|
+
if (!isSameZone)
|
|
6985
7018
|
setZoom(ZONE_ZOOM);
|
|
7019
|
+
Object.assign(centerPlace, place);
|
|
6986
7020
|
setPlaceCandidatesAndZone(recommends);
|
|
6987
7021
|
emit("changePlace", {
|
|
6988
7022
|
...place
|
|
@@ -6991,10 +7025,7 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
|
|
|
6991
7025
|
const panToCenterByPlace = async (place) => {
|
|
6992
7026
|
centerSource.source = "api";
|
|
6993
7027
|
await panTo(place2point(place));
|
|
6994
|
-
centerPlace
|
|
6995
|
-
centerPlace.lat = place.lat;
|
|
6996
|
-
centerPlace.name = place.name;
|
|
6997
|
-
centerPlace.displayName = place.displayName;
|
|
7028
|
+
Object.assign(centerPlace, place);
|
|
6998
7029
|
emit("changePlace", {
|
|
6999
7030
|
...place
|
|
7000
7031
|
});
|
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.9.
|
|
10
|
+
const version = "0.9.4";
|
|
11
11
|
const type = "module";
|
|
12
12
|
const scripts = {
|
|
13
13
|
dev: "vite -c vite.config.dev.ts",
|
|
@@ -1108,14 +1108,6 @@ function assertAngle(angle) {
|
|
|
1108
1108
|
return;
|
|
1109
1109
|
throw new Error(`Assertion Error: expect type number | undefined, actual is ${angle}`);
|
|
1110
1110
|
}
|
|
1111
|
-
function assertZone(zone) {
|
|
1112
|
-
try {
|
|
1113
|
-
if (Array.isArray(zone == null ? void 0 : zone.path) && zone.path.every(assertPoint))
|
|
1114
|
-
return;
|
|
1115
|
-
} catch (err) {
|
|
1116
|
-
throw new Error(`Assertion Error: expect type Zone, actual is ${JSON.stringify(zone)}`);
|
|
1117
|
-
}
|
|
1118
|
-
}
|
|
1119
1111
|
const isLatLngLiteral = (value) => {
|
|
1120
1112
|
return value != null && typeof value === "object" && Number.isFinite(value.lat) && Number.isFinite(value.lng);
|
|
1121
1113
|
};
|
|
@@ -1161,9 +1153,9 @@ const pausableSleep = (milliSeconds) => {
|
|
|
1161
1153
|
};
|
|
1162
1154
|
return { sleepPromise: sleepDefered, pause, restart };
|
|
1163
1155
|
};
|
|
1164
|
-
const MAX_ANIMATION_DISTANCE_VW =
|
|
1165
|
-
const MIN_ANIMATION_DURATION =
|
|
1166
|
-
const ANIMATION_DURATION_FOR_100VW =
|
|
1156
|
+
const MAX_ANIMATION_DISTANCE_VW = 300;
|
|
1157
|
+
const MIN_ANIMATION_DURATION = 300;
|
|
1158
|
+
const ANIMATION_DURATION_FOR_100VW = 200;
|
|
1167
1159
|
const ANIMATION_DURATION_PER_ZOOM = 400;
|
|
1168
1160
|
const BEIJIN_POINT = [116.2317, 39.5427];
|
|
1169
1161
|
const ZINDEX_BUBBLE_LAYER = 50;
|
|
@@ -1267,14 +1259,24 @@ const distanceVw2animationDuration = (distance) => {
|
|
|
1267
1259
|
const deltaZoom2animationDuration = (deltaZoom) => {
|
|
1268
1260
|
return Math.max(MIN_ANIMATION_DURATION * 4, Math.abs(deltaZoom) * ANIMATION_DURATION_PER_ZOOM);
|
|
1269
1261
|
};
|
|
1262
|
+
const throwTypeError = (typeName, value, detail) => {
|
|
1263
|
+
if (detail)
|
|
1264
|
+
new Error(
|
|
1265
|
+
`MyTypeError: expect type: ${typeName}, but received: ${JSON.stringify(
|
|
1266
|
+
value
|
|
1267
|
+
)}
|
|
1268
|
+
Type Error Details: ${detail}`
|
|
1269
|
+
);
|
|
1270
|
+
throw new Error(`MyTypeError: expect type: ${typeName}, but received: ${JSON.stringify(value)}`);
|
|
1271
|
+
};
|
|
1270
1272
|
const toPlaceType = (maybePlace) => {
|
|
1271
1273
|
var _a;
|
|
1272
1274
|
const lng = Number(maybePlace.lng);
|
|
1273
1275
|
if (isNaN(lng))
|
|
1274
|
-
|
|
1276
|
+
throwTypeError("Place", maybePlace, "lng is not number");
|
|
1275
1277
|
const lat = Number(maybePlace.lat);
|
|
1276
1278
|
if (isNaN(lat))
|
|
1277
|
-
|
|
1279
|
+
throwTypeError("Place", maybePlace, "lat is not number");
|
|
1278
1280
|
return {
|
|
1279
1281
|
lng,
|
|
1280
1282
|
lat,
|
|
@@ -1282,6 +1284,37 @@ const toPlaceType = (maybePlace) => {
|
|
|
1282
1284
|
displayName: (_a = maybePlace.displayName) != null ? _a : maybePlace.name
|
|
1283
1285
|
};
|
|
1284
1286
|
};
|
|
1287
|
+
const toPointType = (maybePoint) => {
|
|
1288
|
+
const lng = Number(maybePoint == null ? void 0 : maybePoint[0]);
|
|
1289
|
+
const lat = Number(maybePoint == null ? void 0 : maybePoint[1]);
|
|
1290
|
+
if (isNaN(lat) || isNaN(lng))
|
|
1291
|
+
throwTypeError("Point", maybePoint);
|
|
1292
|
+
return [lng, lat];
|
|
1293
|
+
};
|
|
1294
|
+
const toZoneType = (maybeZone) => {
|
|
1295
|
+
try {
|
|
1296
|
+
if (!maybeZone)
|
|
1297
|
+
throwTypeError("Zone", maybeZone);
|
|
1298
|
+
const { name: name2 = "", path } = maybeZone;
|
|
1299
|
+
if (!Array.isArray(path))
|
|
1300
|
+
throwTypeError("Zone", maybeZone);
|
|
1301
|
+
return { name: name2, path: path.map(toPointType) };
|
|
1302
|
+
} catch (err) {
|
|
1303
|
+
return throwTypeError("Zone", maybeZone, err == null ? void 0 : err.message);
|
|
1304
|
+
}
|
|
1305
|
+
};
|
|
1306
|
+
const toRecommendZonePlacesType = (maybeRecomendZonePlaces) => {
|
|
1307
|
+
try {
|
|
1308
|
+
const { available, zone, places } = maybeRecomendZonePlaces;
|
|
1309
|
+
return {
|
|
1310
|
+
available: !!available,
|
|
1311
|
+
zone: zone === void 0 ? zone : toZoneType(zone),
|
|
1312
|
+
places: places === void 0 ? places : places.map(toPlaceType)
|
|
1313
|
+
};
|
|
1314
|
+
} catch (err) {
|
|
1315
|
+
return throwTypeError("RecommendZonePlaces", maybeRecomendZonePlaces, err == null ? void 0 : err.message);
|
|
1316
|
+
}
|
|
1317
|
+
};
|
|
1285
1318
|
const wxGetLocationSuccessResponse2GeolocationPosition = (res) => {
|
|
1286
1319
|
const { longitude, latitude, accuracy } = res;
|
|
1287
1320
|
const speed = Number(res.speed);
|
|
@@ -5851,12 +5884,12 @@ const useMapRecomendPlace = (props) => {
|
|
|
5851
5884
|
});
|
|
5852
5885
|
const findAttachedPlace = async (place) => {
|
|
5853
5886
|
var _a;
|
|
5887
|
+
const inputRecommendZonePlaces = (_a = await getRecomendPlace({ ...place }, context2)) != null ? _a : {};
|
|
5854
5888
|
const {
|
|
5855
|
-
places:
|
|
5889
|
+
places: placeCandidates,
|
|
5856
5890
|
zone,
|
|
5857
5891
|
available = false
|
|
5858
|
-
} = (
|
|
5859
|
-
const placeCandidates = inputPlaceCandidates == null ? void 0 : inputPlaceCandidates.map(toPlaceType);
|
|
5892
|
+
} = toRecommendZonePlacesType(inputRecommendZonePlaces);
|
|
5860
5893
|
if (!available || !placeCandidates) {
|
|
5861
5894
|
return { place: { ...place }, zone, candidates: [], available };
|
|
5862
5895
|
}
|
|
@@ -5917,13 +5950,13 @@ const useMapRecomendPlace = (props) => {
|
|
|
5917
5950
|
};
|
|
5918
5951
|
const updatePlaceCandidates = async (place) => {
|
|
5919
5952
|
var _a;
|
|
5953
|
+
const inputRecommendZonePlaces = (_a = await getRecomendPlace({ ...place }, context2)) != null ? _a : {};
|
|
5920
5954
|
const {
|
|
5921
|
-
places:
|
|
5955
|
+
places: placeCandidates,
|
|
5922
5956
|
zone,
|
|
5923
|
-
available
|
|
5924
|
-
} = (
|
|
5957
|
+
available = false
|
|
5958
|
+
} = toRecommendZonePlacesType(inputRecommendZonePlaces);
|
|
5925
5959
|
const isSameZone = !!zone && isZoneEqual(zone, zoneRef.value);
|
|
5926
|
-
const placeCandidates = inputPlaceCandidates == null ? void 0 : inputPlaceCandidates.map(toPlaceType);
|
|
5927
5960
|
availableRef.value = !!available;
|
|
5928
5961
|
zoneRef.value = zone;
|
|
5929
5962
|
placeCandidatesRef.value = placeCandidates != null ? placeCandidates : [];
|
|
@@ -6727,16 +6760,17 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
6727
6760
|
Object.assign(centerPlace, place);
|
|
6728
6761
|
updateRecommendPlace(place);
|
|
6729
6762
|
};
|
|
6730
|
-
const setCenterPlaceByUserSpecifiedInZone = ({
|
|
6731
|
-
place:
|
|
6732
|
-
recommends
|
|
6763
|
+
const setCenterPlaceByUserSpecifiedInZone = async ({
|
|
6764
|
+
place: inputPlace,
|
|
6765
|
+
recommends: inputRecommends
|
|
6733
6766
|
}) => {
|
|
6734
|
-
const place = toPlaceType(
|
|
6735
|
-
|
|
6767
|
+
const place = toPlaceType(inputPlace);
|
|
6768
|
+
const recommends = toRecommendZonePlacesType(inputRecommends);
|
|
6769
|
+
const isSameZone = recommends.zone && isZoneEqual(recommends.zone, zoneRef.value);
|
|
6770
|
+
if (!isSameZone)
|
|
6771
|
+
setZoom(ZONE_ZOOM);
|
|
6736
6772
|
Object.assign(centerPlace, place);
|
|
6737
6773
|
setPlaceCandidatesAndZone(recommends);
|
|
6738
|
-
if (!isZoneEqual(recommends.zone, zoneRef.value))
|
|
6739
|
-
setZoom(ZONE_ZOOM);
|
|
6740
6774
|
emit("changePlace", {
|
|
6741
6775
|
...place
|
|
6742
6776
|
});
|
|
@@ -6847,7 +6881,6 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
6847
6881
|
isInZone,
|
|
6848
6882
|
isSameZone
|
|
6849
6883
|
}) => {
|
|
6850
|
-
debugger;
|
|
6851
6884
|
centerSource.source = "recomend";
|
|
6852
6885
|
if (isPlaceEqual(place, centerPlace))
|
|
6853
6886
|
panTo(place2point(place));
|
|
@@ -6972,15 +7005,16 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
|
|
|
6972
7005
|
Object.assign(centerPlace, place);
|
|
6973
7006
|
updateRecommendPlace(place);
|
|
6974
7007
|
};
|
|
6975
|
-
const setCenterPlaceByUserSpecifiedInZone = ({
|
|
6976
|
-
place:
|
|
6977
|
-
recommends
|
|
7008
|
+
const setCenterPlaceByUserSpecifiedInZone = async ({
|
|
7009
|
+
place: inputPlace,
|
|
7010
|
+
recommends: inputRecommends
|
|
6978
7011
|
}) => {
|
|
6979
|
-
const place = toPlaceType(
|
|
6980
|
-
|
|
6981
|
-
|
|
6982
|
-
if (!
|
|
7012
|
+
const place = toPlaceType(inputPlace);
|
|
7013
|
+
const recommends = toRecommendZonePlacesType(inputRecommends);
|
|
7014
|
+
const isSameZone = recommends.zone && isZoneEqual(recommends.zone, zoneRef.value);
|
|
7015
|
+
if (!isSameZone)
|
|
6983
7016
|
setZoom(ZONE_ZOOM);
|
|
7017
|
+
Object.assign(centerPlace, place);
|
|
6984
7018
|
setPlaceCandidatesAndZone(recommends);
|
|
6985
7019
|
emit("changePlace", {
|
|
6986
7020
|
...place
|
|
@@ -6989,10 +7023,7 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
|
|
|
6989
7023
|
const panToCenterByPlace = async (place) => {
|
|
6990
7024
|
centerSource.source = "api";
|
|
6991
7025
|
await panTo(place2point(place));
|
|
6992
|
-
centerPlace
|
|
6993
|
-
centerPlace.lat = place.lat;
|
|
6994
|
-
centerPlace.name = place.name;
|
|
6995
|
-
centerPlace.displayName = place.displayName;
|
|
7026
|
+
Object.assign(centerPlace, place);
|
|
6996
7027
|
emit("changePlace", {
|
|
6997
7028
|
...place
|
|
6998
7029
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Point } from "../types/interface";
|
|
2
|
-
export declare const MAX_ANIMATION_DISTANCE_VW =
|
|
3
|
-
export declare const MIN_ANIMATION_DURATION =
|
|
4
|
-
export declare const ANIMATION_DURATION_FOR_100VW =
|
|
2
|
+
export declare const MAX_ANIMATION_DISTANCE_VW = 300;
|
|
3
|
+
export declare const MIN_ANIMATION_DURATION = 300;
|
|
4
|
+
export declare const ANIMATION_DURATION_FOR_100VW = 200;
|
|
5
5
|
export declare const ANIMATION_DURATION_PER_ZOOM = 400;
|
|
6
6
|
export declare const BEIJIN_POINT: Point;
|
|
7
7
|
export declare const ZINDEX_BUBBLE_LAYER = 50;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="google.maps" />
|
|
2
|
-
import type { Place, Point, Zone } from "../types/interface";
|
|
2
|
+
import type { Place, Point, RecommendZonePlaces, Zone } from "../types/interface";
|
|
3
3
|
import type { WxGetLocationSuccessResponse } from "../types/wx";
|
|
4
4
|
export declare const vec2lnglat: ([lng, lat]: [number, number]) => google.maps.LatLngLiteral;
|
|
5
5
|
export interface AsteriskItem {
|
|
@@ -26,11 +26,25 @@ interface AmapPlaceName2DisplayNameOptions extends AMap.AddressComponent {
|
|
|
26
26
|
export declare const amapPlaceName2DisplayName: (name: string, options: AmapPlaceName2DisplayNameOptions) => string;
|
|
27
27
|
export declare const distanceVw2animationDuration: (distance: number) => number;
|
|
28
28
|
export declare const deltaZoom2animationDuration: (deltaZoom: number) => number;
|
|
29
|
-
|
|
29
|
+
interface MaybePlace {
|
|
30
30
|
displayName?: string;
|
|
31
31
|
name: string;
|
|
32
32
|
lng: string | number;
|
|
33
33
|
lat: string | number;
|
|
34
|
-
}
|
|
34
|
+
}
|
|
35
|
+
export declare const toPlaceType: (maybePlace: MaybePlace) => Place;
|
|
36
|
+
type MaybePoint = [string | number, string | number];
|
|
37
|
+
export declare const toPointType: (maybePoint: MaybePoint) => Point;
|
|
38
|
+
interface MaybeZone {
|
|
39
|
+
name?: string;
|
|
40
|
+
path: MaybePoint[];
|
|
41
|
+
}
|
|
42
|
+
export declare const toZoneType: (maybeZone: MaybeZone) => Zone;
|
|
43
|
+
interface MaybeRecomendZonePlaces {
|
|
44
|
+
available?: boolean;
|
|
45
|
+
zone?: MaybeZone;
|
|
46
|
+
places?: MaybePlace[];
|
|
47
|
+
}
|
|
48
|
+
export declare const toRecommendZonePlacesType: (maybeRecomendZonePlaces: MaybeRecomendZonePlaces) => RecommendZonePlaces;
|
|
35
49
|
export declare const wxGetLocationSuccessResponse2GeolocationPosition: (res: WxGetLocationSuccessResponse) => GeolocationPosition;
|
|
36
50
|
export {};
|