@heycar/heycars-map 2.10.0 → 2.12.0-color1

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.
Files changed (140) hide show
  1. package/README.md +23 -1
  2. package/dist/v2/App.js +4 -2
  3. package/dist/v2/Demo/DemoBusinessRecomendPlace.js +1 -1
  4. package/dist/v2/api/cdn.d.ts +2 -2
  5. package/dist/v2/api/cdn.js +2 -2
  6. package/dist/v2/api/googleRoutes.d.ts +27 -0
  7. package/dist/v2/api/googleRoutes.js +135 -0
  8. package/dist/v2/business-components/AbsoluteAddressBox/AbsoluteAddressBox.js +10 -9
  9. package/dist/v2/business-components/AddressLocator/AddressLocator.js +4 -3
  10. package/dist/v2/business-components/AuxiliaryLine/AuxiliaryLine.js +1 -1
  11. package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +1 -1
  12. package/dist/v2/business-components/BusinessRecomendPlaceMap/index.js +1 -1
  13. package/dist/v2/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +2 -2
  14. package/dist/v2/business-components/DrivingLine/DrivingLine.d.ts +3 -1
  15. package/dist/v2/business-components/DrivingLine/DrivingLine.js +35 -41
  16. package/dist/v2/business-components/GreenZone/GreenZone.d.ts +4 -2
  17. package/dist/v2/business-components/GreenZone/GreenZone.js +22 -11
  18. package/dist/v2/business-components/PassengerCircle/PassengerCircle.js +7 -6
  19. package/dist/v2/business-components/PlaceCircle/PlaceCircle.js +7 -6
  20. package/dist/v2/business-components/StartEndPoint/StartEndPoint.js +15 -14
  21. package/dist/v2/business-components/TaxiCar/TaxiCar.js +1 -1
  22. package/dist/v2/business-components/WalkingLine/WalkingLine.d.ts +1 -0
  23. package/dist/v2/business-components/WalkingLine/WalkingLine.js +14 -5
  24. package/dist/v2/business-components/WaveCircle/WaveCircle.js +6 -5
  25. package/dist/v2/chunks/{BusinessRecomendPlaceMap.7b67c30c.js → BusinessRecomendPlaceMap.e9166e7d.js} +1 -1
  26. package/dist/v2/chunks/{Loading.492acbc2.js → Loading.5234cceb.js} +3 -2
  27. package/dist/v2/chunks/{StartEndPoint.css.9e64a1ee.js → StartEndPoint.css.7baa5e05.js} +1 -1
  28. package/dist/v2/chunks/address-locator.c8105f89.js +4 -0
  29. package/dist/v2/chunks/arrow-right.c4bcf4de.js +4 -0
  30. package/dist/v2/chunks/index.767c33d5.js +254 -0
  31. package/dist/v2/components/Loading/Loading.js +2 -1
  32. package/dist/v2/components/Loading/index.js +1 -1
  33. package/dist/v2/components/MapProvider/MapProvider.d.ts +1 -1
  34. package/dist/v2/components/MapProvider/MapProvider.js +2 -2
  35. package/dist/v2/components/SvgInline/SvgInline.css.d.ts +1 -0
  36. package/dist/v2/components/SvgInline/SvgInline.d.ts +7 -0
  37. package/dist/v2/components/SvgInline/SvgInline.js +326 -0
  38. package/dist/v2/components/SvgInline/SvgInline.web-component.d.ts +13 -0
  39. package/dist/v2/components/SvgInline/SvgInline.web-component.js +119 -0
  40. package/dist/v2/components/SvgInline/index.d.ts +1 -0
  41. package/dist/v2/components/SvgInline/index.js +5 -0
  42. package/dist/v2/css/{AbsoluteAddressBox-7502ed45.css → AbsoluteAddressBox-125d3642.css} +4 -4
  43. package/dist/v2/css/{PlaceCircle-3c051f4e.css → PlaceCircle-fb31fc69.css} +2 -2
  44. package/dist/v2/css/{StartEndPoint-73c01544.css → StartEndPoint-16ca98dc.css} +2 -2
  45. package/dist/v2/css/SvgInline-bee6339d.css +10 -0
  46. package/dist/v2/hooks/useDrivingRoute.js +4 -4
  47. package/dist/v2/hooks/useMapSupplier.d.ts +3 -1
  48. package/dist/v2/hooks/useWalkingRoute.js +4 -4
  49. package/dist/v2/hooks-business/useBusinessAlarm.js +1 -37
  50. package/dist/v2/hooks-business/useBusinessRecomendPlaceMap.js +1 -1
  51. package/dist/v2/index.d.ts +0 -1
  52. package/dist/v2/index.js +1 -3
  53. package/dist/v2/types/interface.d.ts +19 -0
  54. package/dist/v2/utils/compatibleDrivingRoute.d.ts +1 -0
  55. package/dist/v2/utils/compatibleDrivingRoute.js +47 -1
  56. package/dist/v2/utils/compatibleWalkingRoute.d.ts +1 -0
  57. package/dist/v2/utils/compatibleWalkingRoute.js +29 -1
  58. package/dist/v2/utils/dom.js +3 -1
  59. package/dist/v2/utils/log.js +1 -1
  60. package/dist/v2/utils/transform.d.ts +1 -0
  61. package/dist/v2/utils/transform.js +9 -0
  62. package/dist/v3/App.js +4 -2
  63. package/dist/v3/Demo/DemoBusinessRecomendPlace.js +1 -1
  64. package/dist/v3/api/cdn.d.ts +2 -2
  65. package/dist/v3/api/cdn.js +2 -2
  66. package/dist/v3/api/googleRoutes.d.ts +27 -0
  67. package/dist/v3/api/googleRoutes.js +135 -0
  68. package/dist/v3/business-components/AbsoluteAddressBox/AbsoluteAddressBox.js +10 -9
  69. package/dist/v3/business-components/AddressLocator/AddressLocator.js +4 -3
  70. package/dist/v3/business-components/AuxiliaryLine/AuxiliaryLine.js +1 -1
  71. package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +1 -1
  72. package/dist/v3/business-components/BusinessRecomendPlaceMap/index.js +1 -1
  73. package/dist/v3/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +2 -2
  74. package/dist/v3/business-components/DrivingLine/DrivingLine.d.ts +3 -1
  75. package/dist/v3/business-components/DrivingLine/DrivingLine.js +35 -41
  76. package/dist/v3/business-components/GreenZone/GreenZone.d.ts +4 -2
  77. package/dist/v3/business-components/GreenZone/GreenZone.js +22 -11
  78. package/dist/v3/business-components/PassengerCircle/PassengerCircle.js +7 -6
  79. package/dist/v3/business-components/PlaceCircle/PlaceCircle.js +7 -6
  80. package/dist/v3/business-components/StartEndPoint/StartEndPoint.js +15 -14
  81. package/dist/v3/business-components/TaxiCar/TaxiCar.js +1 -1
  82. package/dist/v3/business-components/WalkingLine/WalkingLine.d.ts +1 -0
  83. package/dist/v3/business-components/WalkingLine/WalkingLine.js +14 -5
  84. package/dist/v3/business-components/WaveCircle/WaveCircle.js +6 -5
  85. package/dist/v3/chunks/{BusinessRecomendPlaceMap.8ce05cf5.js → BusinessRecomendPlaceMap.c71d0b97.js} +1 -1
  86. package/dist/v3/chunks/{Loading.21d8e759.js → Loading.edabb89a.js} +3 -2
  87. package/dist/v3/chunks/{StartEndPoint.css.9e64a1ee.js → StartEndPoint.css.7baa5e05.js} +1 -1
  88. package/dist/v3/chunks/address-locator.c8105f89.js +4 -0
  89. package/dist/v3/chunks/arrow-right.c4bcf4de.js +4 -0
  90. package/dist/v3/chunks/index.767c33d5.js +254 -0
  91. package/dist/v3/components/Loading/Loading.js +2 -1
  92. package/dist/v3/components/Loading/index.js +1 -1
  93. package/dist/v3/components/MapProvider/MapProvider.d.ts +1 -1
  94. package/dist/v3/components/MapProvider/MapProvider.js +2 -2
  95. package/dist/v3/components/SvgInline/SvgInline.css.d.ts +1 -0
  96. package/dist/v3/components/SvgInline/SvgInline.d.ts +11 -0
  97. package/dist/v3/components/SvgInline/SvgInline.js +320 -0
  98. package/dist/v3/components/SvgInline/SvgInline.web-component.d.ts +13 -0
  99. package/dist/v3/components/SvgInline/SvgInline.web-component.js +119 -0
  100. package/dist/v3/components/SvgInline/index.d.ts +1 -0
  101. package/dist/v3/components/SvgInline/index.js +5 -0
  102. package/dist/v3/css/{AbsoluteAddressBox-7502ed45.css → AbsoluteAddressBox-125d3642.css} +4 -4
  103. package/dist/v3/css/{PlaceCircle-3c051f4e.css → PlaceCircle-fb31fc69.css} +2 -2
  104. package/dist/v3/css/{StartEndPoint-73c01544.css → StartEndPoint-16ca98dc.css} +2 -2
  105. package/dist/v3/css/SvgInline-bee6339d.css +10 -0
  106. package/dist/v3/hooks/useDrivingRoute.js +4 -4
  107. package/dist/v3/hooks/useMapSupplier.d.ts +3 -1
  108. package/dist/v3/hooks/useWalkingRoute.js +4 -4
  109. package/dist/v3/hooks-business/useBusinessAlarm.js +1 -37
  110. package/dist/v3/hooks-business/useBusinessRecomendPlaceMap.js +1 -1
  111. package/dist/v3/index.d.ts +0 -1
  112. package/dist/v3/index.js +1 -3
  113. package/dist/v3/types/interface.d.ts +19 -0
  114. package/dist/v3/utils/compatibleDrivingRoute.d.ts +1 -0
  115. package/dist/v3/utils/compatibleDrivingRoute.js +47 -1
  116. package/dist/v3/utils/compatibleWalkingRoute.d.ts +1 -0
  117. package/dist/v3/utils/compatibleWalkingRoute.js +29 -1
  118. package/dist/v3/utils/dom.js +3 -1
  119. package/dist/v3/utils/log.js +1 -1
  120. package/dist/v3/utils/transform.d.ts +1 -0
  121. package/dist/v3/utils/transform.js +9 -0
  122. package/package.json +2 -1
  123. package/dist/v2/business-components/AddressBox/AddressBox.css.d.ts +0 -7
  124. package/dist/v2/business-components/AddressBox/AddressBox.d.ts +0 -8
  125. package/dist/v2/business-components/AddressBox/AddressBox.js +0 -99
  126. package/dist/v2/business-components/AddressBox/index.d.ts +0 -1
  127. package/dist/v2/business-components/AddressBox/index.js +0 -6
  128. package/dist/v2/chunks/address-locator.98305e58.js +0 -4
  129. package/dist/v2/chunks/arrow-right.eedc7433.js +0 -4
  130. package/dist/v2/chunks/place-circle.64383a4c.js +0 -4
  131. package/dist/v2/css/AddressBox-7839a1ac.css +0 -47
  132. package/dist/v3/business-components/AddressBox/AddressBox.css.d.ts +0 -7
  133. package/dist/v3/business-components/AddressBox/AddressBox.d.ts +0 -14
  134. package/dist/v3/business-components/AddressBox/AddressBox.js +0 -91
  135. package/dist/v3/business-components/AddressBox/index.d.ts +0 -1
  136. package/dist/v3/business-components/AddressBox/index.js +0 -6
  137. package/dist/v3/chunks/address-locator.98305e58.js +0 -4
  138. package/dist/v3/chunks/arrow-right.eedc7433.js +0 -4
  139. package/dist/v3/chunks/place-circle.64383a4c.js +0 -4
  140. package/dist/v3/css/AddressBox-7839a1ac.css +0 -47
