react-native-google-maps-plus 0.1.0 → 1.0.0

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 (54) hide show
  1. package/GoogleMapsNitro.podspec +34 -0
  2. package/LICENSE +20 -0
  3. package/README.md +40 -0
  4. package/android/CMakeLists.txt +32 -0
  5. package/android/build.gradle +135 -0
  6. package/android/fix-prefab.gradle +51 -0
  7. package/android/gradle.properties +8 -0
  8. package/android/src/main/AndroidManifest.xml +2 -0
  9. package/android/src/main/cpp/cpp-adapter.cpp +6 -0
  10. package/android/src/main/java/com/googlemapsnitro/Color.kt +65 -0
  11. package/android/src/main/java/com/googlemapsnitro/GoogleMapsNitroPackage.kt +35 -0
  12. package/android/src/main/java/com/googlemapsnitro/GoogleMapsNitroViewImpl.kt +720 -0
  13. package/android/src/main/java/com/googlemapsnitro/HybridGoogleMapsNitroModule.kt +22 -0
  14. package/android/src/main/java/com/googlemapsnitro/HybridGoogleMapsNitroView.kt +337 -0
  15. package/android/src/main/java/com/googlemapsnitro/LocationHandler.kt +205 -0
  16. package/android/src/main/java/com/googlemapsnitro/MapMarker.kt +145 -0
  17. package/android/src/main/java/com/googlemapsnitro/MapPolygon.kt +36 -0
  18. package/android/src/main/java/com/googlemapsnitro/MapPolyline.kt +59 -0
  19. package/android/src/main/java/com/googlemapsnitro/PermissionHandler.kt +116 -0
  20. package/android/src/main/java/com/googlemapsnitro/PlayServicesHandler.kt +25 -0
  21. package/ios/Color.swift +109 -0
  22. package/ios/GoogleMapNitroViewImpl.swift +590 -0
  23. package/ios/HybridGoogleMapsNitroModule.swift +27 -0
  24. package/ios/HybridGoogleMapsNitroView.swift +348 -0
  25. package/ios/LocationHandler.swift +205 -0
  26. package/ios/MapHelper.swift +18 -0
  27. package/ios/MapMarker.swift +207 -0
  28. package/ios/MapPolygon.swift +55 -0
  29. package/ios/MapPolyline.swift +83 -0
  30. package/ios/PermissionHandler.swift +73 -0
  31. package/lib/module/GoogleMapsNitroModule.nitro.js +4 -0
  32. package/lib/module/GoogleMapsNitroModule.nitro.js.map +1 -0
  33. package/lib/module/GoogleMapsNitroView.nitro.js +4 -0
  34. package/lib/module/GoogleMapsNitroView.nitro.js.map +1 -0
  35. package/lib/module/index.js +8 -0
  36. package/lib/module/index.js.map +1 -0
  37. package/lib/module/package.json +1 -0
  38. package/lib/module/types.js +78 -0
  39. package/lib/module/types.js.map +1 -0
  40. package/lib/typescript/package.json +1 -0
  41. package/lib/typescript/src/GoogleMapsNitroModule.nitro.d.ts +12 -0
  42. package/lib/typescript/src/GoogleMapsNitroModule.nitro.d.ts.map +1 -0
  43. package/lib/typescript/src/GoogleMapsNitroView.nitro.d.ts +34 -0
  44. package/lib/typescript/src/GoogleMapsNitroView.nitro.d.ts.map +1 -0
  45. package/lib/typescript/src/index.d.ts +7 -0
  46. package/lib/typescript/src/index.d.ts.map +1 -0
  47. package/lib/typescript/src/types.d.ts +113 -0
  48. package/lib/typescript/src/types.d.ts.map +1 -0
  49. package/nitro.json +28 -0
  50. package/package.json +13 -3
  51. package/src/GoogleMapsNitroModule.nitro.ts +13 -0
  52. package/src/GoogleMapsNitroView.nitro.ts +78 -0
  53. package/src/index.tsx +24 -0
  54. package/src/types.ts +174 -0
