@heycar/heycars-map 0.9.23-alpha4 → 0.9.23-alpha5
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 +39 -13
- package/dist/index.js +39 -13
- package/dist/src/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +1 -1
- package/dist/src/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.d.ts +2 -2
- package/dist/src/business-components/StartEndPoint/StartEndPoint.d.ts +2 -2
- package/dist/src/hooks/useMapLoader.d.ts +2 -1
- package/dist/src/hooks/useMapRecomendPlace.d.ts +1 -0
- package/dist/src/types/interface.d.ts +1 -0
- package/dist/src/utils/transform.d.ts +2 -2
- package/package.json +1 -1
- package/dist/src/business-components/BusinessRecomendPlaceMap/useFirstWorkflowRecomendLoading.d.ts +0 -4
package/dist/index.cjs
CHANGED
|
@@ -19,7 +19,7 @@ if (typeof GeolocationPositionError === "undefined") {
|
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
const name = "@heycar/heycars-map";
|
|
22
|
-
const version = "0.9.23-
|
|
22
|
+
const version = "0.9.23-alpha5";
|
|
23
23
|
const type = "module";
|
|
24
24
|
const bin = {
|
|
25
25
|
checkVersion: "./bin/checkVersion.js"
|
|
@@ -1514,6 +1514,7 @@ const language2vectorMapForeign = (lang) => {
|
|
|
1514
1514
|
switch (lang) {
|
|
1515
1515
|
case "en":
|
|
1516
1516
|
return "style_en";
|
|
1517
|
+
case "zh-TW":
|
|
1517
1518
|
case "zh":
|
|
1518
1519
|
return "style_zh_cn";
|
|
1519
1520
|
}
|
|
@@ -1784,11 +1785,6 @@ const createRunOnce = (fn) => {
|
|
|
1784
1785
|
return result;
|
|
1785
1786
|
};
|
|
1786
1787
|
};
|
|
1787
|
-
const createAsyncNoFailNonNullable = (fn, defaultValue) => {
|
|
1788
|
-
return function noFailNoNullable(...args) {
|
|
1789
|
-
return fn(...args).then((result) => result != null ? result : defaultValue).catch(() => defaultValue);
|
|
1790
|
-
};
|
|
1791
|
-
};
|
|
1792
1788
|
const pipeTimeout = (fn, defaultValue, timeout) => {
|
|
1793
1789
|
return function pipedTimeoutedFunction(...args) {
|
|
1794
1790
|
return new Promise((resolve, reject) => {
|
|
@@ -4199,7 +4195,7 @@ const AStartEndPoint = defineSetup(function AStartEndPoint2(props, {
|
|
|
4199
4195
|
type: type2,
|
|
4200
4196
|
language
|
|
4201
4197
|
} = props;
|
|
4202
|
-
const icon = type2 === "start" ? language === "zh" ? imgStartPoint : imgStartPointEn : language === "zh" ? imgEndPoint : imgEndPointEn;
|
|
4198
|
+
const icon = type2 === "start" ? language === "zh" || language === "zh-TW" ? imgStartPoint : imgStartPointEn : language === "zh" || language === "zh-TW" ? imgEndPoint : imgEndPointEn;
|
|
4203
4199
|
const descriptionRow = !description ? "" : decodeAsterisk(description).map((item) => item.type === "normal" ? item.value : `<span class="${pointInfoBoxEmphasize$1}">${item.value}</span>`).join("");
|
|
4204
4200
|
if (!description && !title)
|
|
4205
4201
|
return `<img class="AStartEndPoint ${pointIcon({
|
|
@@ -4267,7 +4263,7 @@ const GStartEndPoint = defineSetup(function GStartEndPoint2(props, {
|
|
|
4267
4263
|
type: type2,
|
|
4268
4264
|
language = "zh"
|
|
4269
4265
|
} = props;
|
|
4270
|
-
const icon = type2 === "start" ? language === "zh" ? imgStartPoint : imgStartPointEn : language === "zh" ? imgEndPoint : imgEndPointEn;
|
|
4266
|
+
const icon = type2 === "start" ? language === "zh" || language === "zh-TW" ? imgStartPoint : imgStartPointEn : language === "zh" || language === "zh-TW" ? imgEndPoint : imgEndPointEn;
|
|
4271
4267
|
const descriptionRow = !description ? "" : decodeAsterisk(description).map((item) => item.type === "normal" ? item.value : `<span class="${pointInfoBoxEmphasize$1}">${item.value}</span>`).join("");
|
|
4272
4268
|
if (!description && !title)
|
|
4273
4269
|
return createDom("img", {
|
|
@@ -7282,6 +7278,25 @@ const useMapPlace = (props) => {
|
|
|
7282
7278
|
const { supplier } = useMapSupplier();
|
|
7283
7279
|
return supplier === "gmap" ? useGmapPlace(props) : useAmapPlace(props);
|
|
7284
7280
|
};
|
|
7281
|
+
function mergeGetRecommendPlaceAndGetAvailable(getRecomendPlace, getAvailable, timeout) {
|
|
7282
|
+
return function mergedGetRecommendPlace(place, context2) {
|
|
7283
|
+
const available = true;
|
|
7284
|
+
return new Promise((resolve) => {
|
|
7285
|
+
getAvailable(place).then((value) => {
|
|
7286
|
+
if (!value)
|
|
7287
|
+
resolve({ available: false });
|
|
7288
|
+
});
|
|
7289
|
+
getRecomendPlace(place, context2).then((result) => {
|
|
7290
|
+
debugger;
|
|
7291
|
+
resolve(result != null ? result : { available });
|
|
7292
|
+
}).catch(() => {
|
|
7293
|
+
debugger;
|
|
7294
|
+
resolve({ available });
|
|
7295
|
+
});
|
|
7296
|
+
setTimeout(() => resolve({ available }), timeout);
|
|
7297
|
+
});
|
|
7298
|
+
};
|
|
7299
|
+
}
|
|
7285
7300
|
function findNearestPlace(place, candidates, distanceFn) {
|
|
7286
7301
|
var _a;
|
|
7287
7302
|
let shortestDistance = Infinity;
|
|
@@ -7298,6 +7313,7 @@ function findNearestPlace(place, candidates, distanceFn) {
|
|
|
7298
7313
|
const useMapRecomendPlace = (props) => {
|
|
7299
7314
|
const {
|
|
7300
7315
|
defaultPoint,
|
|
7316
|
+
getAvailable,
|
|
7301
7317
|
getRecomendPlace,
|
|
7302
7318
|
getLimit,
|
|
7303
7319
|
context: context2,
|
|
@@ -7323,9 +7339,9 @@ const useMapRecomendPlace = (props) => {
|
|
|
7323
7339
|
displayName: ""
|
|
7324
7340
|
});
|
|
7325
7341
|
const isQueryingRef = Vue.ref(false);
|
|
7326
|
-
const getRecomendPlaceNoFail =
|
|
7327
|
-
|
|
7328
|
-
|
|
7342
|
+
const getRecomendPlaceNoFail = mergeGetRecommendPlaceAndGetAvailable(
|
|
7343
|
+
getRecomendPlace,
|
|
7344
|
+
getAvailable,
|
|
7329
7345
|
GET_RECOMMEND_PLACE_TIMEOUT
|
|
7330
7346
|
);
|
|
7331
7347
|
const findAttachedPlace = async (place) => {
|
|
@@ -8424,10 +8440,12 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
8424
8440
|
geoDefaultPosition,
|
|
8425
8441
|
geoErrorOnceNotificationKey = `BusinessRecomendPlaceMap_${Date.now()}`,
|
|
8426
8442
|
geoErrorOnceNotificationInterval = 0,
|
|
8443
|
+
getAvailable,
|
|
8427
8444
|
getRecomendPlace,
|
|
8428
8445
|
getDefaultCenterPlace,
|
|
8429
8446
|
mapContext
|
|
8430
8447
|
} = props;
|
|
8448
|
+
const pipedGetAvailable = pipeOnlyLastEffect(getAvailable);
|
|
8431
8449
|
const pipedGetRecomendPlace = pipeOnlyLastEffect(getRecomendPlace);
|
|
8432
8450
|
const {
|
|
8433
8451
|
mapRef,
|
|
@@ -8576,6 +8594,7 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
8576
8594
|
emptyPlaceName: emptyTitle,
|
|
8577
8595
|
queryingPlaceName: queryingTitle,
|
|
8578
8596
|
context: centerSource,
|
|
8597
|
+
getAvailable: pipedGetAvailable,
|
|
8579
8598
|
getRecomendPlace: pipedGetRecomendPlace,
|
|
8580
8599
|
getLimit: (context2) => {
|
|
8581
8600
|
const source = context2 == null ? void 0 : context2.source;
|
|
@@ -8690,7 +8709,7 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
8690
8709
|
}
|
|
8691
8710
|
})]);
|
|
8692
8711
|
};
|
|
8693
|
-
}).props(["log", "geoLoadingTitle", "emptyTitle", "queryingTitle", "geoErrorOnceNotificationKey", "geoErrorOnceNotificationInterval", "unavailableTitle", "recomendDescription", "disableLocator", "fallback", "geoDefaultPosition", "getRecomendPlace", "getDefaultCenterPlace", "loading", "mapContext"]);
|
|
8712
|
+
}).props(["log", "geoLoadingTitle", "emptyTitle", "queryingTitle", "geoErrorOnceNotificationKey", "geoErrorOnceNotificationInterval", "unavailableTitle", "recomendDescription", "disableLocator", "fallback", "geoDefaultPosition", "getRecomendPlace", "getAvailable", "getDefaultCenterPlace", "loading", "mapContext"]);
|
|
8694
8713
|
const emptyPlace = {
|
|
8695
8714
|
lng: 0,
|
|
8696
8715
|
lat: 0,
|
|
@@ -8706,6 +8725,7 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
|
|
|
8706
8725
|
queryingTitle,
|
|
8707
8726
|
geoErrorOnceNotificationKey = `BusinessRecomendPlaceMap_${Date.now()}`,
|
|
8708
8727
|
geoErrorOnceNotificationInterval = 0,
|
|
8728
|
+
getAvailable,
|
|
8709
8729
|
getRecomendPlace,
|
|
8710
8730
|
mapContext,
|
|
8711
8731
|
disableLocator,
|
|
@@ -8713,6 +8733,7 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
|
|
|
8713
8733
|
...emptyPlace
|
|
8714
8734
|
}
|
|
8715
8735
|
} = props;
|
|
8736
|
+
const pipedGetAvailable = pipeOnlyLastEffect(getAvailable);
|
|
8716
8737
|
const pipedGetRecomendPlace = pipeOnlyLastEffect(getRecomendPlace);
|
|
8717
8738
|
const {
|
|
8718
8739
|
mapRef,
|
|
@@ -8795,6 +8816,10 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
|
|
|
8795
8816
|
geoLoading
|
|
8796
8817
|
} = useGeoLocation({
|
|
8797
8818
|
geoDefaultPosition: place2point(defaultPlace),
|
|
8819
|
+
onChange: (v) => {
|
|
8820
|
+
mapContext.geoPositionRef.value = v.position;
|
|
8821
|
+
emit("changeGeoLocation", v);
|
|
8822
|
+
},
|
|
8798
8823
|
onError: (error) => {
|
|
8799
8824
|
emit("geoError", error);
|
|
8800
8825
|
emitGeoErrorOnce(error);
|
|
@@ -8831,6 +8856,7 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
|
|
|
8831
8856
|
emptyPlaceName: emptyTitle,
|
|
8832
8857
|
queryingPlaceName: queryingTitle,
|
|
8833
8858
|
context: centerSource,
|
|
8859
|
+
getAvailable: pipedGetAvailable,
|
|
8834
8860
|
getRecomendPlace: pipedGetRecomendPlace,
|
|
8835
8861
|
getLimit: (context2) => {
|
|
8836
8862
|
const source = context2 == null ? void 0 : context2.source;
|
|
@@ -8942,7 +8968,7 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
|
|
|
8942
8968
|
}
|
|
8943
8969
|
})]);
|
|
8944
8970
|
};
|
|
8945
|
-
}).props(["loading", "fallback", "log", "defaultPlace", "unavailableTitle", "emptyTitle", "queryingTitle", "recomendDescription", "geoErrorOnceNotificationKey", "geoErrorOnceNotificationInterval", "disableLocator", "disableLocatorPhoto", "getRecomendPlace", "mapContext"]);
|
|
8971
|
+
}).props(["loading", "fallback", "log", "defaultPlace", "unavailableTitle", "emptyTitle", "queryingTitle", "recomendDescription", "geoErrorOnceNotificationKey", "geoErrorOnceNotificationInterval", "disableLocator", "disableLocatorPhoto", "getAvailable", "getRecomendPlace", "mapContext"]);
|
|
8946
8972
|
const assertPropNoEmptyArray = (list, funcName, propName) => {
|
|
8947
8973
|
if (list.length > 0)
|
|
8948
8974
|
return;
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ if (typeof GeolocationPositionError === "undefined") {
|
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
const name = "@heycar/heycars-map";
|
|
20
|
-
const version = "0.9.23-
|
|
20
|
+
const version = "0.9.23-alpha5";
|
|
21
21
|
const type = "module";
|
|
22
22
|
const bin = {
|
|
23
23
|
checkVersion: "./bin/checkVersion.js"
|
|
@@ -1512,6 +1512,7 @@ const language2vectorMapForeign = (lang) => {
|
|
|
1512
1512
|
switch (lang) {
|
|
1513
1513
|
case "en":
|
|
1514
1514
|
return "style_en";
|
|
1515
|
+
case "zh-TW":
|
|
1515
1516
|
case "zh":
|
|
1516
1517
|
return "style_zh_cn";
|
|
1517
1518
|
}
|
|
@@ -1782,11 +1783,6 @@ const createRunOnce = (fn) => {
|
|
|
1782
1783
|
return result;
|
|
1783
1784
|
};
|
|
1784
1785
|
};
|
|
1785
|
-
const createAsyncNoFailNonNullable = (fn, defaultValue) => {
|
|
1786
|
-
return function noFailNoNullable(...args) {
|
|
1787
|
-
return fn(...args).then((result) => result != null ? result : defaultValue).catch(() => defaultValue);
|
|
1788
|
-
};
|
|
1789
|
-
};
|
|
1790
1786
|
const pipeTimeout = (fn, defaultValue, timeout) => {
|
|
1791
1787
|
return function pipedTimeoutedFunction(...args) {
|
|
1792
1788
|
return new Promise((resolve, reject) => {
|
|
@@ -4197,7 +4193,7 @@ const AStartEndPoint = defineSetup(function AStartEndPoint2(props, {
|
|
|
4197
4193
|
type: type2,
|
|
4198
4194
|
language
|
|
4199
4195
|
} = props;
|
|
4200
|
-
const icon = type2 === "start" ? language === "zh" ? imgStartPoint : imgStartPointEn : language === "zh" ? imgEndPoint : imgEndPointEn;
|
|
4196
|
+
const icon = type2 === "start" ? language === "zh" || language === "zh-TW" ? imgStartPoint : imgStartPointEn : language === "zh" || language === "zh-TW" ? imgEndPoint : imgEndPointEn;
|
|
4201
4197
|
const descriptionRow = !description ? "" : decodeAsterisk(description).map((item) => item.type === "normal" ? item.value : `<span class="${pointInfoBoxEmphasize$1}">${item.value}</span>`).join("");
|
|
4202
4198
|
if (!description && !title)
|
|
4203
4199
|
return `<img class="AStartEndPoint ${pointIcon({
|
|
@@ -4265,7 +4261,7 @@ const GStartEndPoint = defineSetup(function GStartEndPoint2(props, {
|
|
|
4265
4261
|
type: type2,
|
|
4266
4262
|
language = "zh"
|
|
4267
4263
|
} = props;
|
|
4268
|
-
const icon = type2 === "start" ? language === "zh" ? imgStartPoint : imgStartPointEn : language === "zh" ? imgEndPoint : imgEndPointEn;
|
|
4264
|
+
const icon = type2 === "start" ? language === "zh" || language === "zh-TW" ? imgStartPoint : imgStartPointEn : language === "zh" || language === "zh-TW" ? imgEndPoint : imgEndPointEn;
|
|
4269
4265
|
const descriptionRow = !description ? "" : decodeAsterisk(description).map((item) => item.type === "normal" ? item.value : `<span class="${pointInfoBoxEmphasize$1}">${item.value}</span>`).join("");
|
|
4270
4266
|
if (!description && !title)
|
|
4271
4267
|
return createDom("img", {
|
|
@@ -7280,6 +7276,25 @@ const useMapPlace = (props) => {
|
|
|
7280
7276
|
const { supplier } = useMapSupplier();
|
|
7281
7277
|
return supplier === "gmap" ? useGmapPlace(props) : useAmapPlace(props);
|
|
7282
7278
|
};
|
|
7279
|
+
function mergeGetRecommendPlaceAndGetAvailable(getRecomendPlace, getAvailable, timeout) {
|
|
7280
|
+
return function mergedGetRecommendPlace(place, context2) {
|
|
7281
|
+
const available = true;
|
|
7282
|
+
return new Promise((resolve) => {
|
|
7283
|
+
getAvailable(place).then((value) => {
|
|
7284
|
+
if (!value)
|
|
7285
|
+
resolve({ available: false });
|
|
7286
|
+
});
|
|
7287
|
+
getRecomendPlace(place, context2).then((result) => {
|
|
7288
|
+
debugger;
|
|
7289
|
+
resolve(result != null ? result : { available });
|
|
7290
|
+
}).catch(() => {
|
|
7291
|
+
debugger;
|
|
7292
|
+
resolve({ available });
|
|
7293
|
+
});
|
|
7294
|
+
setTimeout(() => resolve({ available }), timeout);
|
|
7295
|
+
});
|
|
7296
|
+
};
|
|
7297
|
+
}
|
|
7283
7298
|
function findNearestPlace(place, candidates, distanceFn) {
|
|
7284
7299
|
var _a;
|
|
7285
7300
|
let shortestDistance = Infinity;
|
|
@@ -7296,6 +7311,7 @@ function findNearestPlace(place, candidates, distanceFn) {
|
|
|
7296
7311
|
const useMapRecomendPlace = (props) => {
|
|
7297
7312
|
const {
|
|
7298
7313
|
defaultPoint,
|
|
7314
|
+
getAvailable,
|
|
7299
7315
|
getRecomendPlace,
|
|
7300
7316
|
getLimit,
|
|
7301
7317
|
context: context2,
|
|
@@ -7321,9 +7337,9 @@ const useMapRecomendPlace = (props) => {
|
|
|
7321
7337
|
displayName: ""
|
|
7322
7338
|
});
|
|
7323
7339
|
const isQueryingRef = ref(false);
|
|
7324
|
-
const getRecomendPlaceNoFail =
|
|
7325
|
-
|
|
7326
|
-
|
|
7340
|
+
const getRecomendPlaceNoFail = mergeGetRecommendPlaceAndGetAvailable(
|
|
7341
|
+
getRecomendPlace,
|
|
7342
|
+
getAvailable,
|
|
7327
7343
|
GET_RECOMMEND_PLACE_TIMEOUT
|
|
7328
7344
|
);
|
|
7329
7345
|
const findAttachedPlace = async (place) => {
|
|
@@ -8422,10 +8438,12 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
8422
8438
|
geoDefaultPosition,
|
|
8423
8439
|
geoErrorOnceNotificationKey = `BusinessRecomendPlaceMap_${Date.now()}`,
|
|
8424
8440
|
geoErrorOnceNotificationInterval = 0,
|
|
8441
|
+
getAvailable,
|
|
8425
8442
|
getRecomendPlace,
|
|
8426
8443
|
getDefaultCenterPlace,
|
|
8427
8444
|
mapContext
|
|
8428
8445
|
} = props;
|
|
8446
|
+
const pipedGetAvailable = pipeOnlyLastEffect(getAvailable);
|
|
8429
8447
|
const pipedGetRecomendPlace = pipeOnlyLastEffect(getRecomendPlace);
|
|
8430
8448
|
const {
|
|
8431
8449
|
mapRef,
|
|
@@ -8574,6 +8592,7 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
8574
8592
|
emptyPlaceName: emptyTitle,
|
|
8575
8593
|
queryingPlaceName: queryingTitle,
|
|
8576
8594
|
context: centerSource,
|
|
8595
|
+
getAvailable: pipedGetAvailable,
|
|
8577
8596
|
getRecomendPlace: pipedGetRecomendPlace,
|
|
8578
8597
|
getLimit: (context2) => {
|
|
8579
8598
|
const source = context2 == null ? void 0 : context2.source;
|
|
@@ -8688,7 +8707,7 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
8688
8707
|
}
|
|
8689
8708
|
})]);
|
|
8690
8709
|
};
|
|
8691
|
-
}).props(["log", "geoLoadingTitle", "emptyTitle", "queryingTitle", "geoErrorOnceNotificationKey", "geoErrorOnceNotificationInterval", "unavailableTitle", "recomendDescription", "disableLocator", "fallback", "geoDefaultPosition", "getRecomendPlace", "getDefaultCenterPlace", "loading", "mapContext"]);
|
|
8710
|
+
}).props(["log", "geoLoadingTitle", "emptyTitle", "queryingTitle", "geoErrorOnceNotificationKey", "geoErrorOnceNotificationInterval", "unavailableTitle", "recomendDescription", "disableLocator", "fallback", "geoDefaultPosition", "getRecomendPlace", "getAvailable", "getDefaultCenterPlace", "loading", "mapContext"]);
|
|
8692
8711
|
const emptyPlace = {
|
|
8693
8712
|
lng: 0,
|
|
8694
8713
|
lat: 0,
|
|
@@ -8704,6 +8723,7 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
|
|
|
8704
8723
|
queryingTitle,
|
|
8705
8724
|
geoErrorOnceNotificationKey = `BusinessRecomendPlaceMap_${Date.now()}`,
|
|
8706
8725
|
geoErrorOnceNotificationInterval = 0,
|
|
8726
|
+
getAvailable,
|
|
8707
8727
|
getRecomendPlace,
|
|
8708
8728
|
mapContext,
|
|
8709
8729
|
disableLocator,
|
|
@@ -8711,6 +8731,7 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
|
|
|
8711
8731
|
...emptyPlace
|
|
8712
8732
|
}
|
|
8713
8733
|
} = props;
|
|
8734
|
+
const pipedGetAvailable = pipeOnlyLastEffect(getAvailable);
|
|
8714
8735
|
const pipedGetRecomendPlace = pipeOnlyLastEffect(getRecomendPlace);
|
|
8715
8736
|
const {
|
|
8716
8737
|
mapRef,
|
|
@@ -8793,6 +8814,10 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
|
|
|
8793
8814
|
geoLoading
|
|
8794
8815
|
} = useGeoLocation({
|
|
8795
8816
|
geoDefaultPosition: place2point(defaultPlace),
|
|
8817
|
+
onChange: (v) => {
|
|
8818
|
+
mapContext.geoPositionRef.value = v.position;
|
|
8819
|
+
emit("changeGeoLocation", v);
|
|
8820
|
+
},
|
|
8796
8821
|
onError: (error) => {
|
|
8797
8822
|
emit("geoError", error);
|
|
8798
8823
|
emitGeoErrorOnce(error);
|
|
@@ -8829,6 +8854,7 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
|
|
|
8829
8854
|
emptyPlaceName: emptyTitle,
|
|
8830
8855
|
queryingPlaceName: queryingTitle,
|
|
8831
8856
|
context: centerSource,
|
|
8857
|
+
getAvailable: pipedGetAvailable,
|
|
8832
8858
|
getRecomendPlace: pipedGetRecomendPlace,
|
|
8833
8859
|
getLimit: (context2) => {
|
|
8834
8860
|
const source = context2 == null ? void 0 : context2.source;
|
|
@@ -8940,7 +8966,7 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
|
|
|
8940
8966
|
}
|
|
8941
8967
|
})]);
|
|
8942
8968
|
};
|
|
8943
|
-
}).props(["loading", "fallback", "log", "defaultPlace", "unavailableTitle", "emptyTitle", "queryingTitle", "recomendDescription", "geoErrorOnceNotificationKey", "geoErrorOnceNotificationInterval", "disableLocator", "disableLocatorPhoto", "getRecomendPlace", "mapContext"]);
|
|
8969
|
+
}).props(["loading", "fallback", "log", "defaultPlace", "unavailableTitle", "emptyTitle", "queryingTitle", "recomendDescription", "geoErrorOnceNotificationKey", "geoErrorOnceNotificationInterval", "disableLocator", "disableLocatorPhoto", "getAvailable", "getRecomendPlace", "mapContext"]);
|
|
8944
8970
|
const assertPropNoEmptyArray = (list, funcName, propName) => {
|
|
8945
8971
|
if (list.length > 0)
|
|
8946
8972
|
return;
|
|
@@ -17,7 +17,7 @@ export declare const ZONE_ZOOM = 13.75;
|
|
|
17
17
|
export interface CenterPlaceSource {
|
|
18
18
|
source: "default" | "geo" | "drag" | "recomend" | "api";
|
|
19
19
|
}
|
|
20
|
-
export interface BusinessRecomendPlaceMapProps extends Omit<HeycarMapProps, "center" | "zoom" | "mapRef">, Pick<UseMapRecomendPlaceProps<CenterPlaceSource>, "getRecomendPlace"> {
|
|
20
|
+
export interface BusinessRecomendPlaceMapProps extends Omit<HeycarMapProps, "center" | "zoom" | "mapRef">, Pick<UseMapRecomendPlaceProps<CenterPlaceSource>, "getRecomendPlace" | "getAvailable"> {
|
|
21
21
|
log?: boolean;
|
|
22
22
|
geoLoadingTitle: string;
|
|
23
23
|
unavailableTitle: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Place } from "../../types/interface";
|
|
2
2
|
import { type BusinessRecomendPlaceMapProps } from "../BusinessRecomendPlaceMap";
|
|
3
|
-
export interface BusinessReselectPlaceMapProps extends Pick<BusinessRecomendPlaceMapProps, "geoErrorOnceNotificationKey" | "geoErrorOnceNotificationInterval" | "loading" | "fallback" | "log" | "getRecomendPlace" | "unavailableTitle" | "emptyTitle" | "queryingTitle" | "recomendDescription" | "disableLocator" | "disableLocatorPhoto" | "mapContext" | "onChangePlace" | "onChangeRecomandPlace" | "onGeoError" | "onGeoErrorOnce" | "onClickLocatorText" | "onClickLocatorPhoto"> {
|
|
3
|
+
export interface BusinessReselectPlaceMapProps extends Pick<BusinessRecomendPlaceMapProps, "geoErrorOnceNotificationKey" | "geoErrorOnceNotificationInterval" | "loading" | "fallback" | "log" | "getAvailable" | "getRecomendPlace" | "unavailableTitle" | "emptyTitle" | "queryingTitle" | "recomendDescription" | "disableLocator" | "disableLocatorPhoto" | "mapContext" | "onChangeGeoLocation" | "onChangePlace" | "onChangeRecomandPlace" | "onGeoError" | "onGeoErrorOnce" | "onClickLocatorText" | "onClickLocatorPhoto"> {
|
|
4
4
|
defaultPlace?: Place;
|
|
5
5
|
}
|
|
6
|
-
export declare const BusinessReselectPlaceMap: import("vue-demi").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<BusinessReselectPlaceMapProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<BusinessReselectPlaceMapProps, Required<BusinessReselectPlaceMapProps>>, "changePlace" | "changeRecomandPlace" | "geoError" | "geoErrorOnce" | "clickLocatorText" | "clickLocatorPhoto", BusinessReselectPlaceMapProps, {}>;
|
|
6
|
+
export declare const BusinessReselectPlaceMap: import("vue-demi").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<BusinessReselectPlaceMapProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<BusinessReselectPlaceMapProps, Required<BusinessReselectPlaceMapProps>>, "changePlace" | "changeGeoLocation" | "changeRecomandPlace" | "geoError" | "geoErrorOnce" | "clickLocatorText" | "clickLocatorPhoto", BusinessReselectPlaceMapProps, {}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { GmapOverlay, MapRegisterOverlayProps } from "../../hooks/useOverlay";
|
|
2
|
-
import type { Point } from "../../types/interface";
|
|
2
|
+
import type { Language, Point } from "../../types/interface";
|
|
3
3
|
export interface StartEndPointProps<T> extends MapRegisterOverlayProps<T> {
|
|
4
|
-
language:
|
|
4
|
+
language: Language;
|
|
5
5
|
type: "start" | "end";
|
|
6
6
|
position: [number, number];
|
|
7
7
|
title?: string;
|
|
@@ -2,6 +2,7 @@ import { load as loadAmap } from "@amap/amap-jsapi-loader";
|
|
|
2
2
|
import { LoaderOptions } from "@googlemaps/js-api-loader";
|
|
3
3
|
import { Ref } from "vue-demi";
|
|
4
4
|
import type { VueNode } from "../types/helper";
|
|
5
|
+
import type { Language } from "../types/interface";
|
|
5
6
|
export declare const DEFAULT_AMAP_PLUGINS: AmapLoaderProps["plugins"];
|
|
6
7
|
export declare const DEFAULT_GMAP_LIBRARIES: LoaderOptions["libraries"];
|
|
7
8
|
export declare enum Status {
|
|
@@ -60,7 +61,7 @@ export interface UseMapLoaderProps {
|
|
|
60
61
|
amapSecret?: string;
|
|
61
62
|
amapServiceHost?: string;
|
|
62
63
|
supplier: MapSupplier;
|
|
63
|
-
language:
|
|
64
|
+
language: Language;
|
|
64
65
|
onChange?: (status: Status) => any;
|
|
65
66
|
}
|
|
66
67
|
export declare const useMapLoader: (props: UseMapLoaderProps) => UseMapLoaderOutput;
|
|
@@ -12,6 +12,7 @@ export interface UseMapRecomendPlaceProps<C = Record<string, any>> {
|
|
|
12
12
|
emptyPlaceName: string;
|
|
13
13
|
queryingPlaceName: string;
|
|
14
14
|
getLimit: (context?: C) => number;
|
|
15
|
+
getAvailable: (place: Place) => Promise<boolean>;
|
|
15
16
|
getRecomendPlace: (place: Place, context?: C) => Promise<RecommendZonePlaces | undefined>;
|
|
16
17
|
onChangePlace?: UseMapPlaceProps["onChange"];
|
|
17
18
|
onQueryingPlace?: UseMapPlaceProps["onChange"];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="google.maps" />
|
|
2
2
|
import type { ShallowRef } from "vue-demi";
|
|
3
3
|
import type { SafeAmap } from "../components/Amap/SafeAmap";
|
|
4
|
+
export type Language = "en" | "zh" | "zh-TW";
|
|
4
5
|
export type Point = [number, number];
|
|
5
6
|
export type AmapMap = SafeAmap;
|
|
6
7
|
export type MapShallowRef<M = AmapMap | google.maps.Map> = ShallowRef<M | undefined>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="google.maps" />
|
|
2
|
-
import type { Place, Point, RecommendZonePlaces, TrackPoint, Zone } from "../types/interface";
|
|
2
|
+
import type { Language, Place, Point, RecommendZonePlaces, TrackPoint, Zone } from "../types/interface";
|
|
3
3
|
import type { AlipayMyGetLocationSuccessResponse } from "../types/my";
|
|
4
4
|
import type { WxGetLocationSuccessResponse } from "../types/wx";
|
|
5
5
|
import { BRWOSER_PLATFORM } from "./platform";
|
|
@@ -16,7 +16,7 @@ export declare const decodeAsterisk: (encodedValue: string) => AsteriskItem[];
|
|
|
16
16
|
export declare const property2emitEventName: (propertyName: string) => string;
|
|
17
17
|
export declare const property2mapEventName: (propertyName: string) => string;
|
|
18
18
|
export type VectorMapForeign = "style_en" | "style_local" | "style_zh_cn";
|
|
19
|
-
export declare const language2vectorMapForeign: (lang:
|
|
19
|
+
export declare const language2vectorMapForeign: (lang: Language) => VectorMapForeign;
|
|
20
20
|
export declare const place2point: (place: Place) => Point;
|
|
21
21
|
export declare const combineHandler: <P extends any[], R>(fn1: ((...args: P) => any) | undefined, fn2: (...args: P) => R) => (...args: P) => R;
|
|
22
22
|
export declare const pipeAsync: <P extends any[]>(fn?: ((...args: P) => any) | undefined) => (...args: P) => void;
|
package/package.json
CHANGED