@lugg/maps 1.0.0-beta.0 → 1.0.0-beta.10

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 (186) hide show
  1. package/README.md +4 -1
  2. package/android/build.gradle +1 -1
  3. package/android/src/main/java/com/luggmaps/LuggCalloutView.kt +79 -0
  4. package/android/src/main/java/com/luggmaps/LuggCalloutViewManager.kt +39 -0
  5. package/android/src/main/java/com/luggmaps/LuggCircleView.kt +85 -0
  6. package/android/src/main/java/com/luggmaps/LuggCircleViewManager.kt +79 -0
  7. package/android/src/main/java/com/luggmaps/LuggGroundOverlayView.kt +81 -0
  8. package/android/src/main/java/com/luggmaps/LuggGroundOverlayViewManager.kt +82 -0
  9. package/android/src/main/java/com/luggmaps/LuggMapView.kt +49 -0
  10. package/android/src/main/java/com/luggmaps/LuggMapViewManager.kt +31 -0
  11. package/android/src/main/java/com/luggmaps/LuggMapWrapperView.kt +0 -11
  12. package/android/src/main/java/com/luggmaps/LuggMarkerView.kt +99 -51
  13. package/android/src/main/java/com/luggmaps/LuggMarkerViewManager.kt +13 -0
  14. package/android/src/main/java/com/luggmaps/LuggPackage.kt +11 -1
  15. package/android/src/main/java/com/luggmaps/LuggPolylineView.kt +1 -22
  16. package/android/src/main/java/com/luggmaps/LuggTileOverlayView.kt +92 -0
  17. package/android/src/main/java/com/luggmaps/LuggTileOverlayViewManager.kt +80 -0
  18. package/android/src/main/java/com/luggmaps/core/GoogleMapProvider.kt +628 -18
  19. package/android/src/main/java/com/luggmaps/core/MapProviderDelegate.kt +14 -0
  20. package/android/src/main/java/com/luggmaps/core/PolylineAnimator.kt +12 -7
  21. package/android/src/main/java/com/luggmaps/events/CirclePressEvent.kt +12 -0
  22. package/android/src/main/java/com/luggmaps/events/GroundOverlayPressEvent.kt +12 -0
  23. package/android/src/main/java/com/luggmaps/events/TileOverlayPressEvent.kt +12 -0
  24. package/android/src/main/java/com/luggmaps/extensions/ViewExtensions.kt +11 -0
  25. package/ios/LuggCalloutView.h +23 -0
  26. package/ios/LuggCalloutView.mm +155 -0
  27. package/ios/LuggCircleView.h +31 -0
  28. package/ios/LuggCircleView.mm +133 -0
  29. package/ios/LuggGroundOverlayView.h +30 -0
  30. package/ios/LuggGroundOverlayView.mm +125 -0
  31. package/ios/LuggMapView.mm +84 -2
  32. package/ios/LuggMarkerView.h +5 -0
  33. package/ios/LuggMarkerView.mm +40 -2
  34. package/ios/LuggTileOverlayView.h +31 -0
  35. package/ios/LuggTileOverlayView.mm +130 -0
  36. package/ios/core/AppleMapProvider.mm +838 -34
  37. package/ios/core/GMSPolylineAnimator.m +6 -3
  38. package/ios/core/GoogleMapProvider.mm +506 -19
  39. package/ios/core/LuggAnnotationView.h +12 -0
  40. package/ios/core/LuggAnnotationView.mm +55 -0
  41. package/ios/core/MapProviderDelegate.h +20 -1
  42. package/ios/events/CirclePressEvent.h +20 -0
  43. package/ios/events/GroundOverlayPressEvent.h +20 -0
  44. package/ios/events/TileOverlayPressEvent.h +20 -0
  45. package/lib/module/MapProvider.web.js +7 -2
  46. package/lib/module/MapProvider.web.js.map +1 -1
  47. package/lib/module/MapView.js +12 -1
  48. package/lib/module/MapView.js.map +1 -1
  49. package/lib/module/MapView.web.js +36 -20
  50. package/lib/module/MapView.web.js.map +1 -1
  51. package/lib/module/components/Circle.js +46 -0
  52. package/lib/module/components/Circle.js.map +1 -0
  53. package/lib/module/components/Circle.types.js +4 -0
  54. package/lib/module/components/Circle.types.js.map +1 -0
  55. package/lib/module/components/Circle.web.js +79 -0
  56. package/lib/module/components/Circle.web.js.map +1 -0
  57. package/lib/module/components/GeoJson.js +3 -3
  58. package/lib/module/components/GeoJson.js.map +1 -1
  59. package/lib/module/components/GroundOverlay.js +45 -0
  60. package/lib/module/components/GroundOverlay.js.map +1 -0
  61. package/lib/module/components/GroundOverlay.types.js +4 -0
  62. package/lib/module/components/GroundOverlay.types.js.map +1 -0
  63. package/lib/module/components/GroundOverlay.web.js +77 -0
  64. package/lib/module/components/GroundOverlay.web.js.map +1 -0
  65. package/lib/module/components/Marker.js +41 -6
  66. package/lib/module/components/Marker.js.map +1 -1
  67. package/lib/module/components/Marker.web.js +103 -26
  68. package/lib/module/components/Marker.web.js.map +1 -1
  69. package/lib/module/components/Polygon.web.js +3 -3
  70. package/lib/module/components/Polygon.web.js.map +1 -1
  71. package/lib/module/components/Polyline.web.js +6 -12
  72. package/lib/module/components/Polyline.web.js.map +1 -1
  73. package/lib/module/components/TileOverlay.js +44 -0
  74. package/lib/module/components/TileOverlay.js.map +1 -0
  75. package/lib/module/components/TileOverlay.types.js +4 -0
  76. package/lib/module/components/TileOverlay.types.js.map +1 -0
  77. package/lib/module/components/TileOverlay.web.js +69 -0
  78. package/lib/module/components/TileOverlay.web.js.map +1 -0
  79. package/lib/module/components/index.js +3 -0
  80. package/lib/module/components/index.js.map +1 -1
  81. package/lib/module/components/index.web.js +3 -0
  82. package/lib/module/components/index.web.js.map +1 -1
  83. package/lib/module/fabric/LuggCalloutViewNativeComponent.ts +20 -0
  84. package/lib/module/fabric/LuggCircleViewNativeComponent.ts +25 -0
  85. package/lib/module/fabric/LuggGroundOverlayViewNativeComponent.ts +29 -0
  86. package/lib/module/fabric/LuggMapViewNativeComponent.ts +13 -5
  87. package/lib/module/fabric/LuggMarkerViewNativeComponent.ts +14 -2
  88. package/lib/module/fabric/LuggTileOverlayViewNativeComponent.ts +30 -0
  89. package/lib/module/index.js +3 -0
  90. package/lib/module/index.js.map +1 -1
  91. package/lib/module/index.web.js +3 -0
  92. package/lib/module/index.web.js.map +1 -1
  93. package/lib/typescript/src/MapProvider.web.d.ts +9 -2
  94. package/lib/typescript/src/MapProvider.web.d.ts.map +1 -1
  95. package/lib/typescript/src/MapView.d.ts +1 -1
  96. package/lib/typescript/src/MapView.d.ts.map +1 -1
  97. package/lib/typescript/src/MapView.types.d.ts +36 -1
  98. package/lib/typescript/src/MapView.types.d.ts.map +1 -1
  99. package/lib/typescript/src/MapView.web.d.ts +1 -1
  100. package/lib/typescript/src/MapView.web.d.ts.map +1 -1
  101. package/lib/typescript/src/components/Circle.d.ts +10 -0
  102. package/lib/typescript/src/components/Circle.d.ts.map +1 -0
  103. package/lib/typescript/src/components/Circle.types.d.ts +33 -0
  104. package/lib/typescript/src/components/Circle.types.d.ts.map +1 -0
  105. package/lib/typescript/src/components/Circle.web.d.ts +3 -0
  106. package/lib/typescript/src/components/Circle.web.d.ts.map +1 -0
  107. package/lib/typescript/src/components/GeoJson.d.ts +2 -1
  108. package/lib/typescript/src/components/GeoJson.d.ts.map +1 -1
  109. package/lib/typescript/src/components/GeoJson.types.d.ts +11 -1
  110. package/lib/typescript/src/components/GeoJson.types.d.ts.map +1 -1
  111. package/lib/typescript/src/components/GroundOverlay.d.ts +10 -0
  112. package/lib/typescript/src/components/GroundOverlay.d.ts.map +1 -0
  113. package/lib/typescript/src/components/GroundOverlay.types.d.ts +35 -0
  114. package/lib/typescript/src/components/GroundOverlay.types.d.ts.map +1 -0
  115. package/lib/typescript/src/components/GroundOverlay.web.d.ts +3 -0
  116. package/lib/typescript/src/components/GroundOverlay.web.d.ts.map +1 -0
  117. package/lib/typescript/src/components/Marker.d.ts +6 -3
  118. package/lib/typescript/src/components/Marker.d.ts.map +1 -1
  119. package/lib/typescript/src/components/Marker.types.d.ts +40 -2
  120. package/lib/typescript/src/components/Marker.types.d.ts.map +1 -1
  121. package/lib/typescript/src/components/Marker.web.d.ts +3 -2
  122. package/lib/typescript/src/components/Marker.web.d.ts.map +1 -1
  123. package/lib/typescript/src/components/Polygon.web.d.ts +1 -1
  124. package/lib/typescript/src/components/Polygon.web.d.ts.map +1 -1
  125. package/lib/typescript/src/components/Polyline.web.d.ts +1 -1
  126. package/lib/typescript/src/components/Polyline.web.d.ts.map +1 -1
  127. package/lib/typescript/src/components/TileOverlay.d.ts +10 -0
  128. package/lib/typescript/src/components/TileOverlay.d.ts.map +1 -0
  129. package/lib/typescript/src/components/TileOverlay.types.d.ts +36 -0
  130. package/lib/typescript/src/components/TileOverlay.types.d.ts.map +1 -0
  131. package/lib/typescript/src/components/TileOverlay.web.d.ts +3 -0
  132. package/lib/typescript/src/components/TileOverlay.web.d.ts.map +1 -0
  133. package/lib/typescript/src/components/index.d.ts +7 -1
  134. package/lib/typescript/src/components/index.d.ts.map +1 -1
  135. package/lib/typescript/src/components/index.web.d.ts +7 -1
  136. package/lib/typescript/src/components/index.web.d.ts.map +1 -1
  137. package/lib/typescript/src/fabric/LuggCalloutViewNativeComponent.d.ts +13 -0
  138. package/lib/typescript/src/fabric/LuggCalloutViewNativeComponent.d.ts.map +1 -0
  139. package/lib/typescript/src/fabric/LuggCircleViewNativeComponent.d.ts +18 -0
  140. package/lib/typescript/src/fabric/LuggCircleViewNativeComponent.d.ts.map +1 -0
  141. package/lib/typescript/src/fabric/LuggGroundOverlayViewNativeComponent.d.ts +21 -0
  142. package/lib/typescript/src/fabric/LuggGroundOverlayViewNativeComponent.d.ts.map +1 -0
  143. package/lib/typescript/src/fabric/LuggMapViewNativeComponent.d.ts +10 -5
  144. package/lib/typescript/src/fabric/LuggMapViewNativeComponent.d.ts.map +1 -1
  145. package/lib/typescript/src/fabric/LuggMarkerViewNativeComponent.d.ts +8 -1
  146. package/lib/typescript/src/fabric/LuggMarkerViewNativeComponent.d.ts.map +1 -1
  147. package/lib/typescript/src/fabric/LuggTileOverlayViewNativeComponent.d.ts +21 -0
  148. package/lib/typescript/src/fabric/LuggTileOverlayViewNativeComponent.d.ts.map +1 -0
  149. package/lib/typescript/src/index.d.ts +10 -4
  150. package/lib/typescript/src/index.d.ts.map +1 -1
  151. package/lib/typescript/src/index.web.d.ts +9 -3
  152. package/lib/typescript/src/index.web.d.ts.map +1 -1
  153. package/lib/typescript/src/types.d.ts +0 -4
  154. package/lib/typescript/src/types.d.ts.map +1 -1
  155. package/package.json +6 -2
  156. package/src/MapProvider.web.tsx +15 -3
  157. package/src/MapView.tsx +12 -1
  158. package/src/MapView.types.ts +118 -1
  159. package/src/MapView.web.tsx +379 -322
  160. package/src/components/Circle.tsx +52 -0
  161. package/src/components/Circle.types.ts +33 -0
  162. package/src/components/Circle.web.tsx +95 -0
  163. package/src/components/GeoJson.tsx +3 -3
  164. package/src/components/GeoJson.types.ts +12 -1
  165. package/src/components/GroundOverlay.tsx +47 -0
  166. package/src/components/GroundOverlay.types.ts +36 -0
  167. package/src/components/GroundOverlay.web.tsx +81 -0
  168. package/src/components/Marker.tsx +59 -5
  169. package/src/components/Marker.types.ts +42 -2
  170. package/src/components/Marker.web.tsx +235 -99
  171. package/src/components/Polygon.web.tsx +93 -89
  172. package/src/components/Polyline.web.tsx +235 -235
  173. package/src/components/TileOverlay.tsx +44 -0
  174. package/src/components/TileOverlay.types.ts +37 -0
  175. package/src/components/TileOverlay.web.tsx +97 -0
  176. package/src/components/index.ts +11 -0
  177. package/src/components/index.web.ts +10 -1
  178. package/src/fabric/LuggCalloutViewNativeComponent.ts +20 -0
  179. package/src/fabric/LuggCircleViewNativeComponent.ts +25 -0
  180. package/src/fabric/LuggGroundOverlayViewNativeComponent.ts +29 -0
  181. package/src/fabric/LuggMapViewNativeComponent.ts +13 -5
  182. package/src/fabric/LuggMarkerViewNativeComponent.ts +14 -2
  183. package/src/fabric/LuggTileOverlayViewNativeComponent.ts +30 -0
  184. package/src/index.ts +14 -1
  185. package/src/index.web.ts +17 -1
  186. package/src/types.ts +0 -5
