@lugg/maps 1.0.0-beta.2 → 1.0.0-beta.20

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 (206) hide show
  1. package/README.md +3 -0
  2. package/android/src/main/java/com/luggmaps/LuggCalloutView.kt +9 -2
  3. package/android/src/main/java/com/luggmaps/LuggCalloutViewManager.kt +4 -3
  4. package/android/src/main/java/com/luggmaps/LuggCircleView.kt +85 -0
  5. package/android/src/main/java/com/luggmaps/LuggCircleViewManager.kt +79 -0
  6. package/android/src/main/java/com/luggmaps/LuggGroundOverlayView.kt +81 -0
  7. package/android/src/main/java/com/luggmaps/LuggGroundOverlayViewManager.kt +82 -0
  8. package/android/src/main/java/com/luggmaps/LuggMapView.kt +90 -0
  9. package/android/src/main/java/com/luggmaps/LuggMapViewManager.kt +45 -0
  10. package/android/src/main/java/com/luggmaps/LuggMapWrapperView.kt +27 -2
  11. package/android/src/main/java/com/luggmaps/LuggMarkerView.kt +30 -2
  12. package/android/src/main/java/com/luggmaps/LuggMarkerViewManager.kt +13 -0
  13. package/android/src/main/java/com/luggmaps/LuggPackage.kt +4 -1
  14. package/android/src/main/java/com/luggmaps/LuggPolylineView.kt +3 -23
  15. package/android/src/main/java/com/luggmaps/LuggTileOverlayView.kt +92 -0
  16. package/android/src/main/java/com/luggmaps/LuggTileOverlayViewManager.kt +80 -0
  17. package/android/src/main/java/com/luggmaps/core/GoogleMapProvider.kt +676 -36
  18. package/android/src/main/java/com/luggmaps/core/MapProviderDelegate.kt +15 -0
  19. package/android/src/main/java/com/luggmaps/core/PolylineAnimator.kt +65 -11
  20. package/android/src/main/java/com/luggmaps/events/CirclePressEvent.kt +12 -0
  21. package/android/src/main/java/com/luggmaps/events/GroundOverlayPressEvent.kt +12 -0
  22. package/android/src/main/java/com/luggmaps/events/TileOverlayPressEvent.kt +12 -0
  23. package/android/src/main/java/com/luggmaps/extensions/ViewExtensions.kt +11 -0
  24. package/ios/LuggCalloutView.h +1 -1
  25. package/ios/LuggCalloutView.mm +21 -11
  26. package/ios/LuggCircleView.h +31 -0
  27. package/ios/LuggCircleView.mm +133 -0
  28. package/ios/LuggGroundOverlayView.h +30 -0
  29. package/ios/LuggGroundOverlayView.mm +125 -0
  30. package/ios/LuggMapView.mm +254 -4
  31. package/ios/LuggMapWrapperView.h +5 -0
  32. package/ios/LuggMapWrapperView.mm +18 -0
  33. package/ios/LuggMarkerView.h +3 -0
  34. package/ios/LuggMarkerView.mm +25 -0
  35. package/ios/LuggTileOverlayView.h +31 -0
  36. package/ios/LuggTileOverlayView.mm +130 -0
  37. package/ios/core/AppleMapProvider.h +8 -0
  38. package/ios/core/AppleMapProvider.mm +663 -29
  39. package/ios/core/AppleStaticMapProvider.h +14 -0
  40. package/ios/core/AppleStaticMapProvider.mm +159 -0
  41. package/ios/core/GMSPolylineAnimator.m +46 -18
  42. package/ios/core/GoogleMapProvider.h +10 -0
  43. package/ios/core/GoogleMapProvider.mm +430 -51
  44. package/ios/core/GoogleStaticMapProvider.h +21 -0
  45. package/ios/core/GoogleStaticMapProvider.mm +213 -0
  46. package/ios/core/MKPolylineAnimator.m +67 -43
  47. package/ios/core/MapProviderDelegate.h +27 -1
  48. package/ios/core/StaticMapProviderBase.h +75 -0
  49. package/ios/core/StaticMapProviderBase.mm +845 -0
  50. package/ios/events/CameraIdleEvent.h +4 -2
  51. package/ios/events/CameraMoveEvent.h +4 -2
  52. package/ios/events/CirclePressEvent.h +22 -0
  53. package/ios/events/GroundOverlayPressEvent.h +22 -0
  54. package/ios/events/LongPressEvent.h +4 -2
  55. package/ios/events/MarkerDragEvent.h +12 -6
  56. package/ios/events/MarkerPressEvent.h +4 -2
  57. package/ios/events/PolygonPressEvent.h +4 -2
  58. package/ios/events/PressEvent.h +4 -2
  59. package/ios/events/ReadyEvent.h +4 -2
  60. package/ios/events/TileOverlayPressEvent.h +22 -0
  61. package/ios/extensions/MKMapView+Zoom.h +20 -0
  62. package/ios/extensions/MKMapView+Zoom.m +28 -18
  63. package/ios/extensions/UIView+Snapshot.h +16 -0
  64. package/ios/extensions/UIView+Snapshot.m +27 -0
  65. package/lib/module/MapProvider.web.js +4 -1
  66. package/lib/module/MapProvider.web.js.map +1 -1
  67. package/lib/module/MapView.js +19 -1
  68. package/lib/module/MapView.js.map +1 -1
  69. package/lib/module/MapView.web.js +30 -22
  70. package/lib/module/MapView.web.js.map +1 -1
  71. package/lib/module/components/Circle.js +46 -0
  72. package/lib/module/components/Circle.js.map +1 -0
  73. package/lib/module/components/Circle.types.js +4 -0
  74. package/lib/module/components/Circle.types.js.map +1 -0
  75. package/lib/module/components/Circle.web.js +79 -0
  76. package/lib/module/components/Circle.web.js.map +1 -0
  77. package/lib/module/components/GeoJson.js +3 -3
  78. package/lib/module/components/GeoJson.js.map +1 -1
  79. package/lib/module/components/GroundOverlay.js +45 -0
  80. package/lib/module/components/GroundOverlay.js.map +1 -0
  81. package/lib/module/components/GroundOverlay.types.js +4 -0
  82. package/lib/module/components/GroundOverlay.types.js.map +1 -0
  83. package/lib/module/components/GroundOverlay.web.js +77 -0
  84. package/lib/module/components/GroundOverlay.web.js.map +1 -0
  85. package/lib/module/components/Marker.js +22 -4
  86. package/lib/module/components/Marker.js.map +1 -1
  87. package/lib/module/components/Marker.web.js +23 -10
  88. package/lib/module/components/Marker.web.js.map +1 -1
  89. package/lib/module/components/Polygon.web.js +3 -3
  90. package/lib/module/components/Polygon.web.js.map +1 -1
  91. package/lib/module/components/Polyline.web.js +6 -12
  92. package/lib/module/components/Polyline.web.js.map +1 -1
  93. package/lib/module/components/TileOverlay.js +44 -0
  94. package/lib/module/components/TileOverlay.js.map +1 -0
  95. package/lib/module/components/TileOverlay.types.js +4 -0
  96. package/lib/module/components/TileOverlay.types.js.map +1 -0
  97. package/lib/module/components/TileOverlay.web.js +69 -0
  98. package/lib/module/components/TileOverlay.web.js.map +1 -0
  99. package/lib/module/components/index.js +3 -0
  100. package/lib/module/components/index.js.map +1 -1
  101. package/lib/module/components/index.web.js +3 -0
  102. package/lib/module/components/index.web.js.map +1 -1
  103. package/lib/module/fabric/LuggCalloutViewNativeComponent.ts +1 -1
  104. package/lib/module/fabric/LuggCircleViewNativeComponent.ts +25 -0
  105. package/lib/module/fabric/LuggGroundOverlayViewNativeComponent.ts +29 -0
  106. package/lib/module/fabric/LuggMapViewNativeComponent.ts +16 -5
  107. package/lib/module/fabric/LuggMarkerViewNativeComponent.ts +14 -2
  108. package/lib/module/fabric/LuggTileOverlayViewNativeComponent.ts +30 -0
  109. package/lib/module/index.js +3 -0
  110. package/lib/module/index.js.map +1 -1
  111. package/lib/module/index.web.js +3 -0
  112. package/lib/module/index.web.js.map +1 -1
  113. package/lib/typescript/src/MapProvider.web.d.ts +3 -2
  114. package/lib/typescript/src/MapProvider.web.d.ts.map +1 -1
  115. package/lib/typescript/src/MapView.d.ts +1 -1
  116. package/lib/typescript/src/MapView.d.ts.map +1 -1
  117. package/lib/typescript/src/MapView.types.d.ts +60 -1
  118. package/lib/typescript/src/MapView.types.d.ts.map +1 -1
  119. package/lib/typescript/src/MapView.web.d.ts +1 -1
  120. package/lib/typescript/src/MapView.web.d.ts.map +1 -1
  121. package/lib/typescript/src/components/Circle.d.ts +10 -0
  122. package/lib/typescript/src/components/Circle.d.ts.map +1 -0
  123. package/lib/typescript/src/components/Circle.types.d.ts +33 -0
  124. package/lib/typescript/src/components/Circle.types.d.ts.map +1 -0
  125. package/lib/typescript/src/components/Circle.web.d.ts +3 -0
  126. package/lib/typescript/src/components/Circle.web.d.ts.map +1 -0
  127. package/lib/typescript/src/components/GeoJson.d.ts +2 -1
  128. package/lib/typescript/src/components/GeoJson.d.ts.map +1 -1
  129. package/lib/typescript/src/components/GroundOverlay.d.ts +10 -0
  130. package/lib/typescript/src/components/GroundOverlay.d.ts.map +1 -0
  131. package/lib/typescript/src/components/GroundOverlay.types.d.ts +35 -0
  132. package/lib/typescript/src/components/GroundOverlay.types.d.ts.map +1 -0
  133. package/lib/typescript/src/components/GroundOverlay.web.d.ts +3 -0
  134. package/lib/typescript/src/components/GroundOverlay.web.d.ts.map +1 -0
  135. package/lib/typescript/src/components/Marker.d.ts +6 -3
  136. package/lib/typescript/src/components/Marker.d.ts.map +1 -1
  137. package/lib/typescript/src/components/Marker.types.d.ts +18 -6
  138. package/lib/typescript/src/components/Marker.types.d.ts.map +1 -1
  139. package/lib/typescript/src/components/Marker.web.d.ts +3 -2
  140. package/lib/typescript/src/components/Marker.web.d.ts.map +1 -1
  141. package/lib/typescript/src/components/Polygon.web.d.ts +1 -1
  142. package/lib/typescript/src/components/Polygon.web.d.ts.map +1 -1
  143. package/lib/typescript/src/components/Polyline.web.d.ts +1 -1
  144. package/lib/typescript/src/components/Polyline.web.d.ts.map +1 -1
  145. package/lib/typescript/src/components/TileOverlay.d.ts +10 -0
  146. package/lib/typescript/src/components/TileOverlay.d.ts.map +1 -0
  147. package/lib/typescript/src/components/TileOverlay.types.d.ts +36 -0
  148. package/lib/typescript/src/components/TileOverlay.types.d.ts.map +1 -0
  149. package/lib/typescript/src/components/TileOverlay.web.d.ts +3 -0
  150. package/lib/typescript/src/components/TileOverlay.web.d.ts.map +1 -0
  151. package/lib/typescript/src/components/index.d.ts +7 -1
  152. package/lib/typescript/src/components/index.d.ts.map +1 -1
  153. package/lib/typescript/src/components/index.web.d.ts +6 -0
  154. package/lib/typescript/src/components/index.web.d.ts.map +1 -1
  155. package/lib/typescript/src/fabric/LuggCalloutViewNativeComponent.d.ts +1 -1
  156. package/lib/typescript/src/fabric/LuggCircleViewNativeComponent.d.ts +18 -0
  157. package/lib/typescript/src/fabric/LuggCircleViewNativeComponent.d.ts.map +1 -0
  158. package/lib/typescript/src/fabric/LuggGroundOverlayViewNativeComponent.d.ts +21 -0
  159. package/lib/typescript/src/fabric/LuggGroundOverlayViewNativeComponent.d.ts.map +1 -0
  160. package/lib/typescript/src/fabric/LuggMapViewNativeComponent.d.ts +13 -5
  161. package/lib/typescript/src/fabric/LuggMapViewNativeComponent.d.ts.map +1 -1
  162. package/lib/typescript/src/fabric/LuggMarkerViewNativeComponent.d.ts +8 -1
  163. package/lib/typescript/src/fabric/LuggMarkerViewNativeComponent.d.ts.map +1 -1
  164. package/lib/typescript/src/fabric/LuggTileOverlayViewNativeComponent.d.ts +21 -0
  165. package/lib/typescript/src/fabric/LuggTileOverlayViewNativeComponent.d.ts.map +1 -0
  166. package/lib/typescript/src/index.d.ts +9 -3
  167. package/lib/typescript/src/index.d.ts.map +1 -1
  168. package/lib/typescript/src/index.web.d.ts +7 -1
  169. package/lib/typescript/src/index.web.d.ts.map +1 -1
  170. package/lib/typescript/src/types.d.ts +0 -4
  171. package/lib/typescript/src/types.d.ts.map +1 -1
  172. package/package.json +17 -11
  173. package/src/MapProvider.web.tsx +5 -3
  174. package/src/MapView.tsx +19 -1
  175. package/src/MapView.types.ts +142 -1
  176. package/src/MapView.web.tsx +379 -340
  177. package/src/components/Circle.tsx +52 -0
  178. package/src/components/Circle.types.ts +33 -0
  179. package/src/components/Circle.web.tsx +95 -0
  180. package/src/components/GeoJson.tsx +3 -3
  181. package/src/components/GroundOverlay.tsx +47 -0
  182. package/src/components/GroundOverlay.types.ts +36 -0
  183. package/src/components/GroundOverlay.web.tsx +81 -0
  184. package/src/components/Marker.tsx +32 -6
  185. package/src/components/Marker.types.ts +19 -6
  186. package/src/components/Marker.web.tsx +196 -150
  187. package/src/components/Polygon.web.tsx +93 -89
  188. package/src/components/Polyline.web.tsx +235 -235
  189. package/src/components/TileOverlay.tsx +44 -0
  190. package/src/components/TileOverlay.types.ts +37 -0
  191. package/src/components/TileOverlay.web.tsx +97 -0
  192. package/src/components/index.ts +10 -0
  193. package/src/components/index.web.ts +9 -0
  194. package/src/fabric/LuggCalloutViewNativeComponent.ts +1 -1
  195. package/src/fabric/LuggCircleViewNativeComponent.ts +25 -0
  196. package/src/fabric/LuggGroundOverlayViewNativeComponent.ts +29 -0
  197. package/src/fabric/LuggMapViewNativeComponent.ts +16 -5
  198. package/src/fabric/LuggMarkerViewNativeComponent.ts +14 -2
  199. package/src/fabric/LuggTileOverlayViewNativeComponent.ts +30 -0
  200. package/src/index.ts +12 -1
  201. package/src/index.web.ts +15 -0
  202. package/src/types.ts +0 -5
  203. package/plugin/build/withMapsAndroid.d.ts +0 -5
  204. package/plugin/build/withMapsAndroid.js +0 -15
  205. package/plugin/build/withMapsIOS.d.ts +0 -5
  206. package/plugin/build/withMapsIOS.js +0 -27