@@ -0,0 +1,113 @@
1
+ import type { GoogleMapsNitroViewMethods } from './GoogleMapsNitroView.nitro';
2
+ import type { HybridView } from 'react-native-nitro-modules';
3
+ export type GoogleMapsViewRef = HybridView<GoogleMapsNitroViewMethods>;
4
+ export type RNLatLng = {
5
+ latitude: number;
6
+ longitude: number;
7
+ };
8
+ export type RNBoundingBox = {
9
+ northEast: RNLatLng;
10
+ southWest: RNLatLng;
11
+ };
12
+ export type RNMapPadding = {
13
+ top: number;
14
+ left: number;
15
+ bottom: number;
16
+ right: number;
17
+ };
18
+ export type RNUserInterfaceStyle = 'light' | 'dark' | 'default';
19
+ export type RNFeatureType = string;
20
+ export type RNElementType = string;
21
+ export type RNVisibility = string;
22
+ export interface RNMapStyler {
23
+ color?: string;
24
+ visibility?: RNVisibility;
25
+ weight?: number;
26
+ gamma?: number;
27
+ lightness?: number;
28
+ saturation?: number;
29
+ invert_lightness?: boolean;
30
+ }
31
+ export interface RNMapStyleElement {
32
+ featureType?: RNFeatureType;
33
+ elementType?: RNElementType;
34
+ stylers: RNMapStyler[];
35
+ }
36
+ export type RNCamera = {
37
+ center?: RNLatLng;
38
+ zoom?: number;
39
+ bearing?: number;
40
+ tilt?: number;
41
+ };
42
+ export type RNRegion = {
43
+ center: RNLatLng;
44
+ latitudeDelta: number;
45
+ longitudeDelta: number;
46
+ };
47
+ export type RNPosition = {
48
+ x: number;
49
+ y: number;
50
+ };
51
+ export type RNLineCapType = 'butt' | 'round' | 'square';
52
+ export type RNLineJoinType = 'miter' | 'round' | 'bevel';
53
+ export type RNMarker = {
54
+ id: string;
55
+ zIndex: number;
56
+ coordinate: RNLatLng;
57
+ anchor?: RNPosition;
58
+ width: number;
59
+ height: number;
60
+ iconSvg: string;
61
+ };
62
+ export type RNPolygon = {
63
+ id: string;
64
+ zIndex: number;
65
+ coordinates: RNLatLng[];
66
+ fillColor?: string;
67
+ strokeColor?: string;
68
+ strokeWidth?: number;
69
+ };
70
+ export type RNPolyline = {
71
+ id: string;
72
+ zIndex: number;
73
+ coordinates: RNLatLng[];
74
+ lineCap?: RNLineCapType;
75
+ lineJoin?: RNLineJoinType;
76
+ color?: string;
77
+ width?: number;
78
+ };
79
+ export type RNLocationPermissionResult = {
80
+ android?: RNAndroidLocationPermissionResult;
81
+ ios?: RNIOSPermissionResult;
82
+ };
83
+ export declare enum RNAndroidLocationPermissionResult {
84
+ GRANTED = 1,
85
+ DENIED = -1,
86
+ NEVER_ASK_AGAIN = -2
87
+ }
88
+ export declare enum RNIOSPermissionResult {
89
+ DENIED = -1,
90
+ AUTHORIZED = 1
91
+ }
92
+ export type RNLocation = {
93
+ center: RNLatLng;
94
+ bearing: number;
95
+ };
96
+ export declare enum RNLocationErrorCode {
97
+ PERMISSION_DENIED = 1,
98
+ POSITION_UNAVAILABLE = 2,
99
+ TIMEOUT = 3,
100
+ PLAY_SERVICE_NOT_AVAILABLE = 4,
101
+ SETTINGS_NOT_SATISFIED = 5,
102
+ INTERNAL_ERROR = -1
103
+ }
104
+ export declare enum RNMapErrorCode {
105
+ PLAY_SERVICES_MISSING = 0,
106
+ PLAY_SERVICES_INVALID = 1,
107
+ PLAY_SERVICES_DISABLED = 2,
108
+ PLAY_SERVICES_OUTDATED = 3,
109
+ PLAY_SERVICE_UPDATE_AVAILABLE = 4,
110
+ PLAY_SERVICE_UPDATING = 5,
111
+ UNKNOWN = 6
112
+ }
113
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAE7D,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,0BAA0B,CAAC,CAAC;AAEvE,MAAM,MAAM,QAAQ,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/D,MAAM,MAAM,aAAa,GAAG;IAAE,SAAS,EAAE,QAAQ,CAAC;IAAC,SAAS,EAAE,QAAQ,CAAA;CAAE,CAAC;AAEzE,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAEhE,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AA+BnC,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AAcnC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;IACzB,OAAO,IAAI;CACZ"}
package/nitro.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "$schema": "https://nitro.margelo.com/nitro.schema.json",
3
+ "cxxNamespace": ["googlemapsnitro"],
4
+ "ios": {
5
+ "iosModuleName": "GoogleMapsNitro"
6
+ },
7
+ "android": {
8
+ "androidNamespace": ["googlemapsnitro"],
9
+ "androidCxxLibName": "GoogleMapsNitro"
10
+ },
11
+ "hybridViews": [
12
+ {
13
+ "name": "GoogleMapsNitroView",
14
+ "platforms": ["ios", "android"]
15
+ }
16
+ ],
17
+ "autolinking": {
18
+ "GoogleMapsNitroView": {
19
+ "swift": "HybridGoogleMapsNitroView",
20
+ "kotlin": "HybridGoogleMapsNitroView"
21
+ },
22
+ "GoogleMapsNitroModule": {
23
+ "swift": "HybridGoogleMapsNitroModule",
24
+ "kotlin": "HybridGoogleMapsNitroModule"
25
+ }
26
+ },
27
+ "ignorePaths": ["**/node_modules"]
28
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-google-maps-plus",
3
- "version": "0.1.0",
3
+ "version": "1.0.0",
4
4
  "description": "React-native wrapper for android & IOS google maps sdk",