@@ -2,14 +2,20 @@ export { MapView } from './MapView.web';
2
2
  export { MapProvider } from './MapProvider.web';
3
3
  export type { MapProviderProps } from './MapProvider.types';
4
4
  export { Marker } from './components/index.web';
5
- export type { MarkerProps } from './components/index.web';
5
+ export type { CalloutOptions, MarkerProps } from './components/index.web';
6
6
  export { Polygon } from './components/index.web';
7
7
  export type { PolygonProps } from './components/index.web';
8
+ export { Circle } from './components/index.web';
9
+ export type { CircleProps } from './components/index.web';
8
10
  export { Polyline } from './components/index.web';
9
11
  export type { PolylineProps } from './components/index.web';
10
12
  export { GeoJson } from './components/index.web';
11
13
  export type { GeoJsonProps } from './components/index.web';
12
- export type { MapViewProps, MapViewRef, MoveCameraOptions, FitCoordinatesOptions, CameraEventPayload, } from './MapView.types';
14
+ export { GroundOverlay } from './components/index.web';
15
+ export type { GroundOverlayProps, GroundOverlayBounds, } from './components/index.web';
16
+ export { TileOverlay } from './components/index.web';
17
+ export type { TileOverlayProps, TileOverlayBounds, } from './components/index.web';
18
+ export type { MapViewProps, MapViewRef, MoveCameraOptions, FitCoordinatesOptions, CameraEventPayload, MapType, PoiCategory, PoiFilter, } from './MapView.types';
13
19
  export type { MapProvider as MapProviderType, Coordinate, Point, EdgeInsets, } from './types';