@@ -0,0 +1,97 @@
1
+ import { memo, useCallback, useEffect, useRef } from 'react';
2
+ import { useMapContext } from '../MapProvider.web';
3
+ import type { TileOverlayProps } from './TileOverlay.types';
4
+
5
+ export const TileOverlay = memo(
6
+ ({
7
+ urlTemplate,
8
+ tileSize = 256,
9
+ opacity = 1,
10
+ bounds,
11
+ zIndex = 0,
12
+ onPress,
13
+ }: TileOverlayProps) => {
14
+ const { map } = useMapContext();
15
+ const overlayRef = useRef<google.maps.ImageMapType | null>(null);
16
+ const indexRef = useRef<number>(-1);
17
+
18
+ const handleClick = useCallback(() => {
19
+ onPress?.();
20
+ }, [onPress]);
21
+
22
+ // Cleanup on unmount
23
+ useEffect(() => {
24
+ return () => {
25
+ if (overlayRef.current && indexRef.current >= 0) {
26
+ map?.overlayMapTypes.removeAt(indexRef.current);
27
+ }
28
+ overlayRef.current = null;
29
+ indexRef.current = -1;
30
+ };
31
+ // eslint-disable-next-line react-hooks/exhaustive-deps
32
+ }, []);
33
+
34
+ // Sync overlay with props
35
+ useEffect(() => {
36
+ if (!map) return;
37
+
38
+ // Remove old overlay
39
+ if (overlayRef.current && indexRef.current >= 0) {
40
+ map.overlayMapTypes.removeAt(indexRef.current);
41
+ overlayRef.current = null;
42
+ indexRef.current = -1;
43
+ }
44
+
45
+ if (!urlTemplate) return;
46
+
47
+ const imageMapType = new google.maps.ImageMapType({
48
+ getTileUrl: (coord, zoom) => {
49
+ if (bounds) {
50
+ const n = Math.pow(2, zoom);
51
+ const tileSWLat =
52
+ (Math.atan(Math.sinh(Math.PI * (1 - (2 * (coord.y + 1)) / n))) *
53
+ 180) /
54
+ Math.PI;
55
+ const tileNELat =
56
+ (Math.atan(Math.sinh(Math.PI * (1 - (2 * coord.y) / n))) * 180) /
57
+ Math.PI;
58
+ const tileSWLng = (coord.x / n) * 360 - 180;
59
+ const tileNELng = ((coord.x + 1) / n) * 360 - 180;
60
+
61
+ if (
62
+ tileNELat < bounds.southwest.latitude ||
63
+ tileSWLat > bounds.northeast.latitude ||
64
+ tileNELng < bounds.southwest.longitude ||
65
+ tileSWLng > bounds.northeast.longitude
66
+ ) {
67
+ return null;
68
+ }
69
+ }
70
+
71
+ return urlTemplate
72
+ .replace('{x}', String(coord.x))
73
+ .replace('{y}', String(coord.y))
74
+ .replace('{z}', String(zoom));
75
+ },
76
+ tileSize: new google.maps.Size(tileSize, tileSize),
77
+ opacity,
78
+ });
79
+
80
+ const length = map.overlayMapTypes.getLength();
81
+ map.overlayMapTypes.insertAt(length, imageMapType);
82
+ overlayRef.current = imageMapType;
83
+ indexRef.current = length;
84
+ }, [
85
+ map,
86
+ urlTemplate,
87
+ tileSize,
88
+ opacity,
89
+ bounds,
90
+ zIndex,
91
+ onPress,
92
+ handleClick,
93
+ ]);
94
+
95
+ return null;
96
+ }
97
+ );
@@ -1,12 +1,15 @@
1
1
  export { Marker } from './Marker';
