@heycar/heycars-map 0.9.16 → 0.9.18-graspRoad

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 (40) hide show
  1. package/README.md +39 -3
  2. package/dist/index.cjs +1431 -222
  3. package/dist/index.js +1431 -222
  4. package/dist/src/Demo/DemoBusinessTaxiService.d.ts +2 -5
  5. package/dist/src/api/contants.d.ts +5 -0
  6. package/dist/src/business-components/AuxiliaryCircle/AuxiliaryCircle.d.ts +11 -0
  7. package/dist/src/business-components/AuxiliaryCircle/index.d.ts +1 -0
  8. package/dist/src/business-components/AuxiliaryGraspRoad/AuxiliaryGraspRoad.d.ts +8 -0
  9. package/dist/src/business-components/AuxiliaryGraspRoad/index.d.ts +1 -0
  10. package/dist/src/business-components/AuxiliaryLine/AuxiliaryLine.d.ts +11 -0
  11. package/dist/src/business-components/AuxiliaryLine/index.d.ts +1 -0
  12. package/dist/src/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +3 -1
  13. package/dist/src/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.d.ts +2 -2
  14. package/dist/src/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +2 -5
  15. package/dist/src/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.d.ts +3 -1
  16. package/dist/src/business-components/DeviationCorrectionDrivingRoute/DeviationCorrectionDrivingRoute.d.ts +6 -0
  17. package/dist/src/business-components/DeviationCorrectionDrivingRoute/index.d.ts +1 -0
  18. package/dist/src/business-components/GraspRoad/GraspRoad.d.ts +10 -0
  19. package/dist/src/business-components/GraspRoad/index.d.ts +1 -0
  20. package/dist/src/business-components/TaxiCar/TaxiCar.d.ts +1 -0
  21. package/dist/src/components/AmapCircle/AmapCircle.d.ts +2 -0
  22. package/dist/src/components/AmapCircle/index.d.ts +1 -0
  23. package/dist/src/components/GmapCircle/GmapCircle.d.ts +3 -0
  24. package/dist/src/components/GmapCircle/index.d.ts +1 -0
  25. package/dist/src/hooks/useDeviationCorrectionDrivingRoute.d.ts +47 -0
  26. package/dist/src/hooks/useDrivingRoute.d.ts +32 -14
  27. package/dist/src/hooks/useMapAngle.d.ts +12 -3
  28. package/dist/src/hooks/useMapGCJ02.d.ts +3 -0
  29. package/dist/src/hooks/useMapGeometry.d.ts +3 -0
  30. package/dist/src/hooks/useMapGraspRoad.d.ts +24 -0
  31. package/dist/src/hooks-business/useBusinessRecomendPlaceMap.d.ts +2 -0
  32. package/dist/src/hooks-business/useBusinessReselectPlaceMap.d.ts +1 -0
  33. package/dist/src/types/interface.d.ts +7 -0
  34. package/dist/src/types/mapHelper.d.ts +3 -0
  35. package/dist/src/utils/geolocationPositionError.d.ts +1 -0
  36. package/dist/src/utils/geometry.d.ts +46 -0
  37. package/dist/src/utils/helper.d.ts +2 -0
  38. package/dist/src/utils/mockDriverPositions.d.ts +10 -0
  39. package/dist/src/utils/transform.d.ts +25 -1
  40. package/package.json +1 -1
package/README.md CHANGED
@@ -224,6 +224,12 @@ export default defineComponent({
224
224
  onGeoError={() => {
225
225
  console.log("获取GPS失败时触发,此时可以弹框告诉用户");
226
226
  }}
227
+ onGeoErrorOnce={(isBusinessTimeout) => {
228
+ console.log(
229
+ "获取GPS失败时触发, 只触发一次, ",
230
+ isBusinessTimeout ? "给用户超时提示" : "给用户无权限反馈",
231
+ );
232
+ }}
227
233
  />
228
234
  );
229
235
  },
@@ -332,6 +338,12 @@ export default defineComponent({
332
338
  onGeoError={() => {
333
339
  console.log("获取GPS失败时触发,此时可以弹框告诉用户");
334
340
  }}
341
+ onGeoErrorOnce={(isBusinessTimeout) => {
342
+ console.log(
343
+ "获取GPS失败时触发, 只触发一次, ",
344
+ isBusinessTimeout ? "给用户超时提示" : "给用户无权限反馈",
345
+ );
346
+ }}
335
347
  />
336
348
  );
337
349
  },
@@ -414,9 +426,13 @@ export default defineComponent({
414
426
  renderInServiceTitle={({ distance, duration }) =>
415
427
  `距离终点*${distance}*公里, 预计*${duration}*分钟`
416
428
  }
417
- getDriverPosition={async () => {
418
- // 向后端请求司机位置和车头方向
419
- return { position: [121.4036983, 31.216324], angle: 30 };
429
+ getDriverPositionTrack={async () => {
430
+ // 向后端请求司机的历史轨迹
431
+ return Promise.resolve<TrackPoint[]>([
432
+ { lng: 121.4036983, lat: 31.216324, angle: 30, timestamp: 1698058438000 },
433
+ { lng: 121.4036983, lat: 31.216324, angle: 30, timestamp: 1698058439000 },
434
+ { lng: 121.403581, lat: 31.216415, angle: 30, timestamp: 1698058442000 },
435
+ ]);
420
436
  }}
421
437
  interval={5000}
422
438
  mapRef={setMap}
@@ -526,3 +542,23 @@ export default defineComponent({
526
542
  ...
527
543
  </HeycarMap>
528
544
  ```
545
+
546
+ #### 关于 enableAuxiliaryGraspRoad 模式
547
+
548
+ enableAuxiliaryGraspRoad 模式适用场景:
549
+
550
+ - 测试司机位置偏移 的优化效果
551
+ - 目前只能在国内打车,测试优化效果。
552
+ - 目前只能用 splytech 供应商进行测试。
553
+
554
+ 测试时的注意点:
555
+
556
+ 1. 起点和终点 在 splytech 后台系统地图上的位置是错误的。
557
+
558
+ 为了方便测试 司机位置偏移 的优化效果,在 enableAuxiliaryGraspRoad 模式下会显示下列辅助信息:
559
+
560
+ 1. 会显示两个导航路线,蓝色跟设计稿样式一致的是原来的导航路径,红色的是司机位置纠偏以后计算的导航路径。
561
+ 2. 会显示两个车辆,跟设计稿样式一致的是原来的车辆,虚影的车辆是司机位置纠偏以后的车辆。
562
+ 3. 会将供应商提供的司机位置显示为蓝色标记,辅助观察供应商提供的司机位置。
563
+ 4. 会显示一条黑色的路径,表示将供应商提供的位置纠偏以后的路径。
564
+ 5. enableAuxiliaryGraspRoad 模式下,为了方便测试,取消了屏幕 15 秒自动调整功能。