14
- export type { GeoJSON, Feature, FeatureCollection, Geometry, Position, } from './components/GeoJson.types';
20
+ export type { GeoJSON, Feature, FeatureCollection, FeatureProperties, Geometry, Position, } from './components/GeoJson.types';
15
21
  //# sourceMappingURL=index.web.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../src/index.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,YAAY,EACV,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,WAAW,IAAI,eAAe,EAC9B,UAAU,EACV,KAAK,EACL,UAAU,GACX,MAAM,SAAS,CAAC;AACjB,YAAY,EACV,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,QAAQ,EACR,QAAQ,GACT,MAAM,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../src/index.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,YAAY,EACV,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,YAAY,EACV,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACV,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,OAAO,EACP,WAAW,EACX,SAAS,GACV,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,WAAW,IAAI,eAAe,EAC9B,UAAU,EACV,KAAK,EACL,UAAU,GACX,MAAM,SAAS,CAAC;AACjB,YAAY,EACV,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,iBAAiB,EACjB,QAAQ,EACR,QAAQ,GACT,MAAM,4BAA4B,CAAC"}
@@ -25,10 +25,6 @@ export interface EdgeInsets {
25
25
  bottom: number;
26
26
  right: number;
27
27
  }
28
- /**
29
- * Map theme
30
- */
31
- export type MapTheme = 'light' | 'dark' | 'system';
32
28
  /**
33
29
  * Press event payload
34
30
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,EAAE,KAAK,CAAC;CACd"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,EAAE,KAAK,CAAC;CACd"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lugg/maps",
3
- "version": "1.0.0-beta.0",
3
+ "version": "1.0.0-beta.10",
4
4
  "description": "Universal maps for React Native.",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -147,9 +147,13 @@
147
147
  "componentProvider": {
148
148
  "LuggMapView": "LuggMapView",
149
149
  "LuggMarkerView": "LuggMarkerView",
150
+ "LuggCalloutView": "LuggCalloutView",
150
151
  "LuggMapWrapperView": "LuggMapWrapperView",
151
152
  "LuggPolylineView": "LuggPolylineView",
152
- "LuggPolygonView": "LuggPolygonView"
153
+ "LuggPolygonView": "LuggPolygonView",
154
+ "LuggCircleView": "LuggCircleView",
155
+ "LuggGroundOverlayView": "LuggGroundOverlayView",
156
+ "LuggTileOverlayView": "LuggTileOverlayView"
153
157
  }
154
158
  }
155
159
  },
@@ -1,12 +1,24 @@
1
- import { createContext, useContext } from 'react';
1
+ import { createContext, useContext, type MutableRefObject } from 'react';
2
2
  import { APIProvider } from '@vis.gl/react-google-maps';
3
3
  import type { MapProviderProps } from './MapProvider.types';
4
4
 
5
+ type CalloutCloseListener = () => void;
6
+
7
+ const defaultDraggingRef = { current: false };
8
+
5
9
  export const MapContext = createContext<{
6
10
  map: google.maps.Map | null;
7
- isDragging: boolean;
11
+ isDraggingRef: MutableRefObject<boolean>;
8
12
  moveCamera: (coordinate: { latitude: number; longitude: number }) => void;
9
- }>({ map: null, isDragging: false, moveCamera: () => {} });
13
+ onCalloutClose: (listener: CalloutCloseListener) => () => void;
14
+ closeCallouts: (except?: CalloutCloseListener) => void;
15
+ }>({
16
+ map: null,
17
+ isDraggingRef: defaultDraggingRef,
18
+ moveCamera: () => {},
19
+ onCalloutClose: () => () => {},
20
+ closeCallouts: () => {},
21
+ });
10
22
 
11
23
  export const useMapContext = () => useContext(MapContext);
12
24
 
package/src/MapView.tsx CHANGED
@@ -14,16 +14,18 @@ import type {
14
14
  import type { Coordinate, EdgeInsets } from './types';
15
15
 
16
16
  export class MapView
17
- extends React.Component<MapViewProps>
17
+ extends React.PureComponent<MapViewProps>
18
18
  implements MapViewRef
19
19
  {
20
20
  static defaultProps: Partial<MapViewProps> = {
21
21
  provider: Platform.OS === 'ios' ? 'apple' : 'google',
22
+ mapType: 'standard',
22
23
  initialZoom: 10,
23
24
  zoomEnabled: true,
24
25
  scrollEnabled: true,
25
26
  rotateEnabled: true,
26
27
  pitchEnabled: true,
28
+ poiEnabled: true,
27
29
  theme: 'system',
28
30
  };
29
31
 
@@ -80,6 +82,7 @@ export class MapView
80
82
  render() {
81
83
  const {
82
84
  provider,
85
+ mapType,
83
86
  mapId,
84
87
  initialCoordinate,
85
88
  initialZoom,
@@ -92,7 +95,10 @@ export class MapView
92
95
  edgeInsets,
93
96
  userLocationEnabled,
94
97
  userLocationButtonEnabled,
98
+ poiEnabled,
99
+ poiFilter,
95
100
  theme,
101
+ insetAdjustment,
96
102
  onPress,
97
103
  onLongPress,
98
104
  onCameraMove,
@@ -107,6 +113,7 @@ export class MapView
107
113
  ref={this.nativeRef}
108
114
  {...rest}
109
115
  provider={provider}
116
+ mapType={mapType}
110
117
  mapId={mapId}
111
118
  initialCoordinate={initialCoordinate}
112
119
  initialZoom={initialZoom}
@@ -119,7 +126,11 @@ export class MapView
119
126
  edgeInsets={edgeInsets}
120
127
  userLocationEnabled={userLocationEnabled}
121
128
  userLocationButtonEnabled={userLocationButtonEnabled}
129
+ poiEnabled={poiEnabled}
130
+ poiFilterMode={poiFilter?.mode}
131
+ poiFilterCategories={poiFilter?.categories}
122
132
  theme={theme}
133
+ insetAdjustment={insetAdjustment}
123
134
  onMapPress={onPress}
124
135
  onMapLongPress={onLongPress}
125
136
  onCameraMove={onCameraMove}
@@ -4,10 +4,104 @@ import type {
4
4
  MapProvider,
5
5
  Coordinate,
6
6
  EdgeInsets,
7
- MapTheme,
8
7
  PressEventPayload,
9
8
  } from './types';
10
9
 
10
+ export type MapType =
11
+ | 'standard'
12
+ | 'satellite'
13
+ | 'terrain'
14
+ | 'hybrid'
15
+ | 'muted-standard';
16
+
17
+ export type MapTheme = 'light' | 'dark' | 'system';
18
+
19
+ export type InsetAdjustment = 'automatic' | 'never';
20
+
21
+ export type PoiCategory =
22
+ | 'airport'
23
+ | 'amusement-park'
24
+ | 'animal-service'
25
+ | 'aquarium'
26
+ | 'atm'
27
+ | 'automotive-repair'
28
+ | 'bakery'
29
+ | 'bank'
30
+ | 'baseball'
31
+ | 'basketball'
32
+ | 'beach'
33
+ | 'beauty'
34
+ | 'bowling'
35
+ | 'brewery'
36
+ | 'cafe'
37
+ | 'campground'
38
+ | 'car-rental'
39
+ | 'castle'
40
+ | 'convention-center'
41
+ | 'distillery'
42
+ | 'ev-charger'
43
+ | 'fairground'
44
+ | 'fire-station'
45
+ | 'fishing'
46
+ | 'fitness-center'
47
+ | 'food-market'
48
+ | 'fortress'
49
+ | 'gas-station'
50
+ | 'go-kart'
51
+ | 'golf'
52
+ | 'hiking'
53
+ | 'hospital'
54
+ | 'hotel'
55
+ | 'kayaking'
56
+ | 'landmark'
57
+ | 'laundry'
58
+ | 'library'
59
+ | 'mailbox'
60
+ | 'marina'
61
+ | 'mini-golf'
62
+ | 'movie-theater'
63
+ | 'museum'
64
+ | 'music-venue'
65
+ | 'national-monument'
66
+ | 'national-park'
67
+ | 'nightlife'
68
+ | 'park'
69
+ | 'parking'
70
+ | 'pharmacy'
71
+ | 'planetarium'
72
+ | 'police'
73
+ | 'post-office'
74
+ | 'public-transport'
75
+ | 'restaurant'
76
+ | 'restroom'
77
+ | 'rock-climbing'
78
+ | 'rv-park'
79
+ | 'school'
80
+ | 'skate-park'
81
+ | 'skating'
82
+ | 'skiing'
83
+ | 'soccer'
84
+ | 'spa'
85
+ | 'stadium'
86
+ | 'store'
87
+ | 'surfing'
88
+ | 'swimming'
89
+ | 'tennis'
90
+ | 'theater'
91
+ | 'university'
92
+ | 'volleyball'
93
+ | 'winery'
94
+ | 'zoo';
95
+
96
+ export interface PoiFilter {
97
+ /**
98
+ * Filter mode
99
+ * @default 'including'
100
+ */
101
+ mode?: 'including' | 'excluding';
102
+ categories: PoiCategory[];
103
+ }
104
+
11
105
  /**
12
106
  * Options for moving the camera
13
107
  */