2
2
  export type {
3
3
  CalloutOptions,
4
+ MarkerRef,
4
5
  MarkerProps,
5
6
  MarkerPressEvent,
6
7
  MarkerDragEvent,
7
8
  } from './Marker.types';
8
9
  export { Polygon } from './Polygon';
9
10
  export type { PolygonProps } from './Polygon.types';
11
+ export { Circle } from './Circle';
12
+ export type { CircleProps } from './Circle.types';
10
13
  export { Polyline } from './Polyline';
11
14
  export type {
12
15
  PolylineProps,
@@ -15,3 +18,10 @@ export type {
15
18
  } from './Polyline.types';
16
19
  export { GeoJson } from './GeoJson';
17
20
  export type { GeoJsonProps } from './GeoJson.types';
21
+ export { GroundOverlay } from './GroundOverlay';
22
+ export type {
23
+ GroundOverlayProps,
24
+ GroundOverlayBounds,
25
+ } from './GroundOverlay.types';
26
+ export { TileOverlay } from './TileOverlay';
27
+ export type { TileOverlayProps, TileOverlayBounds } from './TileOverlay.types';
@@ -1,8 +1,17 @@
1
1
  export { Marker } from './Marker.web';
2
2
  export { Polygon } from './Polygon.web';
3
+ export { Circle } from './Circle.web';
3
4
  export { Polyline } from './Polyline.web';
4
5
  export type { CalloutOptions, MarkerProps } from './Marker.types';
5
6
  export type { PolygonProps } from './Polygon.types';
7
+ export type { CircleProps } from './Circle.types';
6
8
  export type { PolylineProps } from './Polyline.types';
7
9
  export { GeoJson } from './GeoJson';
8
10
  export type { GeoJsonProps } from './GeoJson.types';
11
+ export { GroundOverlay } from './GroundOverlay.web';
12
+ export type {
13
+ GroundOverlayProps,
14
+ GroundOverlayBounds,
15
+ } from './GroundOverlay.types';
16
+ export { TileOverlay } from './TileOverlay.web';
17
+ export type { TileOverlayProps, TileOverlayBounds } from './TileOverlay.types';
@@ -12,7 +12,7 @@ export interface Point {
12
12
 
13
13
  export interface NativeProps extends ViewProps {
14
14
  bubbled?: WithDefault<boolean, true>;
15
- anchor?: Point;
15
+ offset?: Point;
16
16
  }
17
17
 
18
18
  export default codegenNativeComponent<NativeProps>(
@@ -0,0 +1,25 @@
1
+ import { codegenNativeComponent } from 'react-native';
2
+ import type { ViewProps, HostComponent, ColorValue } from 'react-native';
3
+ import type {
4
+ Double,
5
+ DirectEventHandler,
6
+ } from 'react-native/Libraries/Types/CodegenTypes';
7
+
8
+ export interface Coordinate {
9
+ latitude: Double;
10
+ longitude: Double;
11
+ }
12
+
13
+ export interface NativeProps extends ViewProps {
14
+ center: Coordinate;
15
+ radius?: Double;
16
+ strokeColor?: ColorValue;
17
+ strokeWidth?: Double;
18
+ fillColor?: ColorValue;
19
+ tappable?: boolean;
20
+ onCirclePress?: DirectEventHandler<null>;
21
+ }
22
+
23
+ export default codegenNativeComponent<NativeProps>(
24
+ 'LuggCircleView'
25
+ ) as HostComponent<NativeProps>;
@@ -0,0 +1,29 @@
1
+ import { codegenNativeComponent } from 'react-native';
2
+ import type { ViewProps, HostComponent } from 'react-native';
3
+ import type {
4
+ Double,
5
+ DirectEventHandler,
6
+ } from 'react-native/Libraries/Types/CodegenTypes';
7
+
8
+ export interface Coordinate {
9
+ latitude: Double;
10
+ longitude: Double;
11
+ }
12
+
13
+ export interface Bounds {
14
+ northeast: Coordinate;
15
+ southwest: Coordinate;
16
+ }
17
+
18
+ export interface NativeProps extends ViewProps {
19
+ image: string;
20
+ bounds: Bounds;
21
+ opacity?: Double;
22
+ bearing?: Double;
23
+ tappable?: boolean;
24
+ onGroundOverlayPress?: DirectEventHandler<null>;
25
+ }
26
+
27
+ export default codegenNativeComponent<NativeProps>(
28
+ 'LuggGroundOverlayView'
29
+ ) as HostComponent<NativeProps>;
@@ -62,19 +62,30 @@ export interface ReadyEvent {}
62
62
 
63
63
  export interface NativeProps extends ViewProps {
64
64
  provider?: WithDefault<'google' | 'apple', 'google'>;
65
+ mapType?: WithDefault<
66
+ 'standard' | 'satellite' | 'terrain' | 'hybrid' | 'muted-standard',
67
+ 'standard'
68
+ >;
65
69
  mapId?: string;
66
70
  initialCoordinate?: Coordinate;
67
71
  initialZoom?: Double;
68
72
  minZoom?: Double;
69
73
  maxZoom?: Double;
70
- zoomEnabled?: boolean;
71
- scrollEnabled?: boolean;
72
- rotateEnabled?: boolean;
73
- pitchEnabled?: boolean;
74
+ zoomEnabled?: WithDefault<boolean, true>;
75
+ scrollEnabled?: WithDefault<boolean, true>;
76
+ rotateEnabled?: WithDefault<boolean, true>;
77
+ pitchEnabled?: WithDefault<boolean, true>;
78
+ compassEnabled?: WithDefault<boolean, true>;
79
+ staticMode?: boolean;
80
+ staticKey?: string;
74
81
  edgeInsets?: EdgeInsets;
75
82
  userLocationEnabled?: boolean;
76
83
  userLocationButtonEnabled?: boolean;
77
- theme?: WithDefault<'light' | 'dark' | 'system', 'system'>;
84
+ poiEnabled?: boolean;
85
+ poiFilterMode?: WithDefault<'including' | 'excluding', 'including'>;
86
+ poiFilterCategories?: ReadonlyArray<string>;
87
+ theme?: WithDefault<'system' | 'light' | 'dark', 'system'>;
88
+ insetAdjustment?: WithDefault<'never' | 'automatic', 'never'>;
78
89
  onMapPress?: DirectEventHandler<PressEvent>;
79
90
  onMapLongPress?: DirectEventHandler<LongPressEvent>;
80
91
  onCameraMove?: DirectEventHandler<CameraMoveEvent>;
@@ -1,4 +1,4 @@
1
- import { codegenNativeComponent } from 'react-native';
1
+ import { codegenNativeComponent, codegenNativeCommands } from 'react-native';
2
2
  import type { ViewProps, HostComponent } from 'react-native';
3
3
  import type {
4
4
  Double,
@@ -25,6 +25,7 @@ export interface NativeProps extends ViewProps {
25
25
  rotate?: WithDefault<Double, 0>;
26
26
  scale?: WithDefault<Double, 1>;
27
27
  rasterize?: WithDefault<boolean, true>;
28
+ centerOnPress?: WithDefault<boolean, true>;
28
29
  draggable?: WithDefault<boolean, false>;
29
30
  onMarkerPress?: DirectEventHandler<{
30
31
  coordinate: {
@@ -68,6 +69,17 @@ export interface NativeProps extends ViewProps {
68
69
  }>;
69
70
  }
70
71
 
72
+ type ComponentType = HostComponent<NativeProps>;
73
+
74
+ interface NativeCommands {
75
+ showCallout: (viewRef: React.ElementRef<ComponentType>) => void;
76
+ hideCallout: (viewRef: React.ElementRef<ComponentType>) => void;
77
+ }
78
+
79
+ export const Commands = codegenNativeCommands<NativeCommands>({
80
+ supportedCommands: ['showCallout', 'hideCallout'],
81
+ });
82
+
71
83
  export default codegenNativeComponent<NativeProps>(
72
84
  'LuggMarkerView'
73
- ) as HostComponent<NativeProps>;
85
+ ) as ComponentType;
@@ -0,0 +1,30 @@
1
+ import { codegenNativeComponent } from 'react-native';
2
+ import type { ViewProps, HostComponent } from 'react-native';
3
+ import type {
4
+ Double,
5
+ Int32,
6
+ DirectEventHandler,
7
+ } from 'react-native/Libraries/Types/CodegenTypes';
8
+
9
+ export interface Coordinate {
10
+ latitude: Double;
11
+ longitude: Double;
12
+ }
13
+
14
+ export interface Bounds {
15
+ northeast: Coordinate;
16
+ southwest: Coordinate;
17
+ }
18
+
19
+ export interface NativeProps extends ViewProps {
20
+ urlTemplate: string;
21
+ tileSize?: Int32;
22
+ opacity?: Double;
23
+ bounds?: Bounds;
24
+ tappable?: boolean;
25
+ onTileOverlayPress?: DirectEventHandler<null>;
26
+ }
27
+
28
+ export default codegenNativeComponent<NativeProps>(
29
+ 'LuggTileOverlayView'
30
+ ) as HostComponent<NativeProps>;
package/src/index.ts CHANGED
@@ -4,12 +4,15 @@ export type { MapProviderProps } from './MapProvider.types';
4
4
  export { Marker } from './components';
5
5
  export type {
6
6
  CalloutOptions,
7
+ MarkerRef,
7
8
  MarkerProps,
8
9
  MarkerPressEvent,
9
10
  MarkerDragEvent,
10
11
  } from './components';
11
12
  export { Polygon } from './components';
12
13
  export type { PolygonProps } from './components';
14
+ export { Circle } from './components';
15
+ export type { CircleProps } from './components';
13
16
  export { Polyline } from './components';
14
17
  export type {
15
18
  PolylineProps,
@@ -18,6 +21,10 @@ export type {
18
21
  } from './components';
19
22
  export { GeoJson } from './components';
20
23
  export type { GeoJsonProps } from './components';
24
+ export { GroundOverlay } from './components';
25
+ export type { GroundOverlayProps, GroundOverlayBounds } from './components';
26
+ export { TileOverlay } from './components';
27
+ export type { TileOverlayProps, TileOverlayBounds } from './components';
21
28
  export type {
22
29
  MapViewProps,
23
30
  MapViewRef,
@@ -27,10 +34,14 @@ export type {
27
34
  CameraEventPayload,
28
35
  MapCameraEvent,
29
36
  MapPressEvent,
37
+ MapType,
38
+ MapTheme,
39
+ InsetAdjustment,
40
+ PoiCategory,
41
+ PoiFilter,
30
42
  } from './MapView.types';
31
43
  export type {
32
44
  MapProvider as MapProviderType,
33
- MapTheme,
34
45
  Coordinate,
35
46
  Point,
36
47
  EdgeInsets,
package/src/index.web.ts CHANGED
@@ -5,16 +5,31 @@ export { Marker } from './components/index.web';
5
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';
14
+ export { GroundOverlay } from './components/index.web';
15
+ export type {
16
+ GroundOverlayProps,
17
+ GroundOverlayBounds,
18
+ } from './components/index.web';
19
+ export { TileOverlay } from './components/index.web';
20
+ export type {
21
+ TileOverlayProps,
22
+ TileOverlayBounds,
23
+ } from './components/index.web';
12
24
  export type {
13
25
  MapViewProps,
14
26
  MapViewRef,
15
27
  MoveCameraOptions,
16
28
  FitCoordinatesOptions,
17
29
  CameraEventPayload,
30
+ MapType,
31
+ PoiCategory,
32
+ PoiFilter,
18
33
  } from './MapView.types';
19
34
  export type {
20
35
  MapProvider as MapProviderType,
package/src/types.ts CHANGED
@@ -29,11 +29,6 @@ export interface EdgeInsets {
29
29
  right: number;
30
30
  }
31
31
 
32
- /**
33
- * Map theme
34
- */
35
- export type MapTheme = 'light' | 'dark' | 'system';
36
-
37
32
  /**
38
33
  * Press event payload
39
34
  */
@@ -1,5 +0,0 @@
1
- import { type ConfigPlugin } from '@expo/config-plugins';
2
- export interface MapsAndroidPluginProps {
3
- apiKey?: string;
4
- }
5
- export declare const withLuggMapsAndroid: ConfigPlugin<MapsAndroidPluginProps>;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.withLuggMapsAndroid = void 0;
4
- const config_plugins_1 = require("@expo/config-plugins");
5
- const withLuggMapsAndroid = (config, { apiKey }) => {
6
- if (!apiKey) {
7
- return config;
8
- }
9
- return (0, config_plugins_1.withAndroidManifest)(config, (c) => {
10
- const mainApplication = config_plugins_1.AndroidConfig.Manifest.getMainApplicationOrThrow(c.modResults);
11
- config_plugins_1.AndroidConfig.Manifest.addMetaDataItemToMainApplication(mainApplication, 'com.google.android.geo.API_KEY', apiKey);
12
- return c;
13
- });
14
- };
15
- exports.withLuggMapsAndroid = withLuggMapsAndroid;
@@ -1,5 +0,0 @@
1
- import { type ConfigPlugin } from '@expo/config-plugins';
2
- export interface MapsIOSPluginProps {
3
- apiKey?: string;
4
- }
5
- export declare const withLuggMapsIOS: ConfigPlugin<MapsIOSPluginProps>;
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.withLuggMapsIOS = void 0;
4
- const config_plugins_1 = require("@expo/config-plugins");
5
- const withLuggMapsIOS = (config, { apiKey }) => {
6
- if (!apiKey) {
7
- return config;
8
- }
9
- config = (0, config_plugins_1.withInfoPlist)(config, (c) => {
10
- c.modResults.GMSApiKey = apiKey;
11
- return c;
12
- });
13
- config = (0, config_plugins_1.withAppDelegate)(config, (c) => {
14
- const contents = c.modResults.contents;
15
- // Add import for GoogleMaps
16
- if (!contents.includes('import GoogleMaps')) {
17
- c.modResults.contents = contents.replace(/(import (?:UIKit|Expo))/, '$1\nimport GoogleMaps');
18
- }
19
- // Add GMSServices.provideAPIKey call
20
- if (!c.modResults.contents.includes('GMSServices.provideAPIKey')) {
21
- c.modResults.contents = c.modResults.contents.replace(/(func application\([^)]+\)[^{]*\{)/, `$1\n GMSServices.provideAPIKey("${apiKey}")\n`);
22
- }
23
- return c;
24
- });
25
- return config;
26
- };
27
- exports.withLuggMapsIOS = withLuggMapsIOS;