@heycar/heycars-map 2.7.2 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/v2/api/gaodeDirectionDriving.js +21 -6
- package/dist/v2/business-components/BusinessQuotingMap/BusinessQuotingMap.js +6 -4
- package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.js +22 -13
- package/dist/v2/business-components/DrivingLine/DrivingLine.d.ts +5 -1
- package/dist/v2/business-components/DrivingLine/DrivingLine.js +44 -10
- package/dist/v2/business-components/DrivingRoute/DrivingRoute.d.ts +2 -1
- package/dist/v2/business-components/DrivingRoute/DrivingRoute.js +4 -2
- package/dist/v2/business-components/TrafficDrivingLine/TrafficDrivingLine.d.ts +6 -0
- package/dist/v2/business-components/TrafficDrivingLine/TrafficDrivingLine.js +93 -0
- package/dist/v2/business-components/TrafficDrivingLine/index.d.ts +1 -0
- package/dist/v2/business-components/TrafficDrivingLine/index.js +4 -0
- package/dist/v2/components/AmapMarker/AmapMarker.js +0 -2
- package/dist/v2/hooks/useDeviationCorrectionDrivingRoute.d.ts +2 -0
- package/dist/v2/hooks/useDrivingRoute.d.ts +3 -0
- package/dist/v2/hooks/useDrivingRoute.js +2 -1
- package/dist/v2/hooks/useDrivingTrackCorrection.d.ts +1 -0
- package/dist/v2/types/amap/driving.d.ts +2 -1
- package/dist/v2/types/interface.d.ts +3 -0
- package/dist/v2/utils/compatibleDrivingRoute.js +21 -2
- package/dist/v2/utils/log.js +1 -1
- package/dist/v2/utils/transform.d.ts +3 -1
- package/dist/v2/utils/transform.js +19 -1
- package/dist/v3/api/gaodeDirectionDriving.js +21 -6
- package/dist/v3/business-components/BusinessQuotingMap/BusinessQuotingMap.js +6 -4
- package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.js +22 -13
- package/dist/v3/business-components/DrivingLine/DrivingLine.d.ts +5 -1
- package/dist/v3/business-components/DrivingLine/DrivingLine.js +44 -10
- package/dist/v3/business-components/DrivingRoute/DrivingRoute.d.ts +2 -1
- package/dist/v3/business-components/DrivingRoute/DrivingRoute.js +4 -2
- package/dist/v3/business-components/TrafficDrivingLine/TrafficDrivingLine.d.ts +8 -0
- package/dist/v3/business-components/TrafficDrivingLine/TrafficDrivingLine.js +91 -0
- package/dist/v3/business-components/TrafficDrivingLine/index.d.ts +1 -0
- package/dist/v3/business-components/TrafficDrivingLine/index.js +4 -0
- package/dist/v3/components/AmapMarker/AmapMarker.js +0 -2
- package/dist/v3/hooks/useDeviationCorrectionDrivingRoute.d.ts +2 -0
- package/dist/v3/hooks/useDrivingRoute.d.ts +3 -0
- package/dist/v3/hooks/useDrivingRoute.js +2 -1
- package/dist/v3/hooks/useDrivingTrackCorrection.d.ts +1 -0
- package/dist/v3/types/amap/driving.d.ts +2 -1
- package/dist/v3/types/interface.d.ts +3 -0
- package/dist/v3/utils/compatibleDrivingRoute.js +21 -2
- package/dist/v3/utils/log.js +1 -1
- package/dist/v3/utils/transform.d.ts +3 -1
- package/dist/v3/utils/transform.js +19 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="google.maps" />
|
|
2
|
-
import type { LngLatLiterial, Place, Point, TrackPoint, Zone } from "../types/interface";
|
|
2
|
+
import type { LngLatLiterial, Place, Point, TrackPoint, TrafficStatus, 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";
|
|
@@ -9,6 +9,7 @@ export declare const lnglat2point: ({ lng, lat }: {
|
|
|
9
9
|
lng: number;
|
|
10
10
|
lat: number;
|
|
11
11
|
}) => Point;
|
|
12
|
+
export declare const stringifyPoint: (p: Point) => `${number},${number}`;
|
|
12
13
|
export declare const googlePointsStringify: (points: Point[]) => string;
|
|
13
14
|
export declare const gaodePointsStringify: (points: Point[]) => string;
|
|
14
15
|
export interface AsteriskItem {
|
|
@@ -45,4 +46,5 @@ export declare const maybeFunctionToFunction: <T>(value: T) => MaybeFunctionToFu
|
|
|
45
46
|
export declare const signal2promise: (signal?: AbortSignal) => Promise<any>;
|
|
46
47
|
export declare const googleEncodedPolyline2googleLatLng: (value: string) => google.maps.LatLng[];
|
|
47
48
|
export declare const gaodePolyline2amapLngLat: (value: string) => AMap.LngLat[];
|
|
49
|
+
export declare const amapTraffic2trafficStatus: (value?: AMap.TMC["status"]) => TrafficStatus;
|
|
48
50
|
export {};
|
|
@@ -42,8 +42,9 @@ const vec2lnglat = ([lng, lat]) => ({
|
|
|
42
42
|
lat: Number(lat)
|
|
43
43
|
});
|
|
44
44
|
const lnglat2point = ({ lng, lat }) => [lng, lat];
|
|
45
|
+
const stringifyPoint = (p) => `${p[0]},${p[1]}`;
|
|
45
46
|
const googlePointsStringify = (points) => points.map(([lng, lat]) => `${lat},${lng}`).join("|");
|
|
46
|
-
const gaodePointsStringify = (points) => points.map(
|
|
47
|
+
const gaodePointsStringify = (points) => points.map(stringifyPoint).join(";");
|
|
47
48
|
const decodeAsterisk = (encodedValue) => {
|
|
48
49
|
const result = [];
|
|
49
50
|
const tokens = encodedValue.split("*");
|
|
@@ -287,10 +288,26 @@ const gaodePolyline2amapLngLat = (value) => {
|
|
|
287
288
|
return { lng, lat };
|
|
288
289
|
});
|
|
289
290
|
};
|
|
291
|
+
const amapTraffic2trafficStatus = (value) => {
|
|
292
|
+
switch (value) {
|
|
293
|
+
case void 0:
|
|
294
|
+
case "未知":
|
|
295
|
+
return "UNKNOWN";
|
|
296
|
+
case "畅通":
|
|
297
|
+
return "NORMAL";
|
|
298
|
+
case "缓行":
|
|
299
|
+
return "SLOW";
|
|
300
|
+
case "拥堵":
|
|
301
|
+
return "TRAFFIC_JAM";
|
|
302
|
+
case "严重拥堵":
|
|
303
|
+
return "HEAVY_TRAFFIC_JAM";
|
|
304
|
+
}
|
|
305
|
+
};
|
|
290
306
|
export {
|
|
291
307
|
alipayMyGetLocationError2GeolocationPositionErrorCode,
|
|
292
308
|
alipayMyGetLocationSuccessResponse2GeolocationPosition,
|
|
293
309
|
amapPlaceName2DisplayName,
|
|
310
|
+
amapTraffic2trafficStatus,
|
|
294
311
|
businessCandidatesToAdsorptionPlace,
|
|
295
312
|
combineHandler,
|
|
296
313
|
decodeAsterisk,
|
|
@@ -316,6 +333,7 @@ export {
|
|
|
316
333
|
property2emitEventName,
|
|
317
334
|
property2mapEventName,
|
|
318
335
|
signal2promise,
|
|
336
|
+
stringifyPoint,
|
|
319
337
|
trackPoints2amapGraspRoadPoints,
|
|
320
338
|
vec2lnglat,
|
|
321
339
|
wxGetLocationSuccessResponse2GeolocationPosition
|