package/README.md CHANGED
@@ -136,8 +136,30 @@ export type RecommendType = "Restricted" | "Forbidden" | "Recommend";
136
136
  gaodeDirectionWalkingProxyUrl="/overseas/amap/walkingGuide"
137
137
  // 可选,谷歌路线纠偏代理地址
138
138
  googleSnapRoadProxyUrl="/overseas/maps/snapToRoads"
139
- // 可选,谷歌路线规划代理地址
139
+ // 弃用,谷歌路线规划代理地址
140
140
  googleDirectionsProxyUrl="/overseas/maps/directions/json"
141
+ // 可选,谷歌路由服务代理地址
142
+ googleRoutesProxyUrl="/overseas/maps/routes/directions"
143
+ // 可选,自定义地图颜色
144
+ themeVariables={{
145
+ TRAFFIC_UNKNOWN_BACKGROUND_COLOR: "#00C875",
146
+ TRAFFIC_UNKNOWN_BORDER_COLOR: "#008559",
147
+ TRAFFIC_NORMAL_BACKGROUND_COLOR: "#00C875",
148
+ TRAFFIC_NORMAL_BORDER_COLOR: "#008559",
149
+ TRAFFIC_SLOW_BACKGROUND_COLOR: "#F9D100",
150
+ TRAFFIC_SLOW_BORDER_COLOR: "#B29400",
151
+ TRAFFIC_TRAFFIC_JAM_BACKGROUND_COLOR: "#EB0E33",
152
+ TRAFFIC_TRAFFIC_JAM_BORDER_COLOR: "#990D24",
153
+ TRAFFIC_HEAVY_TRAFFIC_JAM_BACKGROUND_COLOR: "#99001A",
154
+ TRAFFIC_HEAVY_TRAFFIC_JAM_BORDER_COLOR: "#4D000D",
155
+ TRAFFIC_DONE_BACKGROUND_COLOR: "#96B2CA",
156
+ TRAFFIC_DONE_BORDER_COLOR: "#7693AF",
157
+ WALKING_LINE_COLOR: "#38A3FE",
158
+ ZONE_RESTRICTED_BACKGROUND_COLOR: "#C7E5FB",
159
+ ZONE_RESTRICTED_BORDER_COLOR: "#4BA7FF",
160
+ ZONE_FORBIDDEN_BACKGROUND_COLOR: "#F27878",
161
+ ZONE_FORBIDDEN_BORDER_COLOR: "#F41717",
162
+ }}
141
163
  // 地图加载失败时显示的标题
