react-native-google-maps-plus 1.7.0-dev.6 → 1.7.0-dev.8
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/android/src/main/java/com/rngooglemapsplus/GoogleMapsViewImpl.kt +354 -487
- package/android/src/main/java/com/rngooglemapsplus/MapCircleBuilder.kt +2 -1
- package/android/src/main/java/com/rngooglemapsplus/MapHeatmapBuilder.kt +1 -1
- package/android/src/main/java/com/rngooglemapsplus/MapHelper.kt +22 -0
- package/android/src/main/java/com/rngooglemapsplus/MapMarkerBuilder.kt +4 -2
- package/android/src/main/java/com/rngooglemapsplus/MapPolygonBuilder.kt +2 -1
- package/android/src/main/java/com/rngooglemapsplus/MapPolylineBuilder.kt.kt +2 -1
- package/android/src/main/java/com/rngooglemapsplus/RNGoogleMapsPlusView.kt +11 -22
- package/ios/GoogleMapViewImpl.swift +8 -2
- package/ios/MapCircleBuilder.swift +2 -0
- package/ios/MapHeatmapBuilder.swift +2 -1
- package/ios/MapMarkerBuilder.swift +4 -0
- package/ios/MapPolygonBuilder.swift +2 -0
- package/ios/MapPolylineBuilder.swift +2 -0
- package/ios/MapUrlTileOverlayBuilder.swift +1 -0
- package/ios/RNGoogleMapsPlusView.swift +5 -5
- package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts +1 -1
- package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts.map +1 -1
- package/nitrogen/generated/android/RNGoogleMapsPlusOnLoad.cpp +2 -0
- package/nitrogen/generated/android/c++/JFunc_void_RNRegion_RNCamera.hpp +83 -0
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.cpp +19 -18
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.hpp +2 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/Func_void_RNRegion_RNCamera.kt +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/HybridRNGoogleMapsPlusViewSpec.kt +3 -3
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.cpp +8 -0
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.hpp +29 -7
- package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusViewSpecSwift.hpp +8 -8
- package/nitrogen/generated/ios/swift/Func_void_RNRegion_RNCamera.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec_cxx.swift +12 -12
- package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.hpp +8 -8
- package/nitrogen/generated/shared/c++/views/HybridRNGoogleMapsPlusViewComponent.cpp +2 -2
- package/nitrogen/generated/shared/c++/views/HybridRNGoogleMapsPlusViewComponent.hpp +3 -3
- package/package.json +4 -2
- package/src/RNGoogleMapsPlusView.nitro.ts +1 -1
|
@@ -4,6 +4,7 @@ import android.graphics.Color
|
|
|
4
4
|
import com.facebook.react.uimanager.PixelUtil.dpToPx
|
|
5
5
|
import com.google.android.gms.maps.model.Circle
|
|
6
6
|
import com.google.android.gms.maps.model.CircleOptions
|
|
7
|
+
import com.rngooglemapsplus.extensions.onUi
|
|
7
8
|
import com.rngooglemapsplus.extensions.toColor
|
|
8
9
|
import com.rngooglemapsplus.extensions.toLatLng
|
|
9
10
|
|
|
@@ -23,7 +24,7 @@ class MapCircleBuilder {
|
|
|
23
24
|
prev: RNCircle,
|
|
24
25
|
next: RNCircle,
|
|
25
26
|
circle: Circle,
|
|
26
|
-
) {
|
|
27
|
+
) = onUi {
|
|
27
28
|
if (prev.center.latitude != next.center.latitude ||
|
|
28
29
|
prev.center.longitude != next.center.longitude
|
|
29
30
|
) {
|
|
@@ -19,7 +19,7 @@ class MapHeatmapBuilder {
|
|
|
19
19
|
heatmap.gradient?.let {
|
|
20
20
|
val colors = it.colors.map { c -> c.toColor() }.toIntArray()
|
|
21
21
|
val startPoints = it.startPoints.map { p -> p.toFloat() }.toFloatArray()
|
|
22
|
-
gradient(Gradient(colors, startPoints))
|
|
22
|
+
gradient(Gradient(colors, startPoints, it.colorMapSize.toInt()))
|
|
23
23
|
}
|
|
24
24
|
}.build()
|
|
25
25
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
package com.rngooglemapsplus.extensions
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.UiThreadUtil
|
|
4
|
+
import kotlinx.coroutines.CompletableDeferred
|
|
5
|
+
import kotlinx.coroutines.runBlocking
|
|
6
|
+
|
|
7
|
+
inline fun onUi(crossinline block: () -> Unit) {
|
|
8
|
+
if (UiThreadUtil.isOnUiThread()) {
|
|
9
|
+
block()
|
|
10
|
+
} else {
|
|
11
|
+
UiThreadUtil.runOnUiThread { block() }
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
inline fun <T> onUiSync(crossinline block: () -> T): T {
|
|
16
|
+
if (UiThreadUtil.isOnUiThread()) return block()
|
|
17
|
+
val result = CompletableDeferred<T>()
|
|
18
|
+
UiThreadUtil.runOnUiThread {
|
|
19
|
+
runCatching(block).onSuccess(result::complete).onFailure(result::completeExceptionally)
|
|
20
|
+
}
|
|
21
|
+
return runBlocking { result.await() }
|
|
22
|
+
}
|
|
@@ -16,6 +16,7 @@ import com.google.android.gms.maps.model.BitmapDescriptorFactory
|
|
|
16
16
|
import com.google.android.gms.maps.model.Marker
|
|
17
17
|
import com.google.android.gms.maps.model.MarkerOptions
|
|
18
18
|
import com.rngooglemapsplus.extensions.markerStyleEquals
|
|
19
|
+
import com.rngooglemapsplus.extensions.onUi
|
|
19
20
|
import com.rngooglemapsplus.extensions.styleHash
|
|
20
21
|
import com.rngooglemapsplus.extensions.toLatLng
|
|
21
22
|
import kotlinx.coroutines.CoroutineScope
|
|
@@ -28,6 +29,7 @@ import kotlinx.coroutines.withContext
|
|
|
28
29
|
import java.net.HttpURLConnection
|
|
29
30
|
import java.net.URL
|
|
30
31
|
import java.net.URLDecoder
|
|
32
|
+
import java.util.concurrent.ConcurrentHashMap
|
|
31
33
|
import kotlin.coroutines.coroutineContext
|
|
32
34
|
|
|
33
35
|
class MapMarkerBuilder(
|
|
@@ -42,7 +44,7 @@ class MapMarkerBuilder(
|
|
|
42
44
|
): Int = 1
|
|
43
45
|
}
|
|
44
46
|
|
|
45
|
-
private val jobsById =
|
|
47
|
+
private val jobsById = ConcurrentHashMap<String, Job>()
|
|
46
48
|
|
|
47
49
|
init {
|
|
48
50
|
// / TODO: refactor with androidsvg 1.5 release
|
|
@@ -162,7 +164,7 @@ class MapMarkerBuilder(
|
|
|
162
164
|
prev: RNMarker,
|
|
163
165
|
next: RNMarker,
|
|
164
166
|
marker: Marker,
|
|
165
|
-
) {
|
|
167
|
+
) = onUi {
|
|
166
168
|
if (prev.coordinate.latitude != next.coordinate.latitude ||
|
|
167
169
|
prev.coordinate.longitude != next.coordinate.longitude
|
|
168
170
|
) {
|
|
@@ -4,6 +4,7 @@ import android.graphics.Color
|
|
|
4
4
|
import com.facebook.react.uimanager.PixelUtil.dpToPx
|
|
5
5
|
import com.google.android.gms.maps.model.Polygon
|
|
6
6
|
import com.google.android.gms.maps.model.PolygonOptions
|
|
7
|
+
import com.rngooglemapsplus.extensions.onUi
|
|
7
8
|
import com.rngooglemapsplus.extensions.toColor
|
|
8
9
|
import com.rngooglemapsplus.extensions.toLatLng
|
|
9
10
|
|
|
@@ -30,7 +31,7 @@ class MapPolygonBuilder {
|
|
|
30
31
|
prev: RNPolygon,
|
|
31
32
|
next: RNPolygon,
|
|
32
33
|
poly: Polygon,
|
|
33
|
-
) {
|
|
34
|
+
) = onUi {
|
|
34
35
|
val coordsChanged =
|
|
35
36
|
prev.coordinates.size != next.coordinates.size ||
|
|
36
37
|
!prev.coordinates.zip(next.coordinates).all { (a, b) ->
|
|
@@ -9,6 +9,7 @@ import com.google.android.gms.maps.model.Polyline
|
|
|
9
9
|
import com.google.android.gms.maps.model.PolylineOptions
|
|
10
10
|
import com.google.android.gms.maps.model.RoundCap
|
|
11
11
|
import com.google.android.gms.maps.model.SquareCap
|
|
12
|
+
import com.rngooglemapsplus.extensions.onUi
|
|
12
13
|
import com.rngooglemapsplus.extensions.toColor
|
|
13
14
|
import com.rngooglemapsplus.extensions.toLatLng
|
|
14
15
|
|
|
@@ -34,7 +35,7 @@ class MapPolylineBuilder {
|
|
|
34
35
|
prev: RNPolyline,
|
|
35
36
|
next: RNPolyline,
|
|
36
37
|
polyline: Polyline,
|
|
37
|
-
) {
|
|
38
|
+
) = onUi {
|
|
38
39
|
val coordsChanged =
|
|
39
40
|
prev.coordinates.size != next.coordinates.size ||
|
|
40
41
|
!prev.coordinates.zip(next.coordinates).all { (a, b) ->
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
package com.rngooglemapsplus
|
|
2
2
|
|
|
3
3
|
import com.facebook.proguard.annotations.DoNotStrip
|
|
4
|
-
import com.facebook.react.bridge.UiThreadUtil
|
|
5
4
|
import com.facebook.react.uimanager.ThemedReactContext
|
|
6
5
|
import com.google.android.gms.maps.GoogleMapOptions
|
|
7
6
|
import com.google.android.gms.maps.model.MapStyleOptions
|
|
@@ -155,7 +154,7 @@ class RNGoogleMapsPlusView(
|
|
|
155
154
|
|
|
156
155
|
!prev.markerEquals(next) ->
|
|
157
156
|
view.updateMarker(id) { marker ->
|
|
158
|
-
|
|
157
|
+
markerBuilder.update(prev, next, marker)
|
|
159
158
|
}
|
|
160
159
|
}
|
|
161
160
|
}
|
|
@@ -179,7 +178,7 @@ class RNGoogleMapsPlusView(
|
|
|
179
178
|
|
|
180
179
|
!prev.polylineEquals(next) ->
|
|
181
180
|
view.updatePolyline(id) { polyline ->
|
|
182
|
-
|
|
181
|
+
polylineBuilder.update(prev, next, polyline)
|
|
183
182
|
}
|
|
184
183
|
}
|
|
185
184
|
}
|
|
@@ -204,7 +203,7 @@ class RNGoogleMapsPlusView(
|
|
|
204
203
|
|
|
205
204
|
!prev.polygonEquals(next) ->
|
|
206
205
|
view.updatePolygon(id) { polygon ->
|
|
207
|
-
|
|
206
|
+
polygonBuilder.update(prev, next, polygon)
|
|
208
207
|
}
|
|
209
208
|
}
|
|
210
209
|
}
|
|
@@ -229,7 +228,7 @@ class RNGoogleMapsPlusView(
|
|
|
229
228
|
|
|
230
229
|
!prev.circleEquals(next) ->
|
|
231
230
|
view.updateCircle(id) { circle ->
|
|
232
|
-
|
|
231
|
+
circleBuilder.update(prev, next, circle)
|
|
233
232
|
}
|
|
234
233
|
}
|
|
235
234
|
}
|
|
@@ -296,7 +295,7 @@ class RNGoogleMapsPlusView(
|
|
|
296
295
|
view.onMapReady = cb
|
|
297
296
|
}
|
|
298
297
|
|
|
299
|
-
override var onMapLoaded: ((
|
|
298
|
+
override var onMapLoaded: ((RNRegion, RNCamera) -> Unit)? = null
|
|
300
299
|
set(cb) {
|
|
301
300
|
view.onMapLoaded = cb
|
|
302
301
|
}
|
|
@@ -416,14 +415,12 @@ class RNGoogleMapsPlusView(
|
|
|
416
415
|
animated: Boolean?,
|
|
417
416
|
durationMs: Double?,
|
|
418
417
|
) {
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
)
|
|
426
|
-
}
|
|
418
|
+
val current = view.currentCamera
|
|
419
|
+
view.setCamera(
|
|
420
|
+
camera.toCameraPosition(current),
|
|
421
|
+
animated == true,
|
|
422
|
+
durationMs?.toInt() ?: 3000,
|
|
423
|
+
)
|
|
427
424
|
}
|
|
428
425
|
|
|
429
426
|
override fun setCameraToCoordinates(
|
|
@@ -481,11 +478,3 @@ class RNGoogleMapsPlusView(
|
|
|
481
478
|
|
|
482
479
|
override fun isGooglePlayServicesAvailable(): Boolean = playServiceHandler.isPlayServicesAvailable()
|
|
483
480
|
}
|
|
484
|
-
|
|
485
|
-
private inline fun onUi(crossinline block: () -> Unit) {
|
|
486
|
-
if (UiThreadUtil.isOnUiThread()) {
|
|
487
|
-
block()
|
|
488
|
-
} else {
|
|
489
|
-
UiThreadUtil.runOnUiThread { block() }
|
|
490
|
-
}
|
|
491
|
-
}
|
|
@@ -261,7 +261,7 @@ GMSIndoorDisplayDelegate {
|
|
|
261
261
|
|
|
262
262
|
var onMapError: ((RNMapErrorCode) -> Void)?
|
|
263
263
|
var onMapReady: ((Bool) -> Void)?
|
|
264
|
-
var onMapLoaded: ((
|
|
264
|
+
var onMapLoaded: ((RNRegion, RNCamera) -> Void)?
|
|
265
265
|
var onLocationUpdate: ((RNLocation) -> Void)?
|
|
266
266
|
var onLocationError: ((_ error: RNLocationErrorCode) -> Void)?
|
|
267
267
|
var onMapPress: ((RNLatLng) -> Void)?
|
|
@@ -703,10 +703,14 @@ GMSIndoorDisplayDelegate {
|
|
|
703
703
|
func mapViewDidFinishTileRendering(_ mapView: GMSMapView) {
|
|
704
704
|
guard !loaded else { return }
|
|
705
705
|
loaded = true
|
|
706
|
-
|
|
706
|
+
let visibleRegion = mapView.projection.visibleRegion().toRNRegion()
|
|
707
|
+
let camera = mapView.camera.toRNCamera()
|
|
708
|
+
|
|
709
|
+
self.onMapLoaded?(visibleRegion, camera)
|
|
707
710
|
}
|
|
708
711
|
|
|
709
712
|
func mapView(_ mapView: GMSMapView, willMove gesture: Bool) {
|
|
713
|
+
if !loaded { return }
|
|
710
714
|
onMain {
|
|
711
715
|
self.cameraMoveReasonIsGesture = gesture
|
|
712
716
|
|
|
@@ -718,6 +722,7 @@ GMSIndoorDisplayDelegate {
|
|
|
718
722
|
}
|
|
719
723
|
|
|
720
724
|
func mapView(_ mapView: GMSMapView, didChange position: GMSCameraPosition) {
|
|
725
|
+
if !loaded { return }
|
|
721
726
|
onMain {
|
|
722
727
|
let visibleRegion = mapView.projection.visibleRegion().toRNRegion()
|
|
723
728
|
let camera = mapView.camera.toRNCamera()
|
|
@@ -728,6 +733,7 @@ GMSIndoorDisplayDelegate {
|
|
|
728
733
|
}
|
|
729
734
|
|
|
730
735
|
func mapView(_ mapView: GMSMapView, idleAt position: GMSCameraPosition) {
|
|
736
|
+
if !loaded { return }
|
|
731
737
|
onMain {
|
|
732
738
|
let visibleRegion = mapView.projection.visibleRegion().toRNRegion()
|
|
733
739
|
let camera = mapView.camera.toRNCamera()
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import GoogleMaps
|
|
2
2
|
|
|
3
3
|
final class MapCircleBuilder {
|
|
4
|
+
@MainActor
|
|
4
5
|
func build(_ c: RNCircle) -> GMSCircle {
|
|
5
6
|
let circle = GMSCircle()
|
|
6
7
|
circle.position = c.center.toCLLocationCoordinate2D()
|
|
@@ -14,6 +15,7 @@ final class MapCircleBuilder {
|
|
|
14
15
|
return circle
|
|
15
16
|
}
|
|
16
17
|
|
|
18
|
+
@MainActor
|
|
17
19
|
func update(_ prev: RNCircle, _ next: RNCircle, _ c: GMSCircle) {
|
|
18
20
|
if prev.center.latitude != next.center.latitude
|
|
19
21
|
|| prev.center.longitude != next.center.longitude {
|
|
@@ -4,6 +4,7 @@ import GoogleMapsUtils
|
|
|
4
4
|
import UIKit
|
|
5
5
|
|
|
6
6
|
final class MapHeatmapBuilder {
|
|
7
|
+
@MainActor
|
|
7
8
|
func build(_ h: RNHeatmap) -> GMUHeatmapTileLayer {
|
|
8
9
|
let heatmap = GMUHeatmapTileLayer()
|
|
9
10
|
heatmap.weightedData = h.weightedData.toWeightedLatLngs()
|
|
@@ -18,7 +19,7 @@ final class MapHeatmapBuilder {
|
|
|
18
19
|
heatmap.gradient = GMUGradient(
|
|
19
20
|
colors: colors,
|
|
20
21
|
startPoints: startPoints,
|
|
21
|
-
colorMapSize:
|
|
22
|
+
colorMapSize: UInt(g.colorMapSize)
|
|
22
23
|
)
|
|
23
24
|
}
|
|
24
25
|
|
|
@@ -10,6 +10,7 @@ final class MapMarkerBuilder {
|
|
|
10
10
|
}()
|
|
11
11
|
private var tasks: [String: Task<Void, Never>] = [:]
|
|
12
12
|
|
|
13
|
+
@MainActor
|
|
13
14
|
func build(_ m: RNMarker, icon: UIImage?) -> GMSMarker {
|
|
14
15
|
let marker = GMSMarker(
|
|
15
16
|
position: m.coordinate.toCLLocationCoordinate2D()
|
|
@@ -160,11 +161,13 @@ final class MapMarkerBuilder {
|
|
|
160
161
|
tasks[id] = task
|
|
161
162
|
}
|
|
162
163
|
|
|
164
|
+
@MainActor
|
|
163
165
|
func cancelIconTask(_ id: String) {
|
|
164
166
|
tasks[id]?.cancel()
|
|
165
167
|
tasks.removeValue(forKey: id)
|
|
166
168
|
}
|
|
167
169
|
|
|
170
|
+
@MainActor
|
|
168
171
|
func cancelAllIconTasks() {
|
|
169
172
|
let ids = Array(tasks.keys)
|
|
170
173
|
for id in ids {
|
|
@@ -174,6 +177,7 @@ final class MapMarkerBuilder {
|
|
|
174
177
|
iconCache.removeAllObjects()
|
|
175
178
|
}
|
|
176
179
|
|
|
180
|
+
@MainActor
|
|
177
181
|
private func renderUIImage(_ m: RNMarker, _ scale: CGFloat) async -> UIImage? {
|
|
178
182
|
guard let iconSvg = m.iconSvg,
|
|
179
183
|
let data = iconSvg.svgString.data(using: .utf8)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import GoogleMaps
|
|
2
2
|
|
|
3
3
|
final class MapPolygonBuilder {
|
|
4
|
+
@MainActor
|
|
4
5
|
func build(_ p: RNPolygon) -> GMSPolygon {
|
|
5
6
|
let path = GMSMutablePath()
|
|
6
7
|
p.coordinates.forEach {
|
|
@@ -28,6 +29,7 @@ final class MapPolygonBuilder {
|
|
|
28
29
|
return pg
|
|
29
30
|
}
|
|
30
31
|
|
|
32
|
+
@MainActor
|
|
31
33
|
func update(_ prev: RNPolygon, _ next: RNPolygon, _ pg: GMSPolygon) {
|
|
32
34
|
let coordsChanged =
|
|
33
35
|
prev.coordinates.count != next.coordinates.count
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import GoogleMaps
|
|
2
2
|
|
|
3
3
|
final class MapPolylineBuilder {
|
|
4
|
+
@MainActor
|
|
4
5
|
func build(_ p: RNPolyline) -> GMSPolyline {
|
|
5
6
|
let path = GMSMutablePath()
|
|
6
7
|
p.coordinates.forEach {
|
|
@@ -22,6 +23,7 @@ final class MapPolylineBuilder {
|
|
|
22
23
|
return pl
|
|
23
24
|
}
|
|
24
25
|
|
|
26
|
+
@MainActor
|
|
25
27
|
func update(_ prev: RNPolyline, _ next: RNPolyline, _ pl: GMSPolyline) {
|
|
26
28
|
let coordsChanged =
|
|
27
29
|
prev.coordinates.count != next.coordinates.count
|
|
@@ -325,7 +325,7 @@ final class RNGoogleMapsPlusView: HybridRNGoogleMapsPlusViewSpec {
|
|
|
325
325
|
didSet { impl.onMapReady = onMapReady }
|
|
326
326
|
}
|
|
327
327
|
@MainActor
|
|
328
|
-
var onMapLoaded: ((
|
|
328
|
+
var onMapLoaded: ((RNRegion, RNCamera) -> Void)? {
|
|
329
329
|
didSet { impl.onMapLoaded = onMapLoaded }
|
|
330
330
|
}
|
|
331
331
|
@MainActor
|
|
@@ -385,19 +385,19 @@ final class RNGoogleMapsPlusView: HybridRNGoogleMapsPlusViewSpec {
|
|
|
385
385
|
didSet { impl.onIndoorLevelActivated = onIndoorLevelActivated }
|
|
386
386
|
}
|
|
387
387
|
@MainActor
|
|
388
|
-
var onInfoWindowPress: ((String?) -> Void)?{
|
|
388
|
+
var onInfoWindowPress: ((String?) -> Void)? {
|
|
389
389
|
didSet { impl.onInfoWindowPress = onInfoWindowPress }
|
|
390
390
|
}
|
|
391
391
|
@MainActor
|
|
392
|
-
var onInfoWindowClose: ((String?) -> Void)?{
|
|
392
|
+
var onInfoWindowClose: ((String?) -> Void)? {
|
|
393
393
|
didSet { impl.onInfoWindowClose = onInfoWindowClose }
|
|
394
394
|
}
|
|
395
395
|
@MainActor
|
|
396
|
-
var onInfoWindowLongPress: ((String?) -> Void)?{
|
|
396
|
+
var onInfoWindowLongPress: ((String?) -> Void)? {
|
|
397
397
|
didSet { impl.onInfoWindowLongPress = onInfoWindowLongPress }
|
|
398
398
|
}
|
|
399
399
|
@MainActor
|
|
400
|
-
var onMyLocationPress: ((RNLocation) -> Void)?{
|
|
400
|
+
var onMyLocationPress: ((RNLocation) -> Void)? {
|
|
401
401
|
didSet { impl.onMyLocationPress = onMyLocationPress }
|
|
402
402
|
}
|
|
403
403
|
@MainActor
|
|
@@ -22,7 +22,7 @@ export interface RNGoogleMapsPlusViewProps extends HybridViewProps {
|
|
|
22
22
|
locationConfig?: RNLocationConfig;
|
|
23
23
|
onMapError?: (error: RNMapErrorCode) => void;
|
|
24
24
|
onMapReady?: (ready: boolean) => void;
|
|
25
|
-
onMapLoaded?: (
|
|
25
|
+
onMapLoaded?: (region: RNRegion, camera: RNCamera) => void;
|
|
26
26
|
onLocationUpdate?: (location: RNLocation) => void;
|
|
27
27
|
onLocationError?: (error: RNLocationErrorCode) => void;
|
|
28
28
|
onMapPress?: (coordinate: RNLatLng) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RNGoogleMapsPlusView.nitro.d.ts","sourceRoot":"","sources":["../../../src/RNGoogleMapsPlusView.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,iBAAiB,EACjB,eAAe,EAChB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,UAAU,EACV,oBAAoB,EACpB,mBAAmB,EACnB,QAAQ,EACR,0BAA0B,EAC1B,QAAQ,EACR,UAAU,EACV,cAAc,EACd,SAAS,EACT,cAAc,EACd,QAAQ,EACR,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,yBAA0B,SAAQ,eAAe;IAChE,YAAY,CAAC,EAAE,cAAc,CAAC;IAC9B,UAAU,CAAC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,CAAC,CAAC;IAElE,kBAAkB,IAAI,IAAI,CAAC;IAE3B,oBAAoB,IAAI,IAAI,CAAC;IAE7B,yBAAyB,IAAI,OAAO,CAAC,0BAA0B,CAAC,CAAC;IAEjE,6BAA6B,IAAI,OAAO,CAAC;CAC1C;AAED,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAC3C,yBAAyB,EACzB,2BAA2B,CAC5B,CAAC"}
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
#include "JHybridRNGoogleMapsPlusViewSpec.hpp"
|
|
20
20
|
#include "JFunc_void_RNMapErrorCode.hpp"
|
|
21
21
|
#include "JFunc_void_bool.hpp"
|
|
22
|
+
#include "JFunc_void_RNRegion_RNCamera.hpp"
|
|
22
23
|
#include "JFunc_void_RNLocation.hpp"
|
|
23
24
|
#include "JFunc_void_RNLocationErrorCode.hpp"
|
|
24
25
|
#include "JFunc_void_RNLatLng.hpp"
|
|
@@ -44,6 +45,7 @@ int initialize(JavaVM* vm) {
|
|
|
44
45
|
margelo::nitro::rngooglemapsplus::JHybridRNGoogleMapsPlusViewSpec::registerNatives();
|
|
45
46
|
margelo::nitro::rngooglemapsplus::JFunc_void_RNMapErrorCode_cxx::registerNatives();
|
|
46
47
|
margelo::nitro::rngooglemapsplus::JFunc_void_bool_cxx::registerNatives();
|
|
48
|
+
margelo::nitro::rngooglemapsplus::JFunc_void_RNRegion_RNCamera_cxx::registerNatives();
|
|
47
49
|
margelo::nitro::rngooglemapsplus::JFunc_void_RNLocation_cxx::registerNatives();
|
|
48
50
|
margelo::nitro::rngooglemapsplus::JFunc_void_RNLocationErrorCode_cxx::registerNatives();
|
|
49
51
|
margelo::nitro::rngooglemapsplus::JFunc_void_RNLatLng_cxx::registerNatives();
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JFunc_void_RNRegion_RNCamera.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include <functional>
|
|
12
|
+
|
|
13
|
+
#include "RNRegion.hpp"
|
|
14
|
+
#include "RNCamera.hpp"
|
|
15
|
+
#include <functional>
|
|
16
|
+
#include "JRNRegion.hpp"
|
|
17
|
+
#include "RNLatLng.hpp"
|
|
18
|
+
#include "JRNLatLng.hpp"
|
|
19
|
+
#include "RNLatLngBounds.hpp"
|
|
20
|
+
#include "JRNLatLngBounds.hpp"
|
|
21
|
+
#include "JRNCamera.hpp"
|
|
22
|
+
#include <optional>
|
|
23
|
+
|
|
24
|
+
namespace margelo::nitro::rngooglemapsplus {
|
|
25
|
+
|
|
26
|
+
using namespace facebook;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Represents the Java/Kotlin callback `(region: RNRegion, camera: RNCamera) -> Unit`.
|
|
30
|
+
* This can be passed around between C++ and Java/Kotlin.
|
|
31
|
+
*/
|
|
32
|
+
struct JFunc_void_RNRegion_RNCamera: public jni::JavaClass<JFunc_void_RNRegion_RNCamera> {
|
|
33
|
+
public:
|
|
34
|
+
static auto constexpr kJavaDescriptor = "Lcom/rngooglemapsplus/Func_void_RNRegion_RNCamera;";
|
|
35
|
+
|
|
36
|
+
public:
|
|
37
|
+
/**
|
|
38
|
+
* Invokes the function this `JFunc_void_RNRegion_RNCamera` instance holds through JNI.
|
|
39
|
+
*/
|
|
40
|
+
void invoke(const RNRegion& region, const RNCamera& camera) const {
|
|
41
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JRNRegion> /* region */, jni::alias_ref<JRNCamera> /* camera */)>("invoke");
|
|
42
|
+
method(self(), JRNRegion::fromCpp(region), JRNCamera::fromCpp(camera));
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* An implementation of Func_void_RNRegion_RNCamera that is backed by a C++ implementation (using `std::function<...>`)
|
|
48
|
+
*/
|
|
49
|
+
struct JFunc_void_RNRegion_RNCamera_cxx final: public jni::HybridClass<JFunc_void_RNRegion_RNCamera_cxx, JFunc_void_RNRegion_RNCamera> {
|
|
50
|
+
public:
|
|
51
|
+
static jni::local_ref<JFunc_void_RNRegion_RNCamera::javaobject> fromCpp(const std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */)>& func) {
|
|
52
|
+
return JFunc_void_RNRegion_RNCamera_cxx::newObjectCxxArgs(func);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
public:
|
|
56
|
+
/**
|
|
57
|
+
* Invokes the C++ `std::function<...>` this `JFunc_void_RNRegion_RNCamera_cxx` instance holds.
|
|
58
|
+
*/
|
|
59
|
+
void invoke_cxx(jni::alias_ref<JRNRegion> region, jni::alias_ref<JRNCamera> camera) {
|
|
60
|
+
_func(region->toCpp(), camera->toCpp());
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public:
|
|
64
|
+
[[nodiscard]]
|
|
65
|
+
inline const std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */)>& getFunction() const {
|
|
66
|
+
return _func;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
public:
|
|
70
|
+
static auto constexpr kJavaDescriptor = "Lcom/rngooglemapsplus/Func_void_RNRegion_RNCamera_cxx;";
|
|
71
|
+
static void registerNatives() {
|
|
72
|
+
registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_RNRegion_RNCamera_cxx::invoke_cxx)});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
private:
|
|
76
|
+
explicit JFunc_void_RNRegion_RNCamera_cxx(const std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */)>& func): _func(func) { }
|
|
77
|
+
|
|
78
|
+
private:
|
|
79
|
+
friend HybridBase;
|
|
80
|
+
std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */)> _func;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
} // namespace margelo::nitro::rngooglemapsplus
|
|
@@ -63,6 +63,10 @@ namespace margelo::nitro::rngooglemapsplus { struct RNIOSLocationConfig; }
|
|
|
63
63
|
namespace margelo::nitro::rngooglemapsplus { enum class RNIOSLocationAccuracy; }
|
|
64
64
|
// Forward declaration of `RNMapErrorCode` to properly resolve imports.
|
|
65
65
|
namespace margelo::nitro::rngooglemapsplus { enum class RNMapErrorCode; }
|
|
66
|
+
// Forward declaration of `RNRegion` to properly resolve imports.
|
|
67
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNRegion; }
|
|
68
|
+
// Forward declaration of `RNLatLngBounds` to properly resolve imports.
|
|
69
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNLatLngBounds; }
|
|
66
70
|
// Forward declaration of `RNLocation` to properly resolve imports.
|
|
67
71
|
namespace margelo::nitro::rngooglemapsplus { struct RNLocation; }
|
|
68
72
|
// Forward declaration of `RNLocationAndroid` to properly resolve imports.
|
|
@@ -75,10 +79,6 @@ namespace margelo::nitro::rngooglemapsplus { enum class RNLocationErrorCode; }
|
|
|
75
79
|
namespace margelo::nitro::rngooglemapsplus { struct RNIndoorBuilding; }
|
|
76
80
|
// Forward declaration of `RNIndoorLevel` to properly resolve imports.
|
|
77
81
|
namespace margelo::nitro::rngooglemapsplus { struct RNIndoorLevel; }
|
|
78
|
-
// Forward declaration of `RNRegion` to properly resolve imports.
|
|
79
|
-
namespace margelo::nitro::rngooglemapsplus { struct RNRegion; }
|
|
80
|
-
// Forward declaration of `RNLatLngBounds` to properly resolve imports.
|
|
81
|
-
namespace margelo::nitro::rngooglemapsplus { struct RNLatLngBounds; }
|
|
82
82
|
// Forward declaration of `RNLocationPermissionResult` to properly resolve imports.
|
|
83
83
|
namespace margelo::nitro::rngooglemapsplus { struct RNLocationPermissionResult; }
|
|
84
84
|
// Forward declaration of `RNAndroidLocationPermissionResult` to properly resolve imports.
|
|
@@ -156,6 +156,11 @@ namespace margelo::nitro::rngooglemapsplus { enum class RNSnapshotResultType; }
|
|
|
156
156
|
#include "JFunc_void_RNMapErrorCode.hpp"
|
|
157
157
|
#include "JRNMapErrorCode.hpp"
|
|
158
158
|
#include "JFunc_void_bool.hpp"
|
|
159
|
+
#include "RNRegion.hpp"
|
|
160
|
+
#include "JFunc_void_RNRegion_RNCamera.hpp"
|
|
161
|
+
#include "JRNRegion.hpp"
|
|
162
|
+
#include "RNLatLngBounds.hpp"
|
|
163
|
+
#include "JRNLatLngBounds.hpp"
|
|
159
164
|
#include "RNLocation.hpp"
|
|
160
165
|
#include "JFunc_void_RNLocation.hpp"
|
|
161
166
|
#include "JRNLocation.hpp"
|
|
@@ -176,11 +181,7 @@ namespace margelo::nitro::rngooglemapsplus { enum class RNSnapshotResultType; }
|
|
|
176
181
|
#include "RNIndoorLevel.hpp"
|
|
177
182
|
#include "JRNIndoorLevel.hpp"
|
|
178
183
|
#include "JFunc_void_RNIndoorLevel.hpp"
|
|
179
|
-
#include "RNRegion.hpp"
|
|
180
184
|
#include "JFunc_void_RNRegion_RNCamera_bool.hpp"
|
|
181
|
-
#include "JRNRegion.hpp"
|
|
182
|
-
#include "RNLatLngBounds.hpp"
|
|
183
|
-
#include "JRNLatLngBounds.hpp"
|
|
184
185
|
#include <NitroModules/Promise.hpp>
|
|
185
186
|
#include <NitroModules/JPromise.hpp>
|
|
186
187
|
#include "RNLocationPermissionResult.hpp"
|
|
@@ -549,24 +550,24 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
549
550
|
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_bool::javaobject> /* onMapReady */)>("setOnMapReady_cxx");
|
|
550
551
|
method(_javaPart, onMapReady.has_value() ? JFunc_void_bool_cxx::fromCpp(onMapReady.value()) : nullptr);
|
|
551
552
|
}
|
|
552
|
-
std::optional<std::function<void(
|
|
553
|
-
static const auto method = javaClassStatic()->getMethod<jni::local_ref<
|
|
553
|
+
std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */)>> JHybridRNGoogleMapsPlusViewSpec::getOnMapLoaded() {
|
|
554
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void_RNRegion_RNCamera::javaobject>()>("getOnMapLoaded_cxx");
|
|
554
555
|
auto __result = method(_javaPart);
|
|
555
|
-
return __result != nullptr ? std::make_optional([&]() -> std::function<void(
|
|
556
|
-
if (__result->isInstanceOf(
|
|
557
|
-
auto downcast = jni::static_ref_cast<
|
|
556
|
+
return __result != nullptr ? std::make_optional([&]() -> std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */)> {
|
|
557
|
+
if (__result->isInstanceOf(JFunc_void_RNRegion_RNCamera_cxx::javaClassStatic())) [[likely]] {
|
|
558
|
+
auto downcast = jni::static_ref_cast<JFunc_void_RNRegion_RNCamera_cxx::javaobject>(__result);
|
|
558
559
|
return downcast->cthis()->getFunction();
|
|
559
560
|
} else {
|
|
560
561
|
auto __resultRef = jni::make_global(__result);
|
|
561
|
-
return [__resultRef](
|
|
562
|
-
return __resultRef->invoke(
|
|
562
|
+
return [__resultRef](RNRegion region, RNCamera camera) -> void {
|
|
563
|
+
return __resultRef->invoke(region,camera);
|
|
563
564
|
};
|
|
564
565
|
}
|
|
565
566
|
}()) : std::nullopt;
|
|
566
567
|
}
|
|
567
|
-
void JHybridRNGoogleMapsPlusViewSpec::setOnMapLoaded(const std::optional<std::function<void(
|
|
568
|
-
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<
|
|
569
|
-
method(_javaPart, onMapLoaded.has_value() ?
|
|
568
|
+
void JHybridRNGoogleMapsPlusViewSpec::setOnMapLoaded(const std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */)>>& onMapLoaded) {
|
|
569
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_RNRegion_RNCamera::javaobject> /* onMapLoaded */)>("setOnMapLoaded_cxx");
|
|
570
|
+
method(_javaPart, onMapLoaded.has_value() ? JFunc_void_RNRegion_RNCamera_cxx::fromCpp(onMapLoaded.value()) : nullptr);
|
|
570
571
|
}
|
|
571
572
|
std::optional<std::function<void(const RNLocation& /* location */)>> JHybridRNGoogleMapsPlusViewSpec::getOnLocationUpdate() {
|
|
572
573
|
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void_RNLocation::javaobject>()>("getOnLocationUpdate_cxx");
|
|
@@ -91,8 +91,8 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
91
91
|
void setOnMapError(const std::optional<std::function<void(RNMapErrorCode /* error */)>>& onMapError) override;
|
|
92
92
|
std::optional<std::function<void(bool /* ready */)>> getOnMapReady() override;
|
|
93
93
|
void setOnMapReady(const std::optional<std::function<void(bool /* ready */)>>& onMapReady) override;
|
|
94
|
-
std::optional<std::function<void(
|
|
95
|
-
void setOnMapLoaded(const std::optional<std::function<void(
|
|
94
|
+
std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */)>> getOnMapLoaded() override;
|
|
95
|
+
void setOnMapLoaded(const std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */)>>& onMapLoaded) override;
|
|
96
96
|
std::optional<std::function<void(const RNLocation& /* location */)>> getOnLocationUpdate() override;
|
|
97
97
|
void setOnLocationUpdate(const std::optional<std::function<void(const RNLocation& /* location */)>>& onLocationUpdate) override;
|
|
98
98
|
std::optional<std::function<void(RNLocationErrorCode /* error */)>> getOnLocationError() override;
|