@lugg/maps 1.0.0-beta.3 → 1.0.0-beta.5

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 (153) hide show
  1. package/README.md +3 -0
  2. package/android/src/main/java/com/luggmaps/LuggCalloutView.kt +4 -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 +49 -0
  9. package/android/src/main/java/com/luggmaps/LuggMapViewManager.kt +31 -0
  10. package/android/src/main/java/com/luggmaps/LuggMarkerView.kt +23 -0
  11. package/android/src/main/java/com/luggmaps/LuggMarkerViewManager.kt +13 -0
  12. package/android/src/main/java/com/luggmaps/LuggPackage.kt +4 -1
  13. package/android/src/main/java/com/luggmaps/LuggTileOverlayView.kt +92 -0
  14. package/android/src/main/java/com/luggmaps/LuggTileOverlayViewManager.kt +80 -0
  15. package/android/src/main/java/com/luggmaps/core/GoogleMapProvider.kt +451 -17
  16. package/android/src/main/java/com/luggmaps/core/MapProviderDelegate.kt +14 -0
  17. package/android/src/main/java/com/luggmaps/events/CirclePressEvent.kt +12 -0
  18. package/android/src/main/java/com/luggmaps/events/GroundOverlayPressEvent.kt +12 -0
  19. package/android/src/main/java/com/luggmaps/events/TileOverlayPressEvent.kt +12 -0
  20. package/android/src/main/java/com/luggmaps/extensions/ViewExtensions.kt +11 -0
  21. package/ios/LuggCalloutView.h +1 -1
  22. package/ios/LuggCalloutView.mm +21 -11
  23. package/ios/LuggCircleView.h +31 -0
  24. package/ios/LuggCircleView.mm +133 -0
  25. package/ios/LuggGroundOverlayView.h +30 -0
  26. package/ios/LuggGroundOverlayView.mm +125 -0
  27. package/ios/LuggMapView.mm +84 -2
  28. package/ios/LuggMarkerView.h +3 -0
  29. package/ios/LuggMarkerView.mm +23 -0
  30. package/ios/LuggTileOverlayView.h +31 -0
  31. package/ios/LuggTileOverlayView.mm +130 -0
  32. package/ios/core/AppleMapProvider.mm +595 -17
  33. package/ios/core/GoogleMapProvider.mm +390 -28
  34. package/ios/core/MapProviderDelegate.h +20 -1
  35. package/ios/events/CirclePressEvent.h +20 -0
  36. package/ios/events/GroundOverlayPressEvent.h +20 -0
  37. package/ios/events/TileOverlayPressEvent.h +20 -0
  38. package/lib/module/MapView.js +11 -0
  39. package/lib/module/MapView.js.map +1 -1
  40. package/lib/module/MapView.web.js +3 -0
  41. package/lib/module/MapView.web.js.map +1 -1
  42. package/lib/module/components/Circle.js +46 -0
  43. package/lib/module/components/Circle.js.map +1 -0
  44. package/lib/module/components/Circle.types.js +4 -0
  45. package/lib/module/components/Circle.types.js.map +1 -0
  46. package/lib/module/components/Circle.web.js +79 -0
  47. package/lib/module/components/Circle.web.js.map +1 -0
  48. package/lib/module/components/GroundOverlay.js +45 -0
  49. package/lib/module/components/GroundOverlay.js.map +1 -0
  50. package/lib/module/components/GroundOverlay.types.js +4 -0
  51. package/lib/module/components/GroundOverlay.types.js.map +1 -0
  52. package/lib/module/components/GroundOverlay.web.js +77 -0
  53. package/lib/module/components/GroundOverlay.web.js.map +1 -0
  54. package/lib/module/components/Marker.js +22 -4
  55. package/lib/module/components/Marker.js.map +1 -1
  56. package/lib/module/components/Marker.web.js +20 -7
  57. package/lib/module/components/Marker.web.js.map +1 -1
  58. package/lib/module/components/TileOverlay.js +44 -0
  59. package/lib/module/components/TileOverlay.js.map +1 -0
  60. package/lib/module/components/TileOverlay.types.js +4 -0
  61. package/lib/module/components/TileOverlay.types.js.map +1 -0
  62. package/lib/module/components/TileOverlay.web.js +69 -0
  63. package/lib/module/components/TileOverlay.web.js.map +1 -0
  64. package/lib/module/components/index.js +3 -0
  65. package/lib/module/components/index.js.map +1 -1
  66. package/lib/module/components/index.web.js +3 -0
  67. package/lib/module/components/index.web.js.map +1 -1
  68. package/lib/module/fabric/LuggCalloutViewNativeComponent.ts +1 -1
  69. package/lib/module/fabric/LuggCircleViewNativeComponent.ts +25 -0
  70. package/lib/module/fabric/LuggGroundOverlayViewNativeComponent.ts +29 -0
  71. package/lib/module/fabric/LuggMapViewNativeComponent.ts +9 -1
  72. package/lib/module/fabric/LuggMarkerViewNativeComponent.ts +14 -2
  73. package/lib/module/fabric/LuggTileOverlayViewNativeComponent.ts +30 -0
  74. package/lib/module/index.js +3 -0
  75. package/lib/module/index.js.map +1 -1
  76. package/lib/module/index.web.js +3 -0
  77. package/lib/module/index.web.js.map +1 -1
  78. package/lib/typescript/src/MapView.d.ts.map +1 -1
  79. package/lib/typescript/src/MapView.types.d.ts +36 -1
  80. package/lib/typescript/src/MapView.types.d.ts.map +1 -1
  81. package/lib/typescript/src/MapView.web.d.ts.map +1 -1
  82. package/lib/typescript/src/components/Circle.d.ts +10 -0
  83. package/lib/typescript/src/components/Circle.d.ts.map +1 -0
  84. package/lib/typescript/src/components/Circle.types.d.ts +33 -0
  85. package/lib/typescript/src/components/Circle.types.d.ts.map +1 -0
  86. package/lib/typescript/src/components/Circle.web.d.ts +3 -0
  87. package/lib/typescript/src/components/Circle.web.d.ts.map +1 -0
  88. package/lib/typescript/src/components/GroundOverlay.d.ts +10 -0
  89. package/lib/typescript/src/components/GroundOverlay.d.ts.map +1 -0
  90. package/lib/typescript/src/components/GroundOverlay.types.d.ts +35 -0
  91. package/lib/typescript/src/components/GroundOverlay.types.d.ts.map +1 -0
  92. package/lib/typescript/src/components/GroundOverlay.web.d.ts +3 -0
  93. package/lib/typescript/src/components/GroundOverlay.web.d.ts.map +1 -0
  94. package/lib/typescript/src/components/Marker.d.ts +6 -3
  95. package/lib/typescript/src/components/Marker.d.ts.map +1 -1
  96. package/lib/typescript/src/components/Marker.types.d.ts +18 -6
  97. package/lib/typescript/src/components/Marker.types.d.ts.map +1 -1
  98. package/lib/typescript/src/components/Marker.web.d.ts +3 -2
  99. package/lib/typescript/src/components/Marker.web.d.ts.map +1 -1
  100. package/lib/typescript/src/components/TileOverlay.d.ts +10 -0
  101. package/lib/typescript/src/components/TileOverlay.d.ts.map +1 -0
  102. package/lib/typescript/src/components/TileOverlay.types.d.ts +36 -0
  103. package/lib/typescript/src/components/TileOverlay.types.d.ts.map +1 -0
  104. package/lib/typescript/src/components/TileOverlay.web.d.ts +3 -0
  105. package/lib/typescript/src/components/TileOverlay.web.d.ts.map +1 -0
  106. package/lib/typescript/src/components/index.d.ts +7 -1
  107. package/lib/typescript/src/components/index.d.ts.map +1 -1
  108. package/lib/typescript/src/components/index.web.d.ts +6 -0
  109. package/lib/typescript/src/components/index.web.d.ts.map +1 -1
  110. package/lib/typescript/src/fabric/LuggCalloutViewNativeComponent.d.ts +1 -1
  111. package/lib/typescript/src/fabric/LuggCircleViewNativeComponent.d.ts +18 -0
  112. package/lib/typescript/src/fabric/LuggCircleViewNativeComponent.d.ts.map +1 -0
  113. package/lib/typescript/src/fabric/LuggGroundOverlayViewNativeComponent.d.ts +21 -0
  114. package/lib/typescript/src/fabric/LuggGroundOverlayViewNativeComponent.d.ts.map +1 -0
  115. package/lib/typescript/src/fabric/LuggMapViewNativeComponent.d.ts +6 -1
  116. package/lib/typescript/src/fabric/LuggMapViewNativeComponent.d.ts.map +1 -1
  117. package/lib/typescript/src/fabric/LuggMarkerViewNativeComponent.d.ts +8 -1
  118. package/lib/typescript/src/fabric/LuggMarkerViewNativeComponent.d.ts.map +1 -1
  119. package/lib/typescript/src/fabric/LuggTileOverlayViewNativeComponent.d.ts +21 -0
  120. package/lib/typescript/src/fabric/LuggTileOverlayViewNativeComponent.d.ts.map +1 -0
  121. package/lib/typescript/src/index.d.ts +9 -3
  122. package/lib/typescript/src/index.d.ts.map +1 -1
  123. package/lib/typescript/src/index.web.d.ts +7 -1
  124. package/lib/typescript/src/index.web.d.ts.map +1 -1
  125. package/lib/typescript/src/types.d.ts +0 -4
  126. package/lib/typescript/src/types.d.ts.map +1 -1
  127. package/package.json +5 -2
  128. package/src/MapView.tsx +11 -0
  129. package/src/MapView.types.ts +85 -1
  130. package/src/MapView.web.tsx +11 -0
  131. package/src/components/Circle.tsx +52 -0
  132. package/src/components/Circle.types.ts +33 -0
  133. package/src/components/Circle.web.tsx +93 -0
  134. package/src/components/GroundOverlay.tsx +47 -0
  135. package/src/components/GroundOverlay.types.ts +36 -0
  136. package/src/components/GroundOverlay.web.tsx +85 -0
  137. package/src/components/Marker.tsx +32 -6
  138. package/src/components/Marker.types.ts +19 -6
  139. package/src/components/Marker.web.tsx +191 -148
  140. package/src/components/TileOverlay.tsx +44 -0
  141. package/src/components/TileOverlay.types.ts +37 -0
  142. package/src/components/TileOverlay.web.tsx +95 -0
  143. package/src/components/index.ts +10 -0
  144. package/src/components/index.web.ts +9 -0
  145. package/src/fabric/LuggCalloutViewNativeComponent.ts +1 -1
  146. package/src/fabric/LuggCircleViewNativeComponent.ts +25 -0
  147. package/src/fabric/LuggGroundOverlayViewNativeComponent.ts +29 -0
  148. package/src/fabric/LuggMapViewNativeComponent.ts +9 -1
  149. package/src/fabric/LuggMarkerViewNativeComponent.ts +14 -2
  150. package/src/fabric/LuggTileOverlayViewNativeComponent.ts +30 -0
  151. package/src/index.ts +12 -1
  152. package/src/index.web.ts +15 -0
  153. package/src/types.ts +0 -5
@@ -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
  */