@heycar/heycars-map 0.1.9 → 0.2.1

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 (87) hide show
  1. package/README.md +30 -7
  2. package/dist/business-components/StartEndPoint/StartEndPoint.d.ts +18309 -4
  3. package/dist/components/AmapLoader/AmapLoader.d.ts +5 -20
  4. package/dist/components/AmapMarker/AmapMarker.d.ts +3 -2
  5. package/dist/components/Demo/HeycarDemo.d.ts +3 -3
  6. package/dist/components/Demo/searchResult.d.ts +1 -1
  7. package/dist/components/GmapAdvancedMarkerView/GmapAdvancedMarkerView.d.ts +3 -2
  8. package/dist/components/GmapLoader/GmapLoader.d.ts +3 -35
  9. package/dist/components/GmapMarker/GmapMarker.d.ts +3 -2
  10. package/dist/components/MapProvider/MapProvider.d.ts +4 -5
  11. package/dist/hooks/useGeoLocation.d.ts +2 -2
  12. package/dist/hooks/useMap.d.ts +801 -0
  13. package/dist/hooks/useMapAutoComplete.d.ts +4 -6
  14. package/dist/hooks/useMapCityBound.d.ts +5 -6
  15. package/dist/hooks/useMapEventSource.d.ts +5 -0
  16. package/dist/hooks/useMapFitView.d.ts +4599 -0
  17. package/dist/hooks/useMapLoader.d.ts +67 -0
  18. package/dist/hooks/useMapPlace.d.ts +4 -6
  19. package/dist/hooks/useMapRecomendPlace.d.ts +5 -797
  20. package/dist/hooks/useMapSupplier.d.ts +8 -0
  21. package/dist/hooks/useOverlay.d.ts +12 -0
  22. package/dist/hooks-business/useBusinessMapAutoComplete.d.ts +5 -5
  23. package/dist/hooks-business/useBusinessMapRecomendPlace.d.ts +4 -3
  24. package/dist/index.cjs +52 -52
  25. package/dist/index.d.ts +2 -0
  26. package/dist/index.js +1366 -1165
  27. package/dist/types/interface.d.ts +4 -0
  28. package/package.json +1 -1
  29. package/src/App.tsx +1 -1
  30. package/src/api/place.ts +0 -2
  31. package/src/business-components/AddressBox/AddressBox.tsx +1 -1
  32. package/src/business-components/AddressLocator/AddressLocator.tsx +1 -1
  33. package/src/business-components/DrivingLine/DrivingLine.tsx +1 -1
  34. package/src/business-components/DrivingRoute/DrivingRoute.tsx +2 -3
  35. package/src/business-components/PassengerCircle/PassengerCircle.tsx +1 -1
  36. package/src/business-components/PlaceCircle/PlaceCircle.tsx +1 -1
  37. package/src/business-components/StartEndPoint/StartEndPoint.tsx +23 -7
  38. package/src/business-components/TaxiCar/TaxiCar.tsx +1 -1
  39. package/src/business-components/WalkingLine/WalkingLine.tsx +1 -1
  40. package/src/business-components/WalkingRoute/WalkingRoute.tsx +2 -3
  41. package/src/business-components/WaveCircle/WaveCircle.tsx +1 -1
  42. package/src/components/Amap/Amap.ts +1 -1
  43. package/src/components/AmapInfoWindow/AmapInfoWindow.ts +1 -1
  44. package/src/components/AmapLoader/AmapLoader.ts +6 -54
  45. package/src/components/AmapMarker/AmapMarker.ts +5 -2
  46. package/src/components/AmapPolygon/AmapPolygon.ts +1 -1
  47. package/src/components/AmapPolyline/AmapPolyline.ts +1 -1
  48. package/src/components/AmapText/AmapText.ts +1 -1
  49. package/src/components/Demo/Demo.css.ts +1 -1
  50. package/src/components/Demo/HeycarDemo.tsx +50 -33
  51. package/src/components/Demo/SearchDemo.tsx +40 -65
  52. package/src/components/Demo/searchResult.ts +12888 -1
  53. package/src/components/Gmap/Gmap.ts +17 -5
  54. package/src/components/GmapAdvancedMarkerView/GmapAdvancedMarkerView.ts +9 -4
  55. package/src/components/GmapInfoWindow/GmapInfoWindow.ts +1 -1
  56. package/src/components/GmapLoader/GmapLoader.ts +4 -62
  57. package/src/components/GmapMarker/GmapMarker.ts +5 -2
  58. package/src/components/GmapPolygon/GmapPolygon.ts +1 -1
  59. package/src/components/GmapPolyline/GmapPolyline.ts +1 -1
  60. package/src/components/MapProvider/MapProvider.tsx +33 -50
  61. package/src/hooks/useDrivingRoute.ts +1 -1
  62. package/src/hooks/useGeoLocation.ts +4 -2
  63. package/src/hooks/useHeycarMap.ts +1 -1
  64. package/src/hooks/useMap.ts +29 -0
  65. package/src/hooks/useMapAngle.ts +1 -1
  66. package/src/hooks/useMapAutoComplete.ts +16 -19
  67. package/src/hooks/useMapCityBound.ts +36 -24
  68. package/src/hooks/useMapDrag.ts +1 -1
  69. package/src/hooks/useMapEventSource.ts +20 -0
  70. package/src/hooks/useMapFitView.ts +127 -0
  71. package/src/hooks/useMapLoader.ts +164 -0
  72. package/src/hooks/useMapPlace.ts +20 -22
  73. package/src/hooks/useMapRecomendPlace.ts +18 -25
  74. package/src/{components/MapProvider → hooks}/useMapSupplier.ts +4 -7
  75. package/src/hooks/useOverlay.ts +22 -0
  76. package/src/hooks/useWalkingRoute.ts +1 -1
  77. package/src/hooks-business/useBusinessMapAutoComplete.ts +13 -7
  78. package/src/hooks-business/useBusinessMapRecomendPlace.ts +10 -10
  79. package/src/index.ts +2 -0
  80. package/src/types/interface.ts +5 -0
  81. package/dist/components/Amap/useAmap.d.ts +0 -399
  82. package/dist/components/Gmap/useGmap.d.ts +0 -5
  83. package/dist/components/MapProvider/useMapSupplier.d.ts +0 -11
  84. package/dist/hooks/useMapReady.d.ts +0 -4
  85. package/src/components/Amap/useAmap.ts +0 -9
  86. package/src/components/Gmap/useGmap.ts +0 -7
  87. package/src/hooks/useMapReady.ts +0 -14