@@ -64,6 +158,11 @@ export interface MapViewProps extends ViewProps {
64
158
  * @default 'apple' on iOS, 'google' on Android
65
159
  */
66
160
  provider?: MapProvider;
161
+ /**
162
+ * Map type to display
163
+ * @default 'standard'
164
+ */
165
+ mapType?: MapType;
67
166
  /**
68
167
  * Map style ID (Google Maps) or configuration name (Apple Maps)
69
168
  */
@@ -121,11 +220,29 @@ export interface MapViewProps extends ViewProps {
121
220
  * @platform android
122
221
  */
123
222
  userLocationButtonEnabled?: boolean;
223
+ /**
224
+ * Show points of interest on the map (Apple Maps only).
225
+ * When false, hides all POIs regardless of poiFilter.
226
+ * @default true
227
+ * @platform ios
228
+ */
229
+ poiEnabled?: boolean;
230
+ /**
231
+ * Filter POI categories to show or hide (Apple Maps only).
232
+ * Only takes effect when poiEnabled is true.
233
+ * @platform ios
234
+ */
235
+ poiFilter?: PoiFilter;
124
236
  /**
125
237
  * Map color theme
126
238
  * @default 'system'
127
239
  */
128
240
  theme?: MapTheme;
241
+ /**
242
+ * Safe area inset adjustment behavior
243
+ * @default 'never'
244
+ */
245
+ insetAdjustment?: InsetAdjustment;
129
246
  /**
130
247
  * Called when the map is pressed
131
248
  */