react-native-google-maps-plus 1.8.4 → 1.8.6
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.
- package/README.md +107 -129
- package/android/src/main/java/com/rngooglemapsplus/GoogleMapsViewImpl.kt +19 -0
- package/android/src/main/java/com/rngooglemapsplus/MapMarkerBuilder.kt +6 -2
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNUserInterfaceExtension.kt +1 -1
- package/ios/GoogleMapViewImpl.swift +38 -13
- package/ios/MapMarkerBuilder.swift +2 -1
- package/ios/extensions/RNUserInterface+Extension.swift +1 -1
- package/lib/typescript/src/types.d.ts +1 -1
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusModuleSpec.cpp +6 -0
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusModuleSpec.hpp +1 -0
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.cpp +6 -0
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.hpp +1 -0
- package/nitrogen/generated/android/c++/JRNUserInterfaceStyle.hpp +3 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/Func_void_RNIndoorBuilding.kt +0 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/Func_void_RNIndoorLevel.kt +0 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/Func_void_RNLatLng.kt +0 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/Func_void_RNLocation.kt +0 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/Func_void_RNLocationErrorCode.kt +0 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/Func_void_RNMapErrorCode.kt +0 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/Func_void_RNRegion_RNCamera.kt +0 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/Func_void_RNRegion_RNCamera_bool.kt +0 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/Func_void_bool.kt +0 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/Func_void_std__string.kt +0 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/Func_void_std__string_RNLatLng.kt +0 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/Func_void_std__string_std__string_RNLatLng.kt +0 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/HybridRNGoogleMapsPlusModuleSpec.kt +7 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/HybridRNGoogleMapsPlusViewSpec.kt +7 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNAndroidLocationConfig.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNCamera.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNCameraUpdate.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNCircle.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNHeatmap.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNHeatmapGradient.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNHeatmapPoint.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNIOSLocationConfig.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNIndoorBuilding.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNIndoorLevel.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNInitialProps.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNKMLayer.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNLatLng.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNLatLngBounds.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNLocation.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNLocationAndroid.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNLocationConfig.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNLocationIOS.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNLocationPermissionResult.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNMapPadding.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNMapUiSettings.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNMapZoomConfig.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNMarker.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNMarkerSvg.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNPolygon.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNPolygonHole.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNPolyline.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNPosition.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNRegion.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNSize.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNSnapshotOptions.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNUrlTileOverlay.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNUserInterfaceStyle.kt +1 -1
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.hpp +4 -6
- package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusModuleSpecSwift.hpp +3 -0
- package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusViewSpecSwift.hpp +3 -0
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusModuleSpec.swift +8 -0
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusModuleSpec_cxx.swift +10 -1
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec.swift +8 -0
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec_cxx.swift +10 -1
- package/nitrogen/generated/ios/swift/RNHeatmapGradient.swift +15 -11
- package/nitrogen/generated/ios/swift/RNUserInterfaceStyle.swift +4 -4
- package/nitrogen/generated/shared/c++/RNUserInterfaceStyle.hpp +4 -4
- package/package.json +8 -8
- package/src/types.ts +1 -1
package/README.md
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
# react-native-google-maps-plus
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/react-native-google-maps-plus)
|
|
4
|
-
[](https://www.typescriptlang.org/)
|
|
10
|
-
[](https://eslint.org/)
|
|
11
|
-
[](https://reactnative.dev/)
|
|
12
|
-
[](https://developer.android.com/)
|
|
13
|
-
[](https://developer.apple.com/ios/)
|
|
4
|
+
[](https://www.npmjs.com/package/react-native-google-maps-plus)
|
|
5
|
+
[](https://github.com/pinpong/react-native-google-maps-plus/actions/workflows/release.yml)
|
|
6
|
+

|
|
7
|
+

|
|
8
|
+

|
|
14
9
|
|
|
15
10
|
React Native wrapper for Android & iOS Google Maps SDK.
|
|
16
11
|
|
|
@@ -22,6 +17,58 @@ React Native wrapper for Android & iOS Google Maps SDK.
|
|
|
22
17
|
yarn add react-native-google-maps-plus react-native-nitro-modules
|
|
23
18
|
```
|
|
24
19
|
|
|
20
|
+
**iOS**
|
|
21
|
+
|
|
22
|
+
Add this to your Podfile only for bare React Native apps.
|
|
23
|
+
(Not required for Expo, handled by the config plugin.)
|
|
24
|
+
|
|
25
|
+
```ruby
|
|
26
|
+
post_install do |installer|
|
|
27
|
+
react_native_post_install(
|
|
28
|
+
installer,
|
|
29
|
+
config[:reactNativePath],
|
|
30
|
+
:mac_catalyst_enabled => false,
|
|
31
|
+
)
|
|
32
|
+
# Force iOS 16+ to avoid deployment target warnings
|
|
33
|
+
installer.pods_project.targets.each do |target|
|
|
34
|
+
target.build_configurations.each do |config|
|
|
35
|
+
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '16.0'
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# --- SVGKit Patch ---
|
|
40
|
+
require 'fileutils'
|
|
41
|
+
svgkit_path = File.join(installer.sandbox.pod_dir('SVGKit'), 'Source')
|
|
42
|
+
|
|
43
|
+
# node fix
|
|
44
|
+
Dir.glob(File.join(svgkit_path, '**', '*.{h,m}')).each do |file|
|
|
45
|
+
FileUtils.chmod("u+w", file)
|
|
46
|
+
text = File.read(file)
|
|
47
|
+
new_contents = text.gsub('#import "Node.h"', '#import "SVGKit/Node.h"')
|
|
48
|
+
File.open(file, 'w') { |f| f.write(new_contents) }
|
|
49
|
+
# puts "Patched Node import in: #{file}"
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# import CSSValue.h
|
|
53
|
+
Dir.glob(File.join(svgkit_path, '**', '*.{h,m}')).each do |file|
|
|
54
|
+
FileUtils.chmod("u+w", file)
|
|
55
|
+
text = File.read(file)
|
|
56
|
+
new_contents = text.gsub('#import "CSSValue.h"', '#import "SVGKit/CSSValue.h"')
|
|
57
|
+
File.open(file, 'w') { |f| f.write(new_contents) }
|
|
58
|
+
# puts "Patched CSSValue import in: #{file}"
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# import SVGLength.h
|
|
62
|
+
Dir.glob(File.join(svgkit_path, '**', '*.{h,m}')).each do |file|
|
|
63
|
+
FileUtils.chmod("u+w", file)
|
|
64
|
+
text = File.read(file)
|
|
65
|
+
new_contents = text.gsub('#import "SVGLength.h"', '#import "SVGKit/SVGLength.h"')
|
|
66
|
+
File.open(file, 'w') { |f| f.write(new_contents) }
|
|
67
|
+
# puts "Patched SVGLength import in: #{file}"
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
```
|
|
71
|
+
|
|
25
72
|
### Expo Projects
|
|
26
73
|
|
|
27
74
|
Add your keys to the `app.json`.
|
|
@@ -43,148 +90,79 @@ The config plugin automatically injects them into your native Android and iOS bu
|
|
|
43
90
|
}
|
|
44
91
|
```
|
|
45
92
|
|
|
46
|
-
# Dependencies
|
|
47
|
-
|
|
48
|
-
This package builds on native libraries for SVG rendering and Google Maps integration:
|
|
49
|
-
|
|
50
|
-
- **iOS**: [SVGKit](https://github.com/SVGKit/SVGKit)
|
|
51
|
-
- **Android**: [AndroidSVG](https://bigbadaboom.github.io/androidsvg/)
|
|
52
|
-
- **iOS Maps SDK**: [Google Maps SDK for iOS](https://developers.google.com/maps/documentation/ios-sdk)
|
|
53
|
-
- **Android Maps SDK**: [Google Maps SDK for Android](https://developers.google.com/maps/documentation/android-sdk)
|
|
54
|
-
- **Maps Utility Libraries**: [Google Maps Utils for iOS](https://developers.google.com/maps/documentation/ios-sdk/utility) and [Google Maps Utils for Android](https://developers.google.com/maps/documentation/android-sdk/utility)
|
|
55
|
-
|
|
56
|
-
These are automatically linked when you install the package, but you may need to clean/rebuild your native projects after first install.
|
|
57
|
-
|
|
58
93
|
## Setup API Key
|
|
59
94
|
|
|
60
95
|
You will need a valid **Google Maps API Key** from the [Google Cloud Console](https://console.cloud.google.com/).
|
|
61
96
|
|
|
62
97
|
### Android
|
|
63
98
|
|
|
64
|
-
|
|
99
|
+
**Note:** These instructions apply to **bare React Native apps only**.
|
|
100
|
+
Expo projects should use the config plugin instead (see Expo section above).
|
|
65
101
|
|
|
66
|
-
|
|
102
|
+
See the official [Google Maps Android SDK configuration guide](https://developers.google.com/maps/documentation/android-sdk/config#step_3_add_your_api_key_to_the_project) for more details.
|
|
67
103
|
|
|
68
104
|
### iOS
|
|
69
105
|
|
|
70
|
-
|
|
106
|
+
**Note:** These instructions apply to **bare React Native apps only**.
|
|
107
|
+
Expo projects should use the config plugin instead (see Expo section above).
|
|
71
108
|
|
|
72
|
-
|
|
109
|
+
See the official [Google Maps iOS SDK configuration guide](https://developers.google.com/maps/documentation/ios-sdk/config#get-key) for more details.
|
|
73
110
|
|
|
74
|
-
|
|
75
|
-
MAPS_API_KEY=YOUR_IOS_MAPS_API_KEY
|
|
76
|
-
```
|
|
111
|
+
## Dependencies & Native Documentation
|
|
77
112
|
|
|
78
|
-
|
|
113
|
+
This package is React Native wrapper around the official Google Maps SDKs.
|
|
114
|
+
For full API behavior, configuration options, and feature reference, please consult the native documentation:
|
|
79
115
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
```
|
|
116
|
+
- **iOS Google Maps SDK**
|
|
117
|
+
https://developers.google.com/maps/documentation/ios-sdk
|
|
83
118
|
|
|
84
|
-
|
|
119
|
+
- **Android Google Maps SDK**
|
|
120
|
+
https://developers.google.com/maps/documentation/android-sdk
|
|
85
121
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
```
|
|
122
|
+
- **Maps Utility Libraries (iOS & Android)**
|
|
123
|
+
https://developers.google.com/maps/documentation/ios-sdk/utility
|
|
124
|
+
https://developers.google.com/maps/documentation/android-sdk/utility
|
|
90
125
|
|
|
91
|
-
|
|
126
|
+
- **SVG Rendering** (used for custom marker icons)
|
|
127
|
+
- iOS: https://github.com/SVGKit/SVGKit
|
|
128
|
+
- Android: https://bigbadaboom.github.io/androidsvg/
|
|
92
129
|
|
|
93
|
-
|
|
94
|
-
|
|
130
|
+
These libraries are automatically linked during installation.
|
|
131
|
+
If you encounter build issues, try cleaning and rebuilding your native project.
|
|
95
132
|
|
|
96
|
-
|
|
97
|
-
class AppDelegate: UIResponder, UIApplicationDelegate {
|
|
98
|
-
func application(_ application: UIApplication,
|
|
99
|
-
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
|
100
|
-
if let apiKey = Bundle.main.object(forInfoDictionaryKey: "MAPS_API_KEY") as? String {
|
|
101
|
-
GMSServices.provideAPIKey(apiKey)
|
|
102
|
-
}
|
|
103
|
-
return true
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
---
|
|
133
|
+
> **Note:** This package follows the native SDKs closely. Props and behavior match the underlying Google Maps APIs whenever possible.
|
|
109
134
|
|
|
110
135
|
## Usage
|
|
111
136
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
# Force iOS 16+ to avoid deployment target warnings
|
|
140
|
-
installer.pods_project.targets.each do |target|
|
|
141
|
-
target.build_configurations.each do |config|
|
|
142
|
-
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '16.0'
|
|
143
|
-
end
|
|
144
|
-
end
|
|
145
|
-
|
|
146
|
-
# --- SVGKit Patch ---
|
|
147
|
-
require 'fileutils'
|
|
148
|
-
svgkit_path = File.join(installer.sandbox.pod_dir('SVGKit'), 'Source')
|
|
149
|
-
|
|
150
|
-
# node fix
|
|
151
|
-
Dir.glob(File.join(svgkit_path, '**', '*.{h,m}')).each do |file|
|
|
152
|
-
FileUtils.chmod("u+w", file)
|
|
153
|
-
text = File.read(file)
|
|
154
|
-
new_contents = text.gsub('#import "Node.h"', '#import "SVGKit/Node.h"')
|
|
155
|
-
File.open(file, 'w') { |f| f.write(new_contents) }
|
|
156
|
-
# puts "Patched Node import in: #{file}"
|
|
157
|
-
end
|
|
158
|
-
|
|
159
|
-
# import CSSValue.h
|
|
160
|
-
Dir.glob(File.join(svgkit_path, '**', '*.{h,m}')).each do |file|
|
|
161
|
-
FileUtils.chmod("u+w", file)
|
|
162
|
-
text = File.read(file)
|
|
163
|
-
new_contents = text.gsub('#import "CSSValue.h"', '#import "SVGKit/CSSValue.h"')
|
|
164
|
-
File.open(file, 'w') { |f| f.write(new_contents) }
|
|
165
|
-
# puts "Patched CSSValue import in: #{file}"
|
|
166
|
-
end
|
|
167
|
-
|
|
168
|
-
# import SVGLength.h
|
|
169
|
-
Dir.glob(File.join(svgkit_path, '**', '*.{h,m}')).each do |file|
|
|
170
|
-
FileUtils.chmod("u+w", file)
|
|
171
|
-
text = File.read(file)
|
|
172
|
-
new_contents = text.gsub('#import "SVGLength.h"', '#import "SVGKit/SVGLength.h"')
|
|
173
|
-
File.open(file, 'w') { |f| f.write(new_contents) }
|
|
174
|
-
# puts "Patched SVGLength import in: #{file}"
|
|
175
|
-
end
|
|
176
|
-
end
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
After applying this, run:
|
|
180
|
-
|
|
181
|
-
```sh
|
|
182
|
-
cd ios && pod install --repo-update
|
|
183
|
-
```
|
|
137
|
+
Basic map:
|
|
138
|
+
|
|
139
|
+
```tsx
|
|
140
|
+
import React from 'react';
|
|
141
|
+
import { GoogleMapsView } from 'react-native-google-maps-plus';
|
|
142
|
+
|
|
143
|
+
export default function App() {
|
|
144
|
+
return (
|
|
145
|
+
<GoogleMapsView
|
|
146
|
+
style={{ flex: 1 }}
|
|
147
|
+
initialProps={{
|
|
148
|
+
camera: {
|
|
149
|
+
center: { latitude: 37.7749, longitude: -122.4194 },
|
|
150
|
+
zoom: 12,
|
|
151
|
+
},
|
|
152
|
+
}}
|
|
153
|
+
markers={[
|
|
154
|
+
{
|
|
155
|
+
id: '1',
|
|
156
|
+
zIndex: 1,
|
|
157
|
+
coordinate: { latitude: 37.7749, longitude: -122.4194 },
|
|
158
|
+
},
|
|
159
|
+
]}
|
|
160
|
+
/>
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
```
|
|
184
164
|
|
|
185
|
-
|
|
186
|
-
- Check that your API key has **Maps SDK for Android/iOS** enabled in Google Cloud Console.
|
|
187
|
-
- Make sure the key is not restricted to wrong bundle IDs or SHA1 fingerprints.
|
|
165
|
+
Check out the example app in the [example](./example) folder.
|
|
188
166
|
|
|
189
167
|
## Contributing
|
|
190
168
|
|
|
@@ -5,6 +5,8 @@ import MarkerTag
|
|
|
5
5
|
import PolygonTag
|
|
6
6
|
import PolylineTag
|
|
7
7
|
import android.annotation.SuppressLint
|
|
8
|
+
import android.content.ComponentCallbacks2
|
|
9
|
+
import android.content.res.Configuration
|
|
8
10
|
import android.graphics.Bitmap
|
|
9
11
|
import android.location.Location
|
|
10
12
|
import android.util.Size
|
|
@@ -105,8 +107,24 @@ class GoogleMapsViewImpl(
|
|
|
105
107
|
|
|
106
108
|
private var cameraMoveReason = -1
|
|
107
109
|
|
|
110
|
+
val componentCallbacks =
|
|
111
|
+
object : ComponentCallbacks2 {
|
|
112
|
+
override fun onConfigurationChanged(newConfig: Configuration) {}
|
|
113
|
+
|
|
114
|
+
override fun onLowMemory() {
|
|
115
|
+
mapView?.onLowMemory()
|
|
116
|
+
markerBuilder.clearIconCache()
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
override fun onTrimMemory(level: Int) {
|
|
120
|
+
mapView?.onLowMemory()
|
|
121
|
+
markerBuilder.cancelAllJobs()
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
108
125
|
init {
|
|
109
126
|
MapsInitializer.initialize(reactContext)
|
|
127
|
+
reactContext.registerComponentCallbacks(componentCallbacks)
|
|
110
128
|
reactContext.addLifecycleEventListener(this)
|
|
111
129
|
}
|
|
112
130
|
|
|
@@ -822,6 +840,7 @@ class GoogleMapsViewImpl(
|
|
|
822
840
|
removeAllViews()
|
|
823
841
|
}
|
|
824
842
|
super.removeAllViews()
|
|
843
|
+
reactContext.unregisterComponentCallbacks(componentCallbacks)
|
|
825
844
|
reactContext.removeLifecycleEventListener(this)
|
|
826
845
|
initialized = false
|
|
827
846
|
}
|
|
@@ -45,7 +45,7 @@ class MapMarkerBuilder(
|
|
|
45
45
|
private val scope: CoroutineScope = CoroutineScope(SupervisorJob() + Dispatchers.Default),
|
|
46
46
|
) {
|
|
47
47
|
private val iconCache =
|
|
48
|
-
object : LruCache<Int, BitmapDescriptor>(
|
|
48
|
+
object : LruCache<Int, BitmapDescriptor>(256) {
|
|
49
49
|
override fun sizeOf(
|
|
50
50
|
key: Int,
|
|
51
51
|
value: BitmapDescriptor,
|
|
@@ -281,7 +281,7 @@ class MapMarkerBuilder(
|
|
|
281
281
|
onReady(desc)
|
|
282
282
|
}
|
|
283
283
|
} catch (_: OutOfMemoryError) {
|
|
284
|
-
|
|
284
|
+
clearIconCache()
|
|
285
285
|
withContext(Dispatchers.Main) {
|
|
286
286
|
ensureActive()
|
|
287
287
|
onReady(null)
|
|
@@ -310,6 +310,10 @@ class MapMarkerBuilder(
|
|
|
310
310
|
jobsById[id]?.cancel()
|
|
311
311
|
}
|
|
312
312
|
jobsById.clear()
|
|
313
|
+
clearIconCache()
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
fun clearIconCache() {
|
|
313
317
|
iconCache.evictAll()
|
|
314
318
|
}
|
|
315
319
|
|
|
@@ -7,6 +7,6 @@ fun RNUserInterfaceStyle?.toMapColorScheme(): Int? =
|
|
|
7
7
|
when (this) {
|
|
8
8
|
RNUserInterfaceStyle.LIGHT -> MapColorScheme.LIGHT
|
|
9
9
|
RNUserInterfaceStyle.DARK -> MapColorScheme.DARK
|
|
10
|
-
RNUserInterfaceStyle.
|
|
10
|
+
RNUserInterfaceStyle.SYSTEM -> MapColorScheme.FOLLOW_SYSTEM
|
|
11
11
|
null -> null
|
|
12
12
|
}
|
|
@@ -42,19 +42,39 @@ GMSIndoorDisplayDelegate {
|
|
|
42
42
|
setupAppLifecycleObservers()
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
@MainActor
|
|
46
|
+
private var lifecycleTasks = [Task<Void, Never>]()
|
|
47
|
+
|
|
45
48
|
@MainActor
|
|
46
49
|
private func setupAppLifecycleObservers() {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
lifecycleTasks.append(
|
|
51
|
+
Task { @MainActor in
|
|
52
|
+
for await _ in NotificationCenter.default.notifications(
|
|
53
|
+
named: UIApplication.didBecomeActiveNotification
|
|
54
|
+
) {
|
|
55
|
+
appDidBecomeActive()
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
lifecycleTasks.append(
|
|
61
|
+
Task { @MainActor in
|
|
62
|
+
for await _ in NotificationCenter.default.notifications(
|
|
63
|
+
named: UIApplication.didEnterBackgroundNotification
|
|
64
|
+
) {
|
|
65
|
+
appDidEnterBackground()
|
|
66
|
+
}
|
|
67
|
+
}
|
|
52
68
|
)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
69
|
+
|
|
70
|
+
lifecycleTasks.append(
|
|
71
|
+
Task { @MainActor in
|
|
72
|
+
for await _ in NotificationCenter.default.notifications(
|
|
73
|
+
named: UIApplication.didReceiveMemoryWarningNotification
|
|
74
|
+
) {
|
|
75
|
+
onLowMemory()
|
|
76
|
+
}
|
|
77
|
+
}
|
|
58
78
|
)
|
|
59
79
|
}
|
|
60
80
|
|
|
@@ -688,16 +708,20 @@ GMSIndoorDisplayDelegate {
|
|
|
688
708
|
}
|
|
689
709
|
}
|
|
690
710
|
|
|
691
|
-
|
|
711
|
+
private func appDidBecomeActive() {
|
|
692
712
|
if window != nil {
|
|
693
713
|
locationHandler.start()
|
|
694
714
|
}
|
|
695
715
|
}
|
|
696
716
|
|
|
697
|
-
|
|
717
|
+
private func appDidEnterBackground() {
|
|
698
718
|
locationHandler.stop()
|
|
699
719
|
}
|
|
700
720
|
|
|
721
|
+
private func onLowMemory() {
|
|
722
|
+
markerBuilder.cancelAllIconTasks()
|
|
723
|
+
}
|
|
724
|
+
|
|
701
725
|
override func didMoveToWindow() {
|
|
702
726
|
super.didMoveToWindow()
|
|
703
727
|
if window != nil {
|
|
@@ -708,8 +732,9 @@ GMSIndoorDisplayDelegate {
|
|
|
708
732
|
}
|
|
709
733
|
|
|
710
734
|
deinit {
|
|
711
|
-
NotificationCenter.default.removeObserver(self)
|
|
712
735
|
deinitInternal()
|
|
736
|
+
lifecycleTasks.forEach { $0.cancel() }
|
|
737
|
+
lifecycleTasks.removeAll()
|
|
713
738
|
}
|
|
714
739
|
|
|
715
740
|
func mapViewDidFinishTileRendering(_ mapView: GMSMapView) {
|
|
@@ -5,7 +5,7 @@ import UIKit
|
|
|
5
5
|
final class MapMarkerBuilder {
|
|
6
6
|
private let iconCache: NSCache<NSNumber, UIImage> = {
|
|
7
7
|
let c = NSCache<NSNumber, UIImage>()
|
|
8
|
-
c.countLimit =
|
|
8
|
+
c.countLimit = 256
|
|
9
9
|
return c
|
|
10
10
|
}()
|
|
11
11
|
private var tasks: [String: Task<Void, Never>] = [:]
|
|
@@ -205,6 +205,7 @@ final class MapMarkerBuilder {
|
|
|
205
205
|
}
|
|
206
206
|
tasks.removeAll()
|
|
207
207
|
iconCache.removeAllObjects()
|
|
208
|
+
CATransaction.flush()
|
|
208
209
|
}
|
|
209
210
|
|
|
210
211
|
@MainActor
|
|
@@ -49,7 +49,7 @@ export type RNMapPadding = {
|
|
|
49
49
|
right: number;
|
|
50
50
|
};
|
|
51
51
|
export type RNMapType = 'none' | 'normal' | 'hybrid' | 'satellite' | 'terrain';
|
|
52
|
-
export type RNUserInterfaceStyle = 'light' | 'dark' | '
|
|
52
|
+
export type RNUserInterfaceStyle = 'light' | 'dark' | 'system';
|
|
53
53
|
export type RNFeatureType = string;
|
|
54
54
|
export type RNElementType = string;
|
|
55
55
|
export type RNVisibility = string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAChF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAE7D,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,2BAA2B,CAAC,CAAC;AAExE,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,+BAA+B,CAAC,EAAE,OAAO,CAAC;IAC1C,W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|
|
|
49
|
+
std::string JHybridRNGoogleMapsPlusModuleSpec::toString() {
|
|
50
|
+
static const auto method = javaClassStatic()->getMethod<jni::JString()>("toString");
|
|
51
|
+
auto javaString = method(_javaPart);
|
|
52
|
+
return javaString->toStdString();
|
|
53
|
+
}
|
|
54
|
+
|
|
49
55
|
// Properties
|
|
50
56
|
|
|
51
57
|
|
|
@@ -41,6 +41,7 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
41
41
|
public:
|
|
42
42
|
size_t getExternalMemorySize() noexcept override;
|
|
43
43
|
void dispose() noexcept override;
|
|
44
|
+
std::string toString() override;
|
|
44
45
|
|
|
45
46
|
public:
|
|
46
47
|
inline const jni::global_ref<JHybridRNGoogleMapsPlusModuleSpec::javaobject>& getJavaPart() const noexcept {
|
|
@@ -225,6 +225,12 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
225
225
|
method(_javaPart);
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
+
std::string JHybridRNGoogleMapsPlusViewSpec::toString() {
|
|
229
|
+
static const auto method = javaClassStatic()->getMethod<jni::JString()>("toString");
|
|
230
|
+
auto javaString = method(_javaPart);
|
|
231
|
+
return javaString->toStdString();
|
|
232
|
+
}
|
|
233
|
+
|
|
228
234
|
// Properties
|
|
229
235
|
std::optional<RNInitialProps> JHybridRNGoogleMapsPlusViewSpec::getInitialProps() {
|
|
230
236
|
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JRNInitialProps>()>("getInitialProps");
|
|
@@ -41,6 +41,7 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
41
41
|
public:
|
|
42
42
|
size_t getExternalMemorySize() noexcept override;
|
|
43
43
|
void dispose() noexcept override;
|
|
44
|
+
std::string toString() override;
|
|
44
45
|
|
|
45
46
|
public:
|
|
46
47
|
inline const jni::global_ref<JHybridRNGoogleMapsPlusViewSpec::javaobject>& getJavaPart() const noexcept {
|
|
@@ -43,15 +43,15 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
43
43
|
static const auto clazz = javaClassStatic();
|
|
44
44
|
static const auto fieldLIGHT = clazz->getStaticField<JRNUserInterfaceStyle>("LIGHT");
|
|
45
45
|
static const auto fieldDARK = clazz->getStaticField<JRNUserInterfaceStyle>("DARK");
|
|
46
|
-
static const auto
|
|
46
|
+
static const auto fieldSYSTEM = clazz->getStaticField<JRNUserInterfaceStyle>("SYSTEM");
|
|
47
47
|
|
|
48
48
|
switch (value) {
|
|
49
49
|
case RNUserInterfaceStyle::LIGHT:
|
|
50
50
|
return clazz->getStaticFieldValue(fieldLIGHT);
|
|
51
51
|
case RNUserInterfaceStyle::DARK:
|
|
52
52
|
return clazz->getStaticFieldValue(fieldDARK);
|
|
53
|
-
case RNUserInterfaceStyle::
|
|
54
|
-
return clazz->getStaticFieldValue(
|
|
53
|
+
case RNUserInterfaceStyle::SYSTEM:
|
|
54
|
+
return clazz->getStaticFieldValue(fieldSYSTEM);
|
|
55
55
|
default:
|
|
56
56
|
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
57
57
|
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|