5
5
  "main": "./lib/module/index.js",
6
6
  "module": "./lib/module/index.js",
@@ -21,7 +21,8 @@
21
21
  "git:clean": "git clean -dfX",
22
22
  "release": "semantic-release",
23
23
  "build": "yarn typecheck && yarn nitrogen && bob build",
24
- "nitrogen": "nitrogen --logLevel=\"debug\" && node scripts/post-script.js"
24
+ "nitrogen": "nitrogen --logLevel=\"debug\" && node scripts/post-script.js",
25
+ "prepare": "bob build"
25
26
  },
26
27
  "keywords": [
27
28
  "react-native",
@@ -59,6 +60,10 @@
59
60
  "license": "MIT",
60
61
  "bugs": "https://github.com/pinpong/react-native-google-maps-plus/issues",
61
62
  "homepage": "https://github.com/pinpong/react-native-google-maps-plus#readme",
63
+ "publishConfig": {
64
+ "access": "public",
65
+ "provenance": true
66
+ },
62
67
  "devDependencies": {
63
68
  "@commitlint/cli": "20.0.0",
64
69
  "@commitlint/config-conventional": "20.0.0",
@@ -70,6 +75,7 @@
70
75
  "@react-native/eslint-config": "0.82.0-rc.4",
71
76
  "@semantic-release/changelog": "6.0.3",
72
77
  "@semantic-release/git": "10.0.1",
78
+ "@semantic-release/npm": "13.0.0-beta.1",
73
79
  "@types/jest": "30.0.0",
74
80
  "@types/react": "19.1.15",
75
81
  "clang-format-node": "2.0.1",
@@ -87,9 +93,13 @@
87
93
  "react-native": "0.82.0-rc.4",
88
94
  "react-native-builder-bob": "0.40.13",
89
95
  "react-native-nitro-modules": "0.29.6",
90
- "semantic-release": "24.2.9",
96
+ "semantic-release": "25.0.0-beta.6",
91
97
  "typescript": "5.9.2"
92
98
  },
99
+ "overrides": {
100
+ "@semantic-release/npm": "13.0.0-beta.1",
101
+ "semantic-release": "25.0.0-beta.6"
102
+ },
93
103
  "peerDependencies": {
94
104
  "react": "*",
95
105
  "react-native": "*",
@@ -0,0 +1,13 @@
1
+ import { type HybridObject } from 'react-native-nitro-modules';
2
+ import type { RNLocationPermissionResult } from './types';
3
+
4
+ export interface GoogleMapsNitroModule
5
+ extends HybridObject<{ ios: 'swift'; android: 'kotlin' }> {
6
+ showLocationDialog(): void;
7
+
8
+ openLocationSettings(): void;
9
+
10
+ requestLocationPermission(): Promise<RNLocationPermissionResult>;
11
+
12
+ isGooglePlayServicesAvailable(): boolean;
13
+ }
@@ -0,0 +1,78 @@
1
+ import type {
2
+ HybridView,
3
+ HybridViewMethods,
4
+ HybridViewProps,
5
+ } from 'react-native-nitro-modules';
6
+ import type {
7
+ RNCamera,
8
+ RNLatLng,
9
+ RNMapPadding,
10
+ RNPolygon,
11
+ RNPolyline,
12
+ RNUserInterfaceStyle,
13
+ RNLocationErrorCode,
14
+ RNMarker,
15
+ RNLocationPermissionResult,
16
+ RNRegion,
17
+ RNLocation,
18
+ RNMapErrorCode,
19
+ } from './types';
20
+
21
+ export interface GoogleMapsNitroViewProps extends HybridViewProps {
22
+ buildingEnabled: boolean;
23
+ trafficEnabled: boolean;
24
+ customMapStyle: string;
25
+ initialCamera: RNCamera;
26
+ userInterfaceStyle: RNUserInterfaceStyle;
27
+ minZoomLevel: number;
28
+ maxZoomLevel: number;
29
+ mapPadding: RNMapPadding;
30
+ markers: RNMarker[];
31
+ polygons: RNPolygon[];
32
+ polylines: RNPolyline[];
33
+ onMapError?: (error: RNMapErrorCode) => void;
34
+ onMapReady?: (ready: boolean) => void;
35
+ onLocationUpdate?: (location: RNLocation) => void;
36
+ onLocationError?: (error: RNLocationErrorCode) => void;
37
+ onMapPress?: (coordinate: RNLatLng) => void;
38
+ onMarkerPress?: (id: string) => void;
39
+ onCameraChangeStart?: (
40
+ region: RNRegion,
41
+ camera: RNCamera,
42
+ isGesture: boolean
43
+ ) => void;
44
+ onCameraChange?: (
45
+ region: RNRegion,
46
+ camera: RNCamera,
47
+ isGesture: boolean
48
+ ) => void;
49
+ onCameraChangeComplete?: (
50
+ region: RNRegion,
51
+ camera: RNCamera,
52
+ isGesture: boolean
53
+ ) => void;
54
+ }
55
+
56
+ export interface GoogleMapsNitroViewMethods extends HybridViewMethods {
57
+ setCamera(camera: RNCamera, animated?: boolean, durationMS?: number): void;
58
+
59
+ setCameraToCoordinates(
60
+ coordinates: RNLatLng[],
61
+ padding?: RNMapPadding,
62
+ animated?: boolean,
63
+ durationMS?: number
64
+ ): void;
65
+
66
+ showLocationDialog(): void;
67
+
68
+ openLocationSettings(): void;
69
+
70
+ requestLocationPermission(): Promise<RNLocationPermissionResult>;
71
+
72
+ isGooglePlayServicesAvailable(): boolean;
73
+ }
74
+
75
+ export type GoogleMapsNitroView = HybridView<
76
+ GoogleMapsNitroViewProps,
77
+ GoogleMapsNitroViewMethods
78
+ >;
package/src/index.tsx ADDED
@@ -0,0 +1,24 @@
1
+ import { getHostComponent, NitroModules } from 'react-native-nitro-modules';
2
+
3
+ const GoogleMapsNitroConfig = require('../nitrogen/generated/shared/json/GoogleMapsNitroViewConfig.json');
4
+
5
+ import type {
6
+ GoogleMapsNitroViewMethods,
7
+ GoogleMapsNitroViewProps,
8
+ } from './GoogleMapsNitroView.nitro';
9
+
10
+ import type { GoogleMapsNitroModule } from './GoogleMapsNitroModule.nitro';
11
+
12
+ export * from './types';
13
+
14
+ export type { GoogleMapsNitroViewMethods, GoogleMapsNitroViewProps };
15
+
16
+ export const GoogleMapsView = getHostComponent<
17
+ GoogleMapsNitroViewProps,
18
+ GoogleMapsNitroViewMethods
19
+ >('GoogleMapsNitroView', () => GoogleMapsNitroConfig);
20
+
21
+ export const GoogleMapsModule =
22
+ NitroModules.createHybridObject<GoogleMapsNitroModule>(
23
+ 'GoogleMapsNitroModule'
24
+ );
package/src/types.ts ADDED
@@ -0,0 +1,174 @@
1
+ import type { GoogleMapsNitroViewMethods } from './GoogleMapsNitroView.nitro';
2
+ import type { HybridView } from 'react-native-nitro-modules';
3
+
4
+ export type GoogleMapsViewRef = HybridView<GoogleMapsNitroViewMethods>;
5
+
6
+ export type RNLatLng = { latitude: number; longitude: number };
7
+
8
+ export type RNBoundingBox = { northEast: RNLatLng; southWest: RNLatLng };
9
+
10
+ export type RNMapPadding = {
11
+ top: number;
12
+ left: number;
13
+ bottom: number;
14
+ right: number;
15
+ };
16
+
17
+ export type RNUserInterfaceStyle = 'light' | 'dark' | 'default';
18
+
19
+ export type RNFeatureType = string;
20
+
21
+ /*
22
+ | 'administrative'
23
+ | 'administrative.country'
24
+ | 'administrative.land_parcel'
25
+ | 'administrative.locality'
26
+ | 'administrative.neighborhood'
27
+ | 'administrative.province'
28
+ | 'landscape'
29
+ | 'landscape.man_made'
30
+ | 'landscape.natural'
31
+ | 'poi'
32
+ | 'poi.attraction'
33
+ | 'poi.business'
34
+ | 'poi.government'
35
+ | 'poi.medical'
36
+ | 'poi.park'
37
+ | 'poi.place_of_worship'
38
+ | 'poi.school'
39
+ | 'poi.sports_complex'
40
+ | 'road'
41
+ | 'road.arterial'
42
+ | 'road.highway'
43
+ | 'road.local'
44
+ | 'transit'
45
+ | 'transit.line'
46
+ | 'transit.station'
47
+ | 'water';
48
+ */
49
+
50
+ export type RNElementType = string;
51
+
52
+ /*
53
+ | 'all'
54
+ | 'geometry'
55
+ | 'geometry.fill'
56
+ | 'geometry.stroke'
57
+ | 'labels'
58
+ | 'labels.icon'
59
+ | 'labels.text'
60
+ | 'labels.text.fill'
61
+ | 'labels.text.stroke'
62
+ */
63
+
64
+ export type RNVisibility = string;
65
+
66
+ /*
67
+ 'on' | 'off' | 'simplified';
68
+ */
69
+
70
+ export interface RNMapStyler {
71
+ color?: string;
72
+ visibility?: RNVisibility;
73
+ weight?: number;
74
+ gamma?: number;
75
+ lightness?: number;
76
+ saturation?: number;
77
+ invert_lightness?: boolean;
78
+ }
79
+
80
+ export interface RNMapStyleElement {
81
+ featureType?: RNFeatureType;
82
+ elementType?: RNElementType;
83
+ stylers: RNMapStyler[];
84
+ }
85
+
86
+ export type RNCamera = {
87
+ center?: RNLatLng;
88
+ zoom?: number;
89
+ bearing?: number;
90
+ tilt?: number;
91
+ };
92
+
93
+ export type RNRegion = {
94
+ center: RNLatLng;
95
+ latitudeDelta: number;
96
+ longitudeDelta: number;
97
+ };
98
+
99
+ export type RNPosition = {
100
+ x: number;
101
+ y: number;
102
+ };
103
+
104
+ export type RNLineCapType = 'butt' | 'round' | 'square';
105
+ export type RNLineJoinType = 'miter' | 'round' | 'bevel';
106
+
107
+ export type RNMarker = {
108
+ id: string;
109
+ zIndex: number;
110
+ coordinate: RNLatLng;
111
+ anchor?: RNPosition;
112
+ width: number;
113
+ height: number;
114
+ iconSvg: string;
115
+ };
116
+
117
+ export type RNPolygon = {
118
+ id: string;
119
+ zIndex: number;
120
+ coordinates: RNLatLng[];
121
+ fillColor?: string;
122
+ strokeColor?: string;
123
+ strokeWidth?: number;
124
+ };
125
+
126
+ export type RNPolyline = {
127
+ id: string;
128
+ zIndex: number;
129
+ coordinates: RNLatLng[];
130
+ lineCap?: RNLineCapType;
131
+ lineJoin?: RNLineJoinType;
132
+ color?: string;
133
+ width?: number;
134
+ };
135
+
136
+ export type RNLocationPermissionResult = {
137
+ android?: RNAndroidLocationPermissionResult;
138
+ ios?: RNIOSPermissionResult;
139
+ };
140
+
141
+ export enum RNAndroidLocationPermissionResult {
142
+ GRANTED = 1,
143
+ DENIED = -1,
144
+ NEVER_ASK_AGAIN = -2,
145
+ }
146
+
147
+ export enum RNIOSPermissionResult {
148
+ DENIED = -1,
149
+ AUTHORIZED = 1,
150
+ }
151
+
152
+ export type RNLocation = {
153
+ center: RNLatLng;
154
+ bearing: number;
155
+ };
156
+
157
+ export enum RNLocationErrorCode {
158
+ PERMISSION_DENIED = 1,
159
+ POSITION_UNAVAILABLE = 2,
160
+ TIMEOUT = 3,
161
+ PLAY_SERVICE_NOT_AVAILABLE = 4,
162
+ SETTINGS_NOT_SATISFIED = 5,
163
+ INTERNAL_ERROR = -1,
164
+ }
165
+
166
+ export enum RNMapErrorCode {
167
+ PLAY_SERVICES_MISSING = 0,
168
+ PLAY_SERVICES_INVALID = 1,
169
+ PLAY_SERVICES_DISABLED = 2,
170
+ PLAY_SERVICES_OUTDATED = 3,
171
+ PLAY_SERVICE_UPDATE_AVAILABLE = 4,
172
+ PLAY_SERVICE_UPDATING = 5,
173
+ UNKNOWN = 6,
174
+ }