package/README.md CHANGED
@@ -97,17 +97,40 @@ npm install @heycar/heycars-map --save
97
97
  - `WalkingLine`
98
98
  - `WaveCircle`
99
99
  - `DrivingRoute`
100
+ - `WalkingRoute`
100
101
 
101
102
  目前有下列组件可以使用下列 hooks
102
103
 
103
104
  - `useBusinessMapRecomendPlace`
104
- - `useDrivingRoute`
105
- - `useGeoLocation`
106
- - `useHeycarMap`
107
- - `useMapAngle`
108
- - `useMapDrag`
109
- - `useMapPlace`
110
- - `useMapRecomendPlace`
105
+ - `useBusinessMapAutoComplete`
106
+
107
+ 目前有下列常用数据结构
108
+
109
+ ```typescript
110
+ export type Point = [number, number];
111
+
112
+ export type Place = {
113
+ lng: number;
114
+ lat: number;
115
+ name: string;
116
+ cityName?: string;
117
+ };
118
+
119
+ export interface AutoCompletePlace extends Place {
120
+ placeId?: string;
121
+ description: string;
122
+ }
123
+
124
+ export type City = {
125
+ bound?: {
126
+ east: number;
127
+ north: number;
128
+ south: number;
129
+ west: number;
130
+ };
131
+ name: string;
132
+ };
133
+ ```
111
134
 
112
135
  #### 在地图里使用 `AddressBox` ,需要放在 `HeycarMap` 内部
113
136