react-native-maps 1.21.0-alpha.96 → 1.21.0-alpha.98

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.
@@ -16,7 +16,7 @@ import android.util.DisplayMetrics;
16
16
 
17
17
  import androidx.annotation.Nullable;
18
18
 
19
- import com.facebook.fbreact.specs.NativeAirMapsModuleSpec;
19
+ import com.rnmaps.fabric.NativeAirMapsModuleSpec;
20
20
  import com.facebook.react.bridge.Arguments;
21
21
  import com.facebook.react.bridge.Promise;
22
22
  import com.facebook.react.bridge.ReactApplicationContext;
@@ -13,7 +13,7 @@ import com.rnmaps.fabric.CircleManager;
13
13
  import com.rnmaps.fabric.MapViewManager;
14
14
  import com.rnmaps.fabric.MarkerManager;
15
15
  import com.rnmaps.fabric.NativeAirMapsModule;
16
- import com.facebook.fbreact.specs.NativeAirMapsModuleSpec;
16
+ import com.rnmaps.fabric.NativeAirMapsModuleSpec;
17
17
  import com.rnmaps.fabric.OverlayManager;
18
18
  import com.rnmaps.fabric.PolygonManager;
19
19
  import com.rnmaps.fabric.PolylineManager;
@@ -54,7 +54,7 @@ public class MapAirModulePackage extends TurboReactPackage {
54
54
  return new MapViewManager(reactContext);
55
55
  }
56
56
  if (NativeAirMapsModuleSpec.NAME.equals(name)) {
57
- return new NativeAirMapsModule(reactContext);
57
+ return (NativeModule) new NativeAirMapsModule(reactContext);
58
58
  } else {
59
59
  return null;
60
60
  }
@@ -79,4 +79,4 @@ public class MapAirModulePackage extends TurboReactPackage {
79
79
  }
80
80
  };
81
81
  }
82
- }
82
+ }
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "main": "lib/index.js",
6
6
  "author": "Leland Richardson <leland.m.richardson@gmail.com>",
7
7
  "homepage": "https://github.com/react-native-maps/react-native-maps#readme",
8
- "version": "1.21.0-alpha.96",
8
+ "version": "1.21.0-alpha.98",
9
9
  "license": "MIT",
10
10
  "scripts": {
11
11
  "lint": "eslint . --max-warnings 0",
@@ -21,6 +21,7 @@
21
21
  "prepack": "node updateCodegenConfig.js"
22
22
  },
