@heycar/heycars-map 0.3.5 → 0.3.7

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 (35) hide show
  1. package/dist/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +0 -1
  2. package/dist/business-components/PickupPoints/PickupPoints.d.ts +2 -1
  3. package/dist/components/Gmap/Gmap.css.d.ts +1 -0
  4. package/dist/components/Gmap/Gmap.d.ts +2 -0
  5. package/dist/components/MapProvider/MapProvider.d.ts +2 -0
  6. package/dist/hooks/useMapLngLatToVw.d.ts +10 -0
  7. package/dist/hooks/useMapPlace.d.ts +2 -1
  8. package/dist/hooks/useMapRecomendPlace.d.ts +4 -1
  9. package/dist/hooks/usePlacesLabelDirection.d.ts +9 -0
  10. package/dist/hooks/useWaitTimer.d.ts +12 -0
  11. package/dist/index.cjs +53 -53
  12. package/dist/index.js +1286 -1172
  13. package/dist/style.css +1 -1
  14. package/dist/utils/transform.d.ts +2 -0
  15. package/package.json +1 -1
  16. package/src/App.tsx +1 -1
  17. package/src/Demo/DemoBusinessRecomendPlace.tsx +8 -4
  18. package/src/business-components/AbsoluteAddressBox/AbsoluteAddressBox.tsx +1 -1
  19. package/src/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.tsx +42 -16
  20. package/src/business-components/PickupPoints/PickupPoints.tsx +24 -11
  21. package/src/business-components/PlaceCircle/PlaceCircle.css.ts +7 -2
  22. package/src/components/Gmap/Gmap.css.ts +5 -0
  23. package/src/components/Gmap/Gmap.ts +8 -10
  24. package/src/components/MapProvider/MapProvider.tsx +4 -2
  25. package/src/hooks/useGeoLocation.ts +3 -2
  26. package/src/hooks/useMapDrag.ts +0 -1
  27. package/src/hooks/useMapFitView.ts +0 -1
  28. package/src/hooks/useMapLngLatToVw.ts +31 -0
  29. package/src/hooks/useMapPlace.ts +15 -7
  30. package/src/hooks/useMapRecomendPlace.ts +17 -2
  31. package/src/hooks/usePlacesLabelDirection.ts +61 -0
  32. package/src/hooks/useWaitTimer.ts +25 -0
  33. package/src/hooks/useWalkingRoute.ts +0 -1
  34. package/src/utils/transform.ts +8 -0
  35. package/todo.md +1 -0
@@ -23,7 +23,6 @@ export const useAWalkingRoute = (props: UseWalkingRouteProps) => {
23
23
  return;
24
24
  }
25
25
  const firstRoute = walkingResult.routes[0];
26
- console.log("firstRoute = ", firstRoute);
27
26
  for (const step of firstRoute.steps) {
28
27
  const stepPath = step.path.map<Point>(({ lng, lat }) => [lng, lat]);
29
28
  path = path.concat(stepPath);
@@ -58,3 +58,11 @@ export const geocoderResult2cityName = (value: google.maps.GeocoderResult): stri
58
58
  if (countryIdx > 0) return address_components[countryIdx - 1].long_name;
59
59
  return undefined;
60
60
  };
61
+
62
+ export const isPlaceEqual = (p1: Place, p2?: Place) => {
63
+ return p1.lng === p2?.lng && p1.lat === p2?.lat;
64
+ };
65
+
66
+ export const isPointEqual = (p1: Point, p2?: Point) => {
67
+ return p1[0] === p2?.[0] && p1[1] === p2?.[1];
68
+ };
package/todo.md CHANGED
@@ -17,3 +17,4 @@ https://dawchihliou.github.io/articles/building-custom-google-maps-marker-react-
17
17
  ---
18
18
 
19
19
  2. google cityparent 要用 city 上级,目前是 country 下级
20
+ 3. 推荐点搜索是距离参数可能要优化,比如没搜到推荐点,应该扩大搜索距离