142
164
  renderLoadFailedTitle={() => (supplier === "gmap" ? "未能成功访问谷歌地图" : "高德地图加载失败")}
143
165
  // 地图加载失败时显示的描述
package/dist/v2/App.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { h } from "vue";
2
2
  import { defineComponent, ref } from "vue-demi";
3
- import { DemoBusinessRecomendPlace } from "./Demo/DemoBusinessRecomendPlace.js";
3
+ import { DemoBusinessQuoting } from "./Demo/DemoBusinessQuoting.js";
4
4
  import { MapProvider } from "./components/MapProvider/MapProvider.js";
5
5
  const gmapApiKey = "AIzaSyCCOe8MAeS3EYvSraKsBX6ztVyLxj69z94";
6
6
  const gmapId = "d0af0c05331af64a";
@@ -18,6 +18,8 @@ const App = defineComponent({
18
18
  "gmapKey": gmapApiKey,
19
19
  "language": "en",
20
20
  "supplier": supplierRef.value,
21
+ "googleSnapRoadProxyUrl": "/overseas/maps/snapToRoads",
22
+ "googleRoutesProxyUrl": "/overseas/maps/routes/directions",
21
23
  "renderLoadFailedTitle": () => supplierRef.value === "gmap" ? "未能成功访问谷歌地图" : "高德地图加载失败",
22
24
  "renderLoadFailedDescription": () => supplierRef.value === "gmap" ? "请确认您的网络能正常访问谷歌地图, \n或切回高德地图" : void 0
23
25
  },
@@ -26,7 +28,7 @@ const App = defineComponent({
26
28
  "fail": () => console.log(`${supplierRef.value} load failed`),
27
29
  "downloadOptimizeEnd": () => console.log(`${supplierRef.value} load download optimize end`)
28
30
  }
29
- }, [h(DemoBusinessRecomendPlace)]);
31
+ }, [h(DemoBusinessQuoting)]);
30
32
  }
31
33
  });
32
34
  export {
@@ -1,5 +1,5 @@
1
1
  import { h } from "vue";
2
- import { B as BusinessRecomendPlaceMap } from "../chunks/BusinessRecomendPlaceMap.7b67c30c.js";
2
+ import { B as BusinessRecomendPlaceMap } from "../chunks/BusinessRecomendPlaceMap.e9166e7d.js";
3
3
  import { useBusinessRecomendPlaceMap } from "../hooks-business/useBusinessRecomendPlaceMap.js";
4
4
  import { defineSetup } from "../types/helper.js";
5
5
  import { d as demo } from "../chunks/Demo.css.e921a2f6.js";
@@ -1,7 +1,7 @@
1
1
  export declare const AMAP_DEFAULT_MARKER_ICON_URL = "https://webapi.amap.com/theme/v1.3/markers/b/mark_bs.png";
2
2
  export declare const ICON_FULL_SCREEN_URL = "https://overseas-oss.heycars.cn/heycar-map/png/fullscreen.png";
3
- export declare const ICON_START_POINT_EN_URL = "https://overseas-oss.heycars.cn/heycar-map/svg/start-point-en.svg";
4
- export declare const ICON_END_POINT_EN_URL = "https://overseas-oss.heycars.cn/heycar-map/svg/end-point-en.svg";
3
+ export declare const ICON_START_POINT_EN_URL = "https://overseas-oss.heycars.cn/heycar-map/svg/tmp/start-point-en.20250512.svg";
4
+ export declare const ICON_END_POINT_EN_URL = "https://overseas-oss.heycars.cn/heycar-map/svg/tmp/start-point-en.20250512.svg";
5
5
  export declare const ICON_END_POINT_ZH_TW_URL = "https://overseas-oss.heycars.cn/heycar-map/svg/end-point-zh-TW.svg";
6
6
  export declare const ICON_TAXI_CAR_URL = "https://overseas-oss.heycars.cn/heycar-map/svg/taxi-car.svg";
7
7
  export declare const ICON_DOT_LOADING_URL = "https://overseas-oss.heycars.cn/heycar-map/gif/dot-loading.gif";
@@ -1,7 +1,7 @@
1
1
  const AMAP_DEFAULT_MARKER_ICON_URL = "https://webapi.amap.com/theme/v1.3/markers/b/mark_bs.png";
2
2
  const ICON_FULL_SCREEN_URL = "https://overseas-oss.heycars.cn/heycar-map/png/fullscreen.png";
3
- const ICON_START_POINT_EN_URL = "https://overseas-oss.heycars.cn/heycar-map/svg/start-point-en.svg";
4
- const ICON_END_POINT_EN_URL = "https://overseas-oss.heycars.cn/heycar-map/svg/end-point-en.svg";
3
+ const ICON_START_POINT_EN_URL = "https://overseas-oss.heycars.cn/heycar-map/svg/tmp/start-point-en.20250512.svg";
4
+ const ICON_END_POINT_EN_URL = "https://overseas-oss.heycars.cn/heycar-map/svg/tmp/start-point-en.20250512.svg";
5
5
  const ICON_END_POINT_ZH_TW_URL = "https://overseas-oss.heycars.cn/heycar-map/svg/end-point-zh-TW.svg";
6
6
  const ICON_TAXI_CAR_URL = "https://overseas-oss.heycars.cn/heycar-map/svg/taxi-car.svg";
7
7
  const ICON_DOT_LOADING_URL = "https://overseas-oss.heycars.cn/heycar-map/gif/dot-loading.gif";
@@ -0,0 +1,27 @@
1
+ /// <reference types="google.maps" />
2
+ import type { protos } from "@googlemaps/routing";
3
+ type GoogleRoutesMeasurableObject = {
4
+ distanceMeters?: number;
5
+ staticDuration?: string;
6
+ staticDurationSeconds?: number;
7
+ duration?: string;
8
+ durationSeconds?: number;
9
+ };
10
+ type GoogleRoutesStep = Omit<protos.google.maps.routing.v2.IRouteLegStep, "staticDuration"> & GoogleRoutesMeasurableObject & {
11
+ path: google.maps.LatLng[];
12
+ };
13
+ type GoogleRoutesLeg = Omit<protos.google.maps.routing.v2.IRouteLeg, "steps" | "staticDuration" | "duration"> & GoogleRoutesMeasurableObject & {
14
+ steps: GoogleRoutesStep[];
15
+ };
16
+ type GoogleRoutesRoute = Omit<protos.google.maps.routing.v2.IRoute, "legs" | "staticDuration" | "duration"> & GoogleRoutesMeasurableObject & {
17
+ legs: GoogleRoutesLeg[];
18
+ path: google.maps.LatLng[];
19
+ };
20
+ export interface GoogleRoutesResponse {
21
+ routes: GoogleRoutesRoute[];
22
+ }
23
+ interface ApiGoogleRoutesProps extends protos.google.maps.routing.v2.IComputeRoutesRequest {
24
+ proxyUrl?: string;
25
+ }
26
+ export declare function apiGoogleRoutes(props: ApiGoogleRoutesProps): Promise<GoogleRoutesResponse>;
27
+ export {};
@@ -0,0 +1,135 @@
1
+ import { googleEncodedPolyline2googleLatLng } from "../utils/transform.js";
2
+ import { isProxyServiceError, createTypeError } from "../utils/typeChecking.js";
3
+ const ALL_ROUTES_STATUS = [
4
+ "OK",
5
+ "CANCELLED",
6
+ "UNKNOWN",
7
+ "INVALID_ARGUMENT",
8
+ "DEADLINE_EXCEEDED",
9
+ "NOT_FOUND",
10
+ "ALREADY_EXISTS",
11
+ "PERMISSION_DENIED",
12
+ "UNAUTHENTICATED",
13
+ "RESOURCE_EXHAUSTED",
14
+ "FAILED_PRECONDITION",
15
+ "ABORTED",
16
+ "OUT_OF_RANGE",
17
+ "UNIMPLEMENTED",
18
+ "INTERNAL",
19
+ "UNAVAILABLE",
20
+ "DATA_LOSS"
21
+ ];
22
+ const isGoogleRoutesStatus = (value) => {
23
+ return typeof value === "string" && ALL_ROUTES_STATUS.includes(value);
24
+ };
25
+ const isGoogleRoutesError = (value) => {
26
+ return typeof value === "object" && value !== null && "error" in value && typeof value.error === "object" && value.error !== null && "code" in value.error && typeof value.error.code === "number" && "message" in value.error && typeof value.error.message === "string" && "status" in value.error && isGoogleRoutesStatus(value.error.status);
27
+ };
28
+ const isGoogleRoutesMeasurableObject = (value) => {
29
+ if (typeof value !== "object" || value === null || !("distanceMeters" in value) || typeof value.distanceMeters !== "number" || !("staticDuration" in value) || typeof value.staticDuration !== "string" || !value.staticDuration.endsWith("s")) {
30
+ return false;
31
+ }
32
+ value.staticDurationSeconds = Number(
33
+ value.staticDuration.slice(0, -1)
34
+ );
35
+ if (!("duration" in value))
36
+ return true;
37
+ if (typeof value.duration !== "string" || !value.duration.endsWith("s"))
38
+ return false;
39
+ value.durationSeconds = Number(value.duration.slice(0, -1));
40
+ return true;
41
+ };
42
+ const isGoogleRoutesPolyline = (value) => {
43
+ return typeof value === "object" && value !== null && "encodedPolyline" in value && typeof value.encodedPolyline === "string";
44
+ };
45
+ function assertGoogleRoutesStep(value) {
46
+ const error = createTypeError("GoogleRoutesStep", value);
47
+ if (!isGoogleRoutesMeasurableObject(value))
48
+ throw error;
49
+ if (!("polyline" in value) || value.polyline === null) {
50
+ value.path = [];
51
+ return;
52
+ }
53
+ if (!isGoogleRoutesPolyline(value.polyline))
54
+ throw error;
55
+ value.path = googleEncodedPolyline2googleLatLng(
56
+ value.polyline.encodedPolyline
57
+ );
58
+ }
59
+ function assertGoogleRoutesLeg(value) {
60
+ if (!isGoogleRoutesMeasurableObject(value) || !("steps" in value) || !Array.isArray(value.steps))
61
+ throw createTypeError("GoogleRoutesLeg", value);
62
+ try {
63
+ for (const step of value.steps) {
64
+ assertGoogleRoutesStep(step);
65
+ }
66
+ } catch (error) {
67
+ const { message: detail } = error;
68
+ throw createTypeError("GoogleRoutesLeg", value, detail);
69
+ }
70
+ }
71
+ function assertGoogleRoutesRoute(value) {
72
+ if (typeof value !== "object" || value === null || !("legs" in value) || !Array.isArray(value.legs) || !("polyline" in value) || !isGoogleRoutesPolyline(value.polyline))
73
+ throw createTypeError("GoogleRoutesRoute", value);
74
+ value.path = googleEncodedPolyline2googleLatLng(
75
+ value.polyline.encodedPolyline
76
+ );
77
+ try {
78
+ for (const leg of value.legs) {
79
+ assertGoogleRoutesLeg(leg);
80
+ }
81
+ } catch (error) {
82
+ const { message: detail } = error;
83
+ throw createTypeError("GoogleRoutesRoute", value, detail);
84
+ }
85
+ }
86
+ function assertGoogleRoutesResponse(value) {
87
+ if (typeof value !== "object" || value === null || !("routes" in value) || !Array.isArray(value.routes))
88
+ throw createTypeError("GoogleRoutesResponse", value);
89
+ try {
90
+ for (const route of value.routes) {
91
+ assertGoogleRoutesRoute(route);
92
+ }
93
+ } catch (error) {
94
+ const { message: detail } = error;
95
+ throw createTypeError("GoogleRoutesResponse", value, detail);
96
+ }
97
+ }
98
+ async function apiGoogleRoutes(props) {
99
+ const { proxyUrl, ...request } = props;
100
+ if (!proxyUrl) {
101
+ console.warn("Warning: google routes service is bypassed due to proxyUrl is not provided!");
102
+ return { routes: [] };
103
+ }
104
+ const { protocol, host } = location;
105
+ const baseUrl = proxyUrl.startsWith(protocol) ? void 0 : `${protocol}//${host}`;
106
+ const url = new URL(proxyUrl, baseUrl);
107
+ const response = await fetch(url, {
108
+ method: "POST",
109
+ headers: { "Content-Type": "application/json" },
110
+ body: JSON.stringify(request)
111
+ });
112
+ if (response.ok) {
113
+ const result = await response.json();
114
+ assertGoogleRoutesResponse(result);
115
+ return result;
116
+ }
117
+ const error = await response.json();
118
+ if (isProxyServiceError(error)) {
119
+ const { code, msg } = error;
120
+ throw new Error(`apiGoogleRoutes proxy failed code: ${code}, msg: ${msg}`);
121
+ }
122
+ if (isGoogleRoutesError(error)) {
123
+ const {
124
+ error: { status, message }
125
+ } = error;
126
+ throw new Error(`apiGoogleRoutes failed status: ${status}, message:
127
+ ${message}`);
128
+ }
129
+ throw new Error(
130
+ `apiGoogleRoutes failed with unrecognized server response: ${JSON.stringify(error)}`
131
+ );
132
+ }
133
+ export {
134
+ apiGoogleRoutes
135
+ };
@@ -1,13 +1,14 @@
1
- import "../../css/AbsoluteAddressBox-7502ed45.css";
1
+ import "../../css/AbsoluteAddressBox-125d3642.css";
2
2
  import { h } from "vue";
3
3
  import { computed } from "vue-demi";
4
4
  import { ICON_DOT_LOADING_URL } from "../../api/cdn.js";
5
- import { i as imgAddressLocator } from "../../chunks/address-locator.98305e58.js";
6
- import { i as imgArrowRight } from "../../chunks/arrow-right.eedc7433.js";
5
+ import { i as imgAddressLocator } from "../../chunks/address-locator.c8105f89.js";
6
+ import { i as imgArrowRight } from "../../chunks/arrow-right.c4bcf4de.js";
7
+ import { SvgInlineWebComponentTag } from "../../components/SvgInline/SvgInline.web-component.js";
7
8
  import { defineSetup } from "../../types/helper.js";
8
9
  import { c as createRuntimeFn } from "../../chunks/vanilla-extract-recipes-createRuntimeFn.esm.bd6fc290.js";
9
- const imgBubbleRightArc = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTAgMGgyLjEzMWExMCAxMCAwIDAxOS42OTYgNy41NTJMMTggMzJILjA0MkwwIDB6IiBmaWxsPSIjMjUzRTdBIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=";
10
- const imgGuideArrow = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHdpZHRoPSIyIiBoZWlnaHQ9IjYiPgogIDxwYXRoIGQ9Ik0uNTE2IDEuMTAzQS4zLjMgMCAwMDAgMS4zMXYyLjY2OGEuMy4zIDAgMDAuNTE2LjIwOEwxLjggMi44NTNhLjMuMyAwIDAwMC0uNDE2TC41MTYgMS4xMDN6IiBmaWxsPSIjRkZGIiAvPgo8L3N2Zz4=";
10
+ const imgBubbleRightArc = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMzIiIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaWRZTWlkIG1lZXQiIHZpZXdCb3g9IjAgMCAxOCAzMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMCAwaDIuMTMxYTEwIDEwIDAgMDE5LjY5NiA3LjU1MkwxOCAzMkguMDQyTDAgMHoiIGZpbGw9InZhcigtLUhFWUNBUl9NQVBfQ1NTX1ZBUl9BYnNvbHV0ZUFkZHJlc3NCb3hfYm94SGVhZGVyX2JhY2tncm91bmQsIGhzbCgyMjIsIDUzJSwgMzElKSkiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==";
11
+ const imgGuideArrow = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHdpZHRoPSIyIiBoZWlnaHQ9IjYiIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaWRZTWlkIG1lZXQiIHZpZXdCb3g9IjAgMCAyIDYiPgogIDxwYXRoIGQ9Ik0uNTE2IDEuMTAzQS4zLjMgMCAwMDAgMS4zMXYyLjY2OGEuMy4zIDAgMDAuNTE2LjIwOEwxLjggMi44NTNhLjMuMyAwIDAwMC0uNDE2TC41MTYgMS4xMDN6IiBmaWxsPSIjRkZGIiAvPgo8L3N2Zz4=";
11
12
  const AbsoluteAddressBox_css_ts_vanilla = "";
12
13
  var absoluteAddressBox = "n8tgem1";
13
14
  var absoluteAddressBoxLayout = "n8tgem0";
@@ -54,7 +55,7 @@ const AbsoluteAddressBox = defineSetup("AbsoluteAddressBox", function(props, {
54
55
  if (type === "locator")
55
56
  return h("div", {
56
57
  "class": absoluteAddressBoxLayout
57
- }, [h("img", {
58
+ }, [h(SvgInlineWebComponentTag, {
58
59
  "class": locatorIcon,
59
60
  "attrs": {
60
61
  "src": imgAddressLocator
@@ -84,7 +85,7 @@ const AbsoluteAddressBox = defineSetup("AbsoluteAddressBox", function(props, {
84
85
  "class": boxHeader
85
86
  }, [h("div", {
86
87
  "class": boxHeaderText
87
- }, [description]), h("img", {
88
+ }, [description]), h(SvgInlineWebComponentTag, {
88
89
  "class": boxHeaderIcon,
89
90
  "attrs": {
90
91
  "src": imgBubbleRightArc
@@ -108,7 +109,7 @@ const AbsoluteAddressBox = defineSetup("AbsoluteAddressBox", function(props, {
108
109
  }
109
110
  }, [h("div", {
110
111
  "class": boxPhotoDescription
111
- }, [photo.title]), h("img", {
112
+ }, [photo.title]), h(SvgInlineWebComponentTag, {
112
113
  "class": boxPhotoArrow,
113
114
  "attrs": {
114
115
  "src": imgGuideArrow
@@ -127,7 +128,7 @@ const AbsoluteAddressBox = defineSetup("AbsoluteAddressBox", function(props, {
127
128
  "attrs": {
128
129
  "value": title
129
130
  }
130
- })]), withArrow && h("img", {
131
+ })]), withArrow && h(SvgInlineWebComponentTag, {
131
132
  "class": arrowRight,
132
133
  "attrs": {
133
134
  "src": imgArrowRight
@@ -1,9 +1,10 @@
1
1
  import "../../css/AddressLocator-321d2936.css";
2
2
  import { h } from "vue";
3
3
  import { computed } from "vue-demi";
4
- import { i as imgAddressLocator } from "../../chunks/address-locator.98305e58.js";
4
+ import { i as imgAddressLocator } from "../../chunks/address-locator.c8105f89.js";
5
5
  import { AmapMarker } from "../../components/AmapMarker/AmapMarker.js";
6
6
  import { GmapAdvancedMarkerElement } from "../../components/GmapAdvancedMarkerElement/GmapAdvancedMarkerElement.js";
7
+ import { SvgInlineWebComponentTag } from "../../components/SvgInline/SvgInline.web-component.js";
7
8
  import { createElement } from "../../demi-polyfill/demi-polyfill.js";
8
9
  import { useMapSupplier } from "../../hooks/useMapSupplier.js";
9
10
  import { defineSetup } from "../../types/helper.js";
@@ -13,7 +14,7 @@ const AddressLocator_css_ts_vanilla = "";
13
14
  var addressLocator = "rgf09w0";
14
15
  const AAddressLocator = defineSetup("AAddressLocator", function(props) {
15
16
  const contentRef = computed(() => `
16
- <img src="${imgAddressLocator}" class="${addressLocator}">
17
+ <${SvgInlineWebComponentTag} src="${imgAddressLocator}" class="${addressLocator}">
17
18
  `);
18
19
  return () => h(AmapMarker, {
19
20
  "attrs": {
@@ -24,7 +25,7 @@ const AAddressLocator = defineSetup("AAddressLocator", function(props) {
24
25
  });
25
26
  });
26
27
  const GAddressLocator = defineSetup("GAddressLocator", function(props) {
27
- const contentRef = computed(() => createDom("img", {
28
+ const contentRef = computed(() => createDom(SvgInlineWebComponentTag, {
28
29
  class: addressLocator,
29
30
  src: imgAddressLocator
30
31
  }));
@@ -11,7 +11,7 @@ import { createElement } from "../../demi-polyfill/demi-polyfill.js";
11
11
  import { useMapSupplier } from "../../hooks/useMapSupplier.js";
12
12
  import { defineSetup } from "../../types/helper.js";
13
13
  import { vec2lnglat } from "../../utils/transform.js";
14
- const imgMarkerRed = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgaGVpZ2h0PSIyNCIgdmVyc2lvbj0iMS4xIiB3aWR0aD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6Y2M9Imh0dHA6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL25zIyIgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTEwMjguNCkiPjxwYXRoIGQ9Im0xMiAwYy00LjQxODMgMi4zNjg1ZS0xNSAtOCAzLjU4MTctOCA4IDAgMS40MjEgMC4zODE2IDIuNzUgMS4wMzEyIDMuOTA2IDAuMTA3OSAwLjE5MiAwLjIyMSAwLjM4MSAwLjM0MzggMC41NjNsNi42MjUgMTEuNTMxIDYuNjI1LTExLjUzMWMwLjEwMi0wLjE1MSAwLjE5LTAuMzExIDAuMjgxLTAuNDY5bDAuMDYzLTAuMDk0YzAuNjQ5LTEuMTU2IDEuMDMxLTIuNDg1IDEuMDMxLTMuOTA2IDAtNC40MTgzLTMuNTgyLTgtOC04em0wIDRjMi4yMDkgMCA0IDEuNzkwOSA0IDQgMCAyLjIwOS0xLjc5MSA0LTQgNC0yLjIwOTEgMC00LTEuNzkxLTQtNCAwLTIuMjA5MSAxLjc5MDktNCA0LTR6IiBmaWxsPSIjZTc0YzNjIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwIDEwMjguNCkiLz48cGF0aCBkPSJtMTIgM2MtMi43NjE0IDAtNSAyLjIzODYtNSA1IDAgMi43NjEgMi4yMzg2IDUgNSA1IDIuNzYxIDAgNS0yLjIzOSA1LTUgMC0yLjc2MTQtMi4yMzktNS01LTV6bTAgMmMxLjY1NyAwIDMgMS4zNDMxIDMgM3MtMS4zNDMgMy0zIDMtMy0xLjM0MzEtMy0zIDEuMzQzLTMgMy0zeiIgZmlsbD0iI2MwMzkyYiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAxMDI4LjQpIi8+PC9nPjwvc3ZnPg==";
14
+ const imgMarkerRed = "data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI0IiB3aWR0aD0iMjQiIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaWRZTWlkIG1lZXQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTIgMGE4IDggMCAwMC04IDhjMCAxLjQyMS4zODIgMi43NSAxLjAzMSAzLjkwNi4xMDguMTkyLjIyMS4zODEuMzQ0LjU2M0wxMiAyNGw2LjYyNS0xMS41MzFjLjEwMi0uMTUxLjE5LS4zMTEuMjgxLS40NjlsLjA2My0uMDk0QTcuOTU0IDcuOTU0IDAgMDAyMCA4YTggOCAwIDAwLTgtOHptMCA0YTQgNCAwIDExMCA4IDQgNCAwIDAxMC04eiIgZmlsbD0idmFyKC0tSEVZQ0FSX01BUF9TVkdfVkFSX21hcmtlci1yZWRfcGF0aF8xX2ZpbGwsIGhzbCg2LCA3OCUsIDU3JSkpIi8+PHBhdGggZD0iTTEyIDNhNSA1IDAgMTAwIDEwIDUgNSAwIDAwMC0xMHptMCAyYTMgMyAwIDExMCA2IDMgMyAwIDAxMC02eiIgZmlsbD0idmFyKC0tSEVZQ0FSX01BUF9TVkdfVkFSX21hcmtlci1yZWRfcGF0aF8yX2ZpbGwsIGhzbCg2LCA2MyUsIDQ2JSkpIi8+PC9zdmc+";
15
15
  const AAuxiliaryLine = defineSetup("AAuxiliaryLine", function(props) {
16
16
  const defaultMarkerSize = 36;
17
17
  const redIcon = new AMap.Icon({
@@ -27,7 +27,7 @@ import "../GreenZone/GreenZone.js";
27
27
  import "../PassengerCircle/PassengerCircle.js";
28
28
  import "../PickupPoints/PickupPoints.js";
29
29
  import "./useCacheCenterPlace.js";
30
- import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.7b67c30c.js";
30
+ import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.e9166e7d.js";
31
31
  export {
32
32
  B as BusinessRecomendPlaceMap,
33
33
  f as BusinessRecomendPlaceMapInner,
@@ -1,4 +1,4 @@
1
- import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.7b67c30c.js";
1
+ import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.e9166e7d.js";
2
2
  export {
3
3
  B as BusinessRecomendPlaceMap,
4
4
  f as BusinessRecomendPlaceMapInner,
@@ -21,7 +21,7 @@ import { detectBrowserPlatform } from "../../utils/platform.js";
21
21
  import { place2point, isPlaceEqual, isZoneEqual, geoPositionError2businessTimeout, pipeDefer } from "../../utils/transform.js";
22
22
  import { toCoordinatePlaceType, toCoordinatePointType, toCoordinateRecommendZonePlacesType } from "../../utils/typeChecking.js";
23
23
  import { AbsoluteAddressBox } from "../AbsoluteAddressBox/AbsoluteAddressBox.js";
24
- import { E as EMPTY_PLACE, m as memoize, R as RECOMMEND_PLACE_DRAG_LIMIT, a as RECOMMEND_PLACE_LARGE_LIMIT, b as RECOMMEND_PLACE_ZONE_ICON_MIN, c as RECOMMEND_PLACE_ICON_ZOOM_MIN, d as RECOMMEND_PLACE_ZONE_TEXT_MIN, e as RECOMMEND_PLACE_TEXT_ZOOM_MIN, D as DEFAULT_ZOOM, Z as ZONE_FITVIEW_PANDING } from "../../chunks/BusinessRecomendPlaceMap.7b67c30c.js";
24
+ import { E as EMPTY_PLACE, m as memoize, R as RECOMMEND_PLACE_DRAG_LIMIT, a as RECOMMEND_PLACE_LARGE_LIMIT, b as RECOMMEND_PLACE_ZONE_ICON_MIN, c as RECOMMEND_PLACE_ICON_ZOOM_MIN, d as RECOMMEND_PLACE_ZONE_TEXT_MIN, e as RECOMMEND_PLACE_TEXT_ZOOM_MIN, D as DEFAULT_ZOOM, Z as ZONE_FITVIEW_PANDING } from "../../chunks/BusinessRecomendPlaceMap.e9166e7d.js";
25
25
  import { DeviceOrientation } from "../DeviceOrientation/DeviceOrientation.js";
26
26
  import { GreenZone } from "../GreenZone/GreenZone.js";
27
27
  import { PassengerCircle } from "../PassengerCircle/PassengerCircle.js";
@@ -308,7 +308,7 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
308
308
  }
309
309
  }, [((_b = zoneRef.value) == null ? void 0 : _b.path.length) && h(GreenZone, {
310
310
  "attrs": {
311
- "isRed": isForbidden,
311
+ "isForbidden": isForbidden,
312
312
  "path": (_c = zoneRef.value) == null ? void 0 : _c.path
313
313
  }
314
314
  }), !geoLoading.value && !geoError.value && h(DeviceOrientation, {
@@ -1,9 +1,11 @@
1
- import type { TrafficStatus } from "../../types/interface";
1
+ import type { MapThemeVariables, TrafficStatus } from "../../types/interface";
2
2
  type DrivingLineStatus = TrafficStatus | "DONE";
3
+ type DrivingLineColors = Pick<MapThemeVariables, "TRAFFIC_UNKNOWN_BACKGROUND_COLOR" | "TRAFFIC_UNKNOWN_BORDER_COLOR" | "TRAFFIC_NORMAL_BACKGROUND_COLOR" | "TRAFFIC_NORMAL_BORDER_COLOR" | "TRAFFIC_SLOW_BACKGROUND_COLOR" | "TRAFFIC_SLOW_BORDER_COLOR" | "TRAFFIC_TRAFFIC_JAM_BACKGROUND_COLOR" | "TRAFFIC_TRAFFIC_JAM_BORDER_COLOR" | "TRAFFIC_HEAVY_TRAFFIC_JAM_BACKGROUND_COLOR" | "TRAFFIC_HEAVY_TRAFFIC_JAM_BORDER_COLOR" | "TRAFFIC_DONE_BACKGROUND_COLOR" | "TRAFFIC_DONE_BORDER_COLOR">;
3
4
  export interface DrivingLineProps {
4
5
  status?: DrivingLineStatus;
5
6
  path: [number, number][];
6
7
  lineCap?: AMap.LineSharedOptions["lineCap"];
8
+ colors?: DrivingLineColors;
7
9
  }
8
10
  export declare const ADrivingLine: import("vue-demi").DefineComponent<import("vue3").ComponentObjectPropsOptions<DrivingLineProps>, 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<DrivingLineProps, Required<DrivingLineProps>>, never, DrivingLineProps>;
9
11
  export declare const GDrivingLine: import("vue-demi").DefineComponent<import("vue3").ComponentObjectPropsOptions<DrivingLineProps>, 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<DrivingLineProps, Required<DrivingLineProps>>, never, DrivingLineProps>;
@@ -6,33 +6,20 @@ import { GmapPolyline } from "../../components/GmapPolyline/GmapPolyline.js";
6
6
  import { createElement } from "../../demi-polyfill/demi-polyfill.js";
7
7
  import { useMapSupplier } from "../../hooks/useMapSupplier.js";
8
8
  import { defineSetup } from "../../types/helper.js";
9
- import { vec2lnglat } from "../../utils/transform.js";
10
- const trafficInnerColors = {
11
- // UNKNOWN: "#487BF4",
12
- UNKNOWN: "#00C875",
13
- NORMAL: "#00C875",
14
- SLOW: "#F9D100",
15
- TRAFFIC_JAM: "#EB0E33",
16
- HEAVY_TRAFFIC_JAM: "#99001A",
17
- DONE: "#96B2CA"
18
- };
19
- const trafficOuterColors = {
20
- // UNKNOWN: "#4175F1",
21
- UNKNOWN: "#008559",
22
- NORMAL: "#008559",
23
- SLOW: "#B29400",
24
- TRAFFIC_JAM: "#990D24",
25
- HEAVY_TRAFFIC_JAM: "#4D000D",
26
- DONE: "#7693AF"
27
- };
28
- const trafficBorderColors = {
29
- // UNKNOWN: "#6C95F5",
30
- UNKNOWN: "#00C875",
31
- NORMAL: "#00C875",
32
- SLOW: "#F9D100",
33
- TRAFFIC_JAM: "#EB0E33",
34
- HEAVY_TRAFFIC_JAM: "#99001A",
35
- DONE: "#7693AF"
9
+ import { mergeDefaultProps, vec2lnglat } from "../../utils/transform.js";
10
+ const defaultColors = {
11
+ TRAFFIC_UNKNOWN_BACKGROUND_COLOR: "#00C875",
12
+ TRAFFIC_UNKNOWN_BORDER_COLOR: "#008559",
13
+ TRAFFIC_NORMAL_BACKGROUND_COLOR: "#00C875",
14
+ TRAFFIC_NORMAL_BORDER_COLOR: "#008559",
15
+ TRAFFIC_SLOW_BACKGROUND_COLOR: "#F9D100",
16
+ TRAFFIC_SLOW_BORDER_COLOR: "#B29400",
17
+ TRAFFIC_TRAFFIC_JAM_BACKGROUND_COLOR: "#EB0E33",
18
+ TRAFFIC_TRAFFIC_JAM_BORDER_COLOR: "#990D24",
19
+ TRAFFIC_HEAVY_TRAFFIC_JAM_BACKGROUND_COLOR: "#99001A",
20
+ TRAFFIC_HEAVY_TRAFFIC_JAM_BORDER_COLOR: "#4D000D",
21
+ TRAFFIC_DONE_BACKGROUND_COLOR: "#96B2CA",
22
+ TRAFFIC_DONE_BORDER_COLOR: "#7693AF"
36
23
  };
37
24
  const ADrivingLine = defineSetup("ADrivingLine", function(props) {
38
25
  return () => {
@@ -40,21 +27,21 @@ const ADrivingLine = defineSetup("ADrivingLine", function(props) {
40
27
  status = "UNKNOWN",
41
28
  lineCap = "round"
42
29
  } = props;
30
+ const colors = mergeDefaultProps(defaultColors, props.colors);
43
31
  const vw = window.innerWidth * 0.01;
44
32
  const strokeWidth = 1 * vw;
45
33
  const borderWidth = 0.13 * vw;
46
34
  const dirWidth = 0.24 * vw;
47
35
  const outlineWidth = 0.4 * vw;
48
36
  const dashLength = 0.3 * vw;
49
- const strokeColorInner = trafficInnerColors[status];
50
- const strokeColorOuter = trafficOuterColors[status];
51
- const strokeColorBorder = trafficBorderColors[status];
37
+ const areaColor = colors[`TRAFFIC_${status}_BACKGROUND_COLOR`];
38
+ const borderColor = colors[`TRAFFIC_${status}_BORDER_COLOR`];
52
39
  return h("div", [h(AmapPolyline, {
53
40
  "attrs": {
54
41
  "path": props.path,
55
42
  "strokeWeight": strokeWidth + 2 * borderWidth + 2 * outlineWidth,
56
43
  "strokeOpacity": 1,
57
- "strokeColor": strokeColorOuter,
44
+ "strokeColor": borderColor,
58
45
  "lineJoin": "round",
59
46
  "lineCap": lineCap,
60
47
  "zIndex": ZINDEX_LINE_LAYER
@@ -64,7 +51,7 @@ const ADrivingLine = defineSetup("ADrivingLine", function(props) {
64
51
  "path": props.path,
65
52
  "strokeWeight": strokeWidth + 2 * borderWidth,
66
53
  "strokeOpacity": 1,
67
- "strokeColor": strokeColorBorder,
54
+ "strokeColor": areaColor,
68
55
  "lineJoin": "round",
69
56
  "lineCap": lineCap,
70
57
  "strokeStyle": "dashed",
@@ -76,7 +63,7 @@ const ADrivingLine = defineSetup("ADrivingLine", function(props) {
76
63
  "path": props.path,
77
64
  "strokeWeight": strokeWidth,
78
65
  "strokeOpacity": 1,
79
- "strokeColor": strokeColorInner,
66
+ "strokeColor": areaColor,
80
67
  "lineJoin": "round",
81
68
  "lineCap": lineCap,
82
69
  "zIndex": ZINDEX_LINE_LAYER
@@ -101,21 +88,21 @@ const GDrivingLine = defineSetup("GDrivingLine", function(props) {
101
88
  const {
102
89
  status = "UNKNOWN"
103
90
  } = props;
91
+ const colors = mergeDefaultProps(defaultColors, props.colors);
104
92
  const vw = window.innerWidth * 0.01;
105
93
  const repeat = 10 * vw;
106
94
  const strokeWidth = 1.25 * vw * 0.65;
107
95
  const borderWidth = 0.175 * vw * 0.65;
108
96
  const dirStrokeWeight = 0.375 * vw * 0.65;
109
97
  const outlineWidth = 0.45 * vw * 0.65;
110
- const strokeColorInner = trafficInnerColors[status];
111
- const strokeColorOuter = trafficOuterColors[status];
112
- const strokeColorBorder = trafficBorderColors[status];
98
+ const areaColor = colors[`TRAFFIC_${status}_BACKGROUND_COLOR`];
99
+ const borderColor = colors[`TRAFFIC_${status}_BORDER_COLOR`];
113
100
  return h("div", [h(GmapPolyline, {
114
101
  "attrs": {
115
102
  "path": pathRef.value,
116
103
  "strokeWeight": strokeWidth + 2 * borderWidth + 2 * outlineWidth,
117
104
  "strokeOpacity": 1,
118
- "strokeColor": strokeColorOuter,
105
+ "strokeColor": borderColor,
119
106
  "zIndex": ZINDEX_LINE_LAYER
120
107
  }
121
108
  }), h(GmapPolyline, {
@@ -125,8 +112,8 @@ const GDrivingLine = defineSetup("GDrivingLine", function(props) {
125
112
  icon: {
126
113
  path: `M 0,-0.5 0,0.5`,
127
114
  strokeWeight: strokeWidth + 2 * borderWidth,
128
- strokeColor: strokeColorBorder,
129
- fillColor: strokeColorBorder,
115
+ strokeColor: areaColor,
116
+ fillColor: areaColor,
130
117
  scale: 1
131
118
  },
132
119
  repeat: `${strokeWidth}px`,
@@ -139,7 +126,7 @@ const GDrivingLine = defineSetup("GDrivingLine", function(props) {
139
126
  "path": pathRef.value,
140
127
  "strokeWeight": strokeWidth,
141
128
  "strokeOpacity": 1,
142
- "strokeColor": strokeColorInner,
129
+ "strokeColor": areaColor,
143
130
  "icons": [{
144
131
  icon: {
145
132
  path: google.maps.SymbolPath.FORWARD_OPEN_ARROW,
@@ -159,8 +146,15 @@ const DrivingLine = defineSetup("DrivingLine", function(props) {
159
146
  return () => {
160
147
  if (!props.path.length)
161
148
  return null;
149
+ const colors = {
150
+ ...payload.themeVariables,
151
+ ...props.colors
152
+ };
162
153
  return createElement(payload.supplier === "gmap" ? GDrivingLine : ADrivingLine, {
163
- attrs: props
154
+ attrs: {
155
+ ...props,
156
+ colors
157
+ }
164
158
  });
165
159
  };
166
160
  });
@@ -1,8 +1,10 @@
1
1
  import type { GmapOverlay, MapRegisterOverlayProps } from "../../hooks/useOverlay";
2
- import type { Point } from "../../types/interface";
2
+ import type { MapThemeVariables, Point } from "../../types/interface";
3
+ type GreenZoneColors = Pick<MapThemeVariables, "ZONE_RESTRICTED_BACKGROUND_COLOR" | "ZONE_RESTRICTED_BORDER_COLOR" | "ZONE_FORBIDDEN_BACKGROUND_COLOR" | "ZONE_FORBIDDEN_BORDER_COLOR">;
3
4
  interface GreenZoneProps<T> extends MapRegisterOverlayProps<T> {
4
- isRed?: boolean;
5
+ isForbidden?: boolean;
5
6
  path: Point[];
7
+ colors?: GreenZoneColors;
6
8
  }
7
9
  export declare const AGreenZone: import("vue-demi").DefineComponent<import("vue3").ComponentObjectPropsOptions<GreenZoneProps<{
8
10
  _needUpdate: boolean;