23
23
  "files": [
24
+ "specs",
24
25
  "lib",
25
26
  "android",
26
27
  "ios",
@@ -94,7 +95,7 @@
94
95
  "codegenConfig": {
95
96
  "name": "RNMapsSpecs",
96
97
  "type": "all",
97
- "jsSrcsDir": "./lib/specs",
98
+ "jsSrcsDir": "./specs",
98
99
  "android": {
99
100
  "javaPackageName": "com.rnmaps.fabric"
100
101
  }
@@ -0,0 +1,36 @@
1
+ import type {TurboModule} from 'react-native';
2
+ import {TurboModuleRegistry} from 'react-native';
3
+ import type {Double} from 'react-native/Libraries/Types/CodegenTypes';
4
+ import type {Camera} from './NativeComponentMapView';
5
+ import {Address} from 'react-native-maps';
6
+
7
+ type LatLng = {
8
+ latitude: Double;
9
+ longitude: Double;
10
+ };
11
+
12
+ type Point = Readonly<{
13
+ x: Double; // Non-nullable Double for x
14
+ y: Double; // Non-nullable Double for y
15
+ }>;
16
+
17
+ export type Region = Readonly<
18
+ LatLng & {
19
+ latitudeDelta: Double; // Non-nullable Double for latitudeDelta
20
+ longitudeDelta: Double; // Non-nullable Double for longitudeDelta
21
+ }
22
+ >;
23
+
24
+ export type MapBoundaries = {northEast: LatLng; southWest: LatLng};
25
+
26
+ export interface Spec extends TurboModule {
27
+ getCamera(tag: Double): Promise<Camera>;
28
+ getMarkersFrames(tag: Double, onlyVisible: boolean): Promise<unknown>;
29
+ getMapBoundaries(tag: Double): Promise<MapBoundaries>;
30
+ takeSnapshot(tag: Double, config: string): Promise<string>;
31
+ getAddressFromCoordinates(tag: Double, coordinate: LatLng): Promise<Address>;
32
+ getPointForCoordinate(tag: Double, coordinate: LatLng): Promise<Point>;
33
+ getCoordinateForPoint(tag: Double, point: Point): Promise<LatLng>;
34
+ }
35
+
36
+ export default TurboModuleRegistry.getEnforcing<Spec>('RNMapsAirModule');
@@ -0,0 +1,63 @@
1
+ import type {HostComponent, ViewProps} from 'react-native';
2
+
3
+ import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
4
+ import {
5
+ Double,
6
+ BubblingEventHandler,
7
+ } from 'react-native/Libraries/Types/CodegenTypes';
8
+
9
+ export type LatLng = Readonly<{
10
+ latitude: Double; // Non-nullable Double for latitude
11
+ longitude: Double; // Non-nullable Double for longitude
12
+ }>;
13
+
14
+ export type CalloutPressEvent = BubblingEventHandler<
15
+ Readonly<{
16
+ action?: string;
17
+ id: string;
18
+ coordinate: {
19
+ latitude: Double; // Inlined LatLng
20
+ longitude: Double;
21
+ };
22
+ position?: {
23
+ x: Double; // Inlined Point
24
+ y: Double;
25
+ }; // Optional position for Android
26
+ }>
27
+ >;
28
+
29
+ export interface CalloutFabricNativeProps extends ViewProps {
30
+ /**
31
+ * If `true`, clicks on transparent areas in callout will be passed to map.
32
+ *
33
+ * @default false
34
+ * @platform iOS: Supported
35
+ * @platform Android: Not supported
36
+ */
37
+ alphaHitTest?: boolean;
38
+
39
+ /**
40
+ * Callback that is called when the user presses on the callout
41
+ *
42
+ * @platform iOS: Apple Maps only
43
+ * @platform Android: Supported
44
+ */
45
+ onPress?: CalloutPressEvent;
46
+
47
+ /**
48
+ * If `false`, a default "tooltip" bubble window will be drawn around this callouts children.
49
+ * If `true`, the child views can fully customize their appearance, including any "bubble" like styles.
50
+ *
51
+ * @default false
52
+ * @platform iOS: Supported
53
+ * @platform Android: Supported
54
+ */
55
+ tooltip?: boolean;
56
+ }
57
+
58
+ export default codegenNativeComponent<CalloutFabricNativeProps>(
59
+ 'RNMapsCallout',
60
+ {
61
+ excludedPlatforms: ['iOS'],
62
+ },
63
+ ) as HostComponent<CalloutFabricNativeProps>;
@@ -0,0 +1,94 @@
1
+ import type {HostComponent, ViewProps, ColorValue} from 'react-native';
2
+
3
+ import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
4
+ import {
5
+ Double,
6
+ Float,
7
+ BubblingEventHandler,
8
+ } from 'react-native/Libraries/Types/CodegenTypes';
9
+
10
+ export type LatLng = Readonly<{
11
+ latitude: Double; // Non-nullable Double for latitude
12
+ longitude: Double; // Non-nullable Double for longitude
13
+ }>;
14
+
15
+ export type CirclePressEventHandler = BubblingEventHandler<
16
+ Readonly<{
17
+ action?: string;
18
+ id: string;
19
+ coordinate: {
20
+ latitude: Double; // Inlined LatLng
21
+ longitude: Double;
22
+ };
23
+ position?: {
24
+ x: Double; // Inlined Point
25
+ y: Double;
26
+ }; // Optional position for Android
27
+ }>
28
+ >;
29
+
30
+ export interface CircleFabricNativeProps extends ViewProps {
31
+ /**
32
+ * The coordinates of the center of the circle.
33
+ *
34
+ * @platform iOS: Supported
35
+ * @platform Android: Supported
36
+ */
37
+ center: LatLng;
38
+
39
+ /**
40
+ * The stroke color to use for the path.
41
+ *
42
+ * @default `#000`, `rgba(r,g,b,0.5)`
43
+ * @platform iOS: Supported
44
+ * @platform Android: Supported
45
+ */
46
+ fillColor?: ColorValue;
47
+
48
+ /**
49
+ * The radius of the circle to be drawn (in meters)
50
+ *
51
+ * @platform iOS: Supported
52
+ * @platform Android: Supported
53
+ */
54
+ radius: Double;
55
+
56
+ /**
57
+ * The stroke color to use for the path.
58
+ *
59
+ * @default `#000`, `rgba(r,g,b,0.5)`
60
+ * @platform iOS: Supported
61
+ * @platform Android: Supported
62
+ */
63
+ strokeColor?: ColorValue;
64
+
65
+ /**
66
+ * Callback that is called when user taps on the map.
67
+ *
68
+ * @platform iOS: Supported
69
+ * @platform Android: Supported
70
+ */
71
+ onPress?: CirclePressEventHandler;
72
+
73
+ /**
74
+ * The stroke width to use for the path.
75
+ *
76
+ * @default 1
77
+ * @platform iOS: Supported
78
+ * @platform Android: Supported
79
+ */
80
+ strokeWidth?: Float;
81
+
82
+ /**
83
+ * Boolean to allow a polygon to be tappable and use the onPress function.
84
+ *
85
+ * @platform iOS: Google Maps only
86
+ * @platform Android: Supported
87
+ */
88
+ tappable?: boolean;
89
+ }
90
+
91
+ export default codegenNativeComponent<CircleFabricNativeProps>(
92
+ 'RNMapsCircle',
93
+ {},
94
+ ) as HostComponent<CircleFabricNativeProps>;