react-native-google-maps-plus 1.1.0-dev.1 → 1.1.0-dev.2
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/RNGoogleMapsPlus.podspec +2 -0
- package/android/src/main/java/com/rngooglemapsplus/GoogleMapsViewImpl.kt +1 -1
- package/android/src/main/java/com/rngooglemapsplus/MapMarkerBuilder.kt +23 -27
- package/android/src/main/java/com/rngooglemapsplus/RNGoogleMapsPlusView.kt +3 -1
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNMarkerExtension.kt +17 -0
- package/ios/MapMarkerBuilder.swift +16 -7
- package/ios/RNGoogleMapsPlusView.swift +0 -1
- package/ios/extensions/RNMarker+Extension.swift +6 -5
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/src/types.d.ts +4 -1
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.cpp +4 -0
- package/nitrogen/generated/android/c++/JRNMarker.hpp +6 -12
- package/nitrogen/generated/android/c++/JRNMarkerSvg.hpp +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNMarker.kt +1 -7
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNMarkerSvg.kt +35 -0
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.hpp +18 -0
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Umbrella.hpp +3 -0
- package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusViewSpecSwift.hpp +3 -0
- package/nitrogen/generated/ios/swift/RNMarker.swift +24 -27
- package/nitrogen/generated/ios/swift/RNMarkerSvg.swift +57 -0
- package/nitrogen/generated/shared/c++/RNMarker.hpp +8 -13
- package/nitrogen/generated/shared/c++/RNMarkerSvg.hpp +75 -0
- package/package.json +1 -1
- package/src/types.ts +5 -1
package/RNGoogleMapsPlus.podspec
CHANGED
|
@@ -32,7 +32,7 @@ class GoogleMapsViewImpl(
|
|
|
32
32
|
val reactContext: ThemedReactContext,
|
|
33
33
|
val locationHandler: LocationHandler,
|
|
34
34
|
val playServiceHandler: PlayServicesHandler,
|
|
35
|
-
val markerBuilder:
|
|
35
|
+
val markerBuilder: MapMarkerBuilder,
|
|
36
36
|
) : FrameLayout(reactContext),
|
|
37
37
|
GoogleMap.OnCameraMoveStartedListener,
|
|
38
38
|
GoogleMap.OnCameraMoveListener,
|
|
@@ -10,6 +10,7 @@ import com.google.android.gms.maps.model.BitmapDescriptor
|
|
|
10
10
|
import com.google.android.gms.maps.model.BitmapDescriptorFactory
|
|
11
11
|
import com.google.android.gms.maps.model.LatLng
|
|
12
12
|
import com.google.android.gms.maps.model.MarkerOptions
|
|
13
|
+
import com.rngooglemapsplus.extensions.styleHash
|
|
13
14
|
import kotlinx.coroutines.CoroutineScope
|
|
14
15
|
import kotlinx.coroutines.Dispatchers
|
|
15
16
|
import kotlinx.coroutines.Job
|
|
@@ -19,7 +20,7 @@ import kotlinx.coroutines.launch
|
|
|
19
20
|
import kotlinx.coroutines.withContext
|
|
20
21
|
import kotlin.coroutines.coroutineContext
|
|
21
22
|
|
|
22
|
-
class
|
|
23
|
+
class MapMarkerBuilder(
|
|
23
24
|
private val scope: CoroutineScope = CoroutineScope(SupervisorJob() + Dispatchers.Default),
|
|
24
25
|
) {
|
|
25
26
|
private val iconCache =
|
|
@@ -34,7 +35,7 @@ class MarkerBuilder(
|
|
|
34
35
|
|
|
35
36
|
fun build(
|
|
36
37
|
m: RNMarker,
|
|
37
|
-
icon: BitmapDescriptor
|
|
38
|
+
icon: BitmapDescriptor?,
|
|
38
39
|
): MarkerOptions =
|
|
39
40
|
MarkerOptions().apply {
|
|
40
41
|
position(LatLng(m.coordinate.latitude, m.coordinate.longitude))
|
|
@@ -46,10 +47,13 @@ class MarkerBuilder(
|
|
|
46
47
|
fun buildIconAsync(
|
|
47
48
|
id: String,
|
|
48
49
|
m: RNMarker,
|
|
49
|
-
onReady: (BitmapDescriptor) -> Unit,
|
|
50
|
+
onReady: (BitmapDescriptor?) -> Unit,
|
|
50
51
|
) {
|
|
51
52
|
jobsById[id]?.cancel()
|
|
52
|
-
|
|
53
|
+
if (m.iconSvg == null) {
|
|
54
|
+
onReady(null)
|
|
55
|
+
return
|
|
56
|
+
}
|
|
53
57
|
val key = m.styleHash()
|
|
54
58
|
iconCache.get(key)?.let { cached ->
|
|
55
59
|
onReady(cached)
|
|
@@ -98,17 +102,28 @@ class MarkerBuilder(
|
|
|
98
102
|
|
|
99
103
|
private suspend fun renderBitmap(m: RNMarker): Bitmap? {
|
|
100
104
|
var bmp: Bitmap? = null
|
|
105
|
+
if (m.iconSvg == null) {
|
|
106
|
+
return null
|
|
107
|
+
}
|
|
101
108
|
try {
|
|
102
109
|
coroutineContext.ensureActive()
|
|
103
|
-
val svg = SVG.getFromString(m.iconSvg)
|
|
110
|
+
val svg = SVG.getFromString(m.iconSvg.svgString)
|
|
104
111
|
|
|
105
112
|
coroutineContext.ensureActive()
|
|
106
|
-
svg.setDocumentWidth(m.width.dpToPx())
|
|
107
|
-
svg.setDocumentHeight(m.height.dpToPx())
|
|
113
|
+
svg.setDocumentWidth(m.iconSvg.width.dpToPx())
|
|
114
|
+
svg.setDocumentHeight(m.iconSvg.height.dpToPx())
|
|
108
115
|
|
|
109
116
|
coroutineContext.ensureActive()
|
|
110
117
|
bmp =
|
|
111
|
-
createBitmap(
|
|
118
|
+
createBitmap(
|
|
119
|
+
m.iconSvg.width
|
|
120
|
+
.dpToPx()
|
|
121
|
+
.toInt(),
|
|
122
|
+
m.iconSvg.height
|
|
123
|
+
.dpToPx()
|
|
124
|
+
.toInt(),
|
|
125
|
+
Bitmap.Config.ARGB_8888,
|
|
126
|
+
)
|
|
112
127
|
|
|
113
128
|
coroutineContext.ensureActive()
|
|
114
129
|
val canvas = Canvas(bmp)
|
|
@@ -125,22 +140,3 @@ class MarkerBuilder(
|
|
|
125
140
|
}
|
|
126
141
|
}
|
|
127
142
|
}
|
|
128
|
-
|
|
129
|
-
fun RNMarker.markerEquals(b: RNMarker): Boolean =
|
|
130
|
-
id == b.id &&
|
|
131
|
-
zIndex == b.zIndex &&
|
|
132
|
-
coordinate == b.coordinate &&
|
|
133
|
-
anchor == b.anchor &&
|
|
134
|
-
markerStyleEquals(b)
|
|
135
|
-
|
|
136
|
-
fun RNMarker.markerStyleEquals(b: RNMarker): Boolean =
|
|
137
|
-
width == b.width &&
|
|
138
|
-
height == b.height &&
|
|
139
|
-
iconSvg == b.iconSvg
|
|
140
|
-
|
|
141
|
-
fun RNMarker.styleHash(): Int =
|
|
142
|
-
arrayOf<Any?>(
|
|
143
|
-
width,
|
|
144
|
-
height,
|
|
145
|
-
iconSvg,
|
|
146
|
-
).contentHashCode()
|
|
@@ -8,6 +8,8 @@ import com.google.android.gms.maps.model.LatLng
|
|
|
8
8
|
import com.google.android.gms.maps.model.MapStyleOptions
|
|
9
9
|
import com.margelo.nitro.core.Promise
|
|
10
10
|
import com.rngooglemapsplus.extensions.circleEquals
|
|
11
|
+
import com.rngooglemapsplus.extensions.markerEquals
|
|
12
|
+
import com.rngooglemapsplus.extensions.markerStyleEquals
|
|
11
13
|
import com.rngooglemapsplus.extensions.polygonEquals
|
|
12
14
|
import com.rngooglemapsplus.extensions.polylineEquals
|
|
13
15
|
import com.rngooglemapsplus.extensions.toCameraPosition
|
|
@@ -23,7 +25,7 @@ class RNGoogleMapsPlusView(
|
|
|
23
25
|
private var locationHandler = LocationHandler(context)
|
|
24
26
|
private var playServiceHandler = PlayServicesHandler(context)
|
|
25
27
|
|
|
26
|
-
private val markerBuilder =
|
|
28
|
+
private val markerBuilder = MapMarkerBuilder()
|
|
27
29
|
private val polylineBuilder = MapPolylineBuilder()
|
|
28
30
|
private val polygonBuilder = MapPolygonBuilder()
|
|
29
31
|
private val circleBuilder = MapCircleBuilder()
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
package com.rngooglemapsplus.extensions
|
|
2
|
+
|
|
3
|
+
import com.rngooglemapsplus.RNMarker
|
|
4
|
+
|
|
5
|
+
fun RNMarker.markerEquals(b: RNMarker): Boolean =
|
|
6
|
+
id == b.id &&
|
|
7
|
+
zIndex == b.zIndex &&
|
|
8
|
+
coordinate == b.coordinate &&
|
|
9
|
+
anchor == b.anchor &&
|
|
10
|
+
markerStyleEquals(b)
|
|
11
|
+
|
|
12
|
+
fun RNMarker.markerStyleEquals(b: RNMarker): Boolean = iconSvg == b.iconSvg
|
|
13
|
+
|
|
14
|
+
fun RNMarker.styleHash(): Int =
|
|
15
|
+
arrayOf<Any?>(
|
|
16
|
+
iconSvg,
|
|
17
|
+
).contentHashCode()
|
|
@@ -11,7 +11,7 @@ final class MapMarkerBuilder {
|
|
|
11
11
|
attributes: .concurrent
|
|
12
12
|
)
|
|
13
13
|
|
|
14
|
-
func build(_ m: RNMarker, icon: UIImage) -> GMSMarker {
|
|
14
|
+
func build(_ m: RNMarker, icon: UIImage?) -> GMSMarker {
|
|
15
15
|
let marker = GMSMarker(
|
|
16
16
|
position: CLLocationCoordinate2D(
|
|
17
17
|
latitude: m.coordinate.latitude,
|
|
@@ -40,6 +40,11 @@ final class MapMarkerBuilder {
|
|
|
40
40
|
) {
|
|
41
41
|
tasks[id]?.cancel()
|
|
42
42
|
|
|
43
|
+
if m.iconSvg == nil {
|
|
44
|
+
onReady(nil)
|
|
45
|
+
return
|
|
46
|
+
}
|
|
47
|
+
|
|
43
48
|
let key = m.styleHash()
|
|
44
49
|
if let cached = iconCache.object(forKey: key) {
|
|
45
50
|
onReady(cached)
|
|
@@ -85,7 +90,6 @@ final class MapMarkerBuilder {
|
|
|
85
90
|
|
|
86
91
|
if !prev.markerStyleEquals(next) {
|
|
87
92
|
buildIconAsync(next.id, next) { img in
|
|
88
|
-
guard let img else { return }
|
|
89
93
|
m.tracksViewChanges = true
|
|
90
94
|
m.icon = img
|
|
91
95
|
if prev.anchor?.x != next.anchor?.x || prev.anchor?.y != next.anchor?.y {
|
|
@@ -117,21 +121,26 @@ final class MapMarkerBuilder {
|
|
|
117
121
|
}
|
|
118
122
|
|
|
119
123
|
private func renderUIImage(_ m: RNMarker) async -> UIImage? {
|
|
120
|
-
|
|
124
|
+
guard let iconSvg = m.iconSvg else {
|
|
125
|
+
return nil
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return await withTaskCancellationHandler(
|
|
121
129
|
operation: {
|
|
122
|
-
await withCheckedContinuation {
|
|
130
|
+
await withCheckedContinuation {
|
|
131
|
+
(cont: CheckedContinuation<UIImage?, Never>) in
|
|
123
132
|
queue.async {
|
|
124
133
|
if Task.isCancelled {
|
|
125
134
|
cont.resume(returning: nil)
|
|
126
135
|
return
|
|
127
136
|
}
|
|
128
137
|
|
|
129
|
-
let targetW = max(1, Int(CGFloat(
|
|
130
|
-
let targetH = max(1, Int(CGFloat(
|
|
138
|
+
let targetW = max(1, Int(CGFloat(iconSvg.width)))
|
|
139
|
+
let targetH = max(1, Int(CGFloat(iconSvg.height)))
|
|
131
140
|
let size = CGSize(width: targetW, height: targetH)
|
|
132
141
|
|
|
133
142
|
guard
|
|
134
|
-
let data =
|
|
143
|
+
let data = iconSvg.svgString.data(using: .utf8),
|
|
135
144
|
let svgImg = SVGKImage(data: data)
|
|
136
145
|
else {
|
|
137
146
|
cont.resume(returning: nil)
|
|
@@ -140,7 +140,6 @@ final class RNGoogleMapsPlusView: HybridRNGoogleMapsPlusViewSpec {
|
|
|
140
140
|
}
|
|
141
141
|
} else {
|
|
142
142
|
markerBuilder.buildIconAsync(next.id, next) { icon in
|
|
143
|
-
guard let icon else { return }
|
|
144
143
|
let marker = self.markerBuilder.build(next, icon: icon)
|
|
145
144
|
self.impl.addMarker(id: id, marker: marker)
|
|
146
145
|
}
|
|
@@ -10,15 +10,16 @@ extension RNMarker {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
func markerStyleEquals(_ b: RNMarker) -> Bool {
|
|
13
|
-
width == b.width && height == b.height
|
|
14
|
-
&& iconSvg == b.iconSvg
|
|
13
|
+
iconSvg?.width == b.iconSvg?.width && iconSvg?.height == b.iconSvg?.height
|
|
14
|
+
&& iconSvg?.svgString == b.iconSvg?.svgString
|
|
15
|
+
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
func styleHash() -> NSString {
|
|
18
19
|
var hasher = Hasher()
|
|
19
|
-
hasher.combine(width)
|
|
20
|
-
hasher.combine(height)
|
|
21
|
-
hasher.combine(iconSvg)
|
|
20
|
+
hasher.combine(iconSvg?.width)
|
|
21
|
+
hasher.combine(iconSvg?.height)
|
|
22
|
+
hasher.combine(iconSvg?.svgString)
|
|
22
23
|
return String(hasher.finalize()) as NSString
|
|
23
24
|
}
|
|
24
25
|
}
|
package/lib/module/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["RNAndroidLocationPriority","RNIOSLocationAccuracy","RNAndroidLocationPermissionResult","RNIOSPermissionResult","RNLocationErrorCode","RNMapErrorCode"],"sourceRoot":"../../src","sources":["types.ts"],"mappings":";;AA0CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;;
|
|
1
|
+
{"version":3,"names":["RNAndroidLocationPriority","RNIOSLocationAccuracy","RNAndroidLocationPermissionResult","RNIOSPermissionResult","RNLocationErrorCode","RNMapErrorCode"],"sourceRoot":"../../src","sources":["types.ts"],"mappings":";;AA0CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;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
|
|
@@ -74,9 +74,12 @@ export type RNMarker = {
|
|
|
74
74
|
zIndex?: number;
|
|
75
75
|
coordinate: RNLatLng;
|
|
76
76
|
anchor?: RNPosition;
|
|
77
|
+
iconSvg?: RNMarkerSvg;
|
|
78
|
+
};
|
|
79
|
+
export type RNMarkerSvg = {
|
|
77
80
|
width: number;
|
|
78
81
|
height: number;
|
|
79
|
-
|
|
82
|
+
svgString: string;
|
|
80
83
|
};
|
|
81
84
|
export type RNPolygon = {
|
|
82
85
|
id: 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,QAAQ,CAAC;CACnB,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,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,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AC/B,CAAC;AAEF,oBAAY,qBAAqB;IAC/B,aAAa,IAAI;IACjB,0BAA0B,IAAI;IAC9B,8BAA8B,IAAI;IAClC,kBAAkB,IAAI;CACvB;AAED,MAAM,MAAM,0BAA0B,GAAG;IACvC,OAAO,CAAC,EAAE,iCAAiC,CAAC;IAC5C,GAAG,CAAC,EAAE,qBAAqB,CAAC;CAC7B,CAAC;AAEF,oBAAY,iCAAiC;IAC3C,OAAO,IAAI;IACX,MAAM,KAAK;IACX,eAAe,KAAK;CACrB;AAED,oBAAY,qBAAqB;IAC/B,MAAM,KAAK;IACX,UAAU,IAAI;CACf;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE,QAAQ,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,oBAAY,mBAAmB;IAC7B,iBAAiB,IAAI;IACrB,oBAAoB,IAAI;IACxB,OAAO,IAAI;IACX,0BAA0B,IAAI;IAC9B,sBAAsB,IAAI;IAC1B,cAAc,KAAK;CACpB;AAED,oBAAY,cAAc;IACxB,qBAAqB,IAAI;IACzB,qBAAqB,IAAI;IACzB,sBAAsB,IAAI;IAC1B,sBAAsB,IAAI;IAC1B,6BAA6B,IAAI;IACjC,qBAAqB,IAAI;IACzB,OAAO,IAAI;CACZ"}
|
|
@@ -25,6 +25,8 @@ namespace margelo::nitro::rngooglemapsplus { enum class RNMapType; }
|
|
|
25
25
|
namespace margelo::nitro::rngooglemapsplus { struct RNMarker; }
|
|
26
26
|
// Forward declaration of `RNPosition` to properly resolve imports.
|
|
27
27
|
namespace margelo::nitro::rngooglemapsplus { struct RNPosition; }
|
|
28
|
+
// Forward declaration of `RNMarkerSvg` to properly resolve imports.
|
|
29
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNMarkerSvg; }
|
|
28
30
|
// Forward declaration of `RNPolygon` to properly resolve imports.
|
|
29
31
|
namespace margelo::nitro::rngooglemapsplus { struct RNPolygon; }
|
|
30
32
|
// Forward declaration of `RNPolyline` to properly resolve imports.
|
|
@@ -81,6 +83,8 @@ namespace margelo::nitro::rngooglemapsplus { enum class RNIOSPermissionResult; }
|
|
|
81
83
|
#include "JRNMarker.hpp"
|
|
82
84
|
#include "RNPosition.hpp"
|
|
83
85
|
#include "JRNPosition.hpp"
|
|
86
|
+
#include "RNMarkerSvg.hpp"
|
|
87
|
+
#include "JRNMarkerSvg.hpp"
|
|
84
88
|
#include "RNPolygon.hpp"
|
|
85
89
|
#include "JRNPolygon.hpp"
|
|
86
90
|
#include "RNPolyline.hpp"
|
|
@@ -11,8 +11,10 @@
|
|
|
11
11
|
#include "RNMarker.hpp"
|
|
12
12
|
|
|
13
13
|
#include "JRNLatLng.hpp"
|
|
14
|
+
#include "JRNMarkerSvg.hpp"
|
|
14
15
|
#include "JRNPosition.hpp"
|
|
15
16
|
#include "RNLatLng.hpp"
|
|
17
|
+
#include "RNMarkerSvg.hpp"
|
|
16
18
|
#include "RNPosition.hpp"
|
|
17
19
|
#include <optional>
|
|
18
20
|
#include <string>
|
|
@@ -44,20 +46,14 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
44
46
|
jni::local_ref<JRNLatLng> coordinate = this->getFieldValue(fieldCoordinate);
|
|
45
47
|
static const auto fieldAnchor = clazz->getField<JRNPosition>("anchor");
|
|
46
48
|
jni::local_ref<JRNPosition> anchor = this->getFieldValue(fieldAnchor);
|
|
47
|
-
static const auto
|
|
48
|
-
|
|
49
|
-
static const auto fieldHeight = clazz->getField<double>("height");
|
|
50
|
-
double height = this->getFieldValue(fieldHeight);
|
|
51
|
-
static const auto fieldIconSvg = clazz->getField<jni::JString>("iconSvg");
|
|
52
|
-
jni::local_ref<jni::JString> iconSvg = this->getFieldValue(fieldIconSvg);
|
|
49
|
+
static const auto fieldIconSvg = clazz->getField<JRNMarkerSvg>("iconSvg");
|
|
50
|
+
jni::local_ref<JRNMarkerSvg> iconSvg = this->getFieldValue(fieldIconSvg);
|
|
53
51
|
return RNMarker(
|
|
54
52
|
id->toStdString(),
|
|
55
53
|
zIndex != nullptr ? std::make_optional(zIndex->value()) : std::nullopt,
|
|
56
54
|
coordinate->toCpp(),
|
|
57
55
|
anchor != nullptr ? std::make_optional(anchor->toCpp()) : std::nullopt,
|
|
58
|
-
|
|
59
|
-
height,
|
|
60
|
-
iconSvg->toStdString()
|
|
56
|
+
iconSvg != nullptr ? std::make_optional(iconSvg->toCpp()) : std::nullopt
|
|
61
57
|
);
|
|
62
58
|
}
|
|
63
59
|
|
|
@@ -72,9 +68,7 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
72
68
|
value.zIndex.has_value() ? jni::JDouble::valueOf(value.zIndex.value()) : nullptr,
|
|
73
69
|
JRNLatLng::fromCpp(value.coordinate),
|
|
74
70
|
value.anchor.has_value() ? JRNPosition::fromCpp(value.anchor.value()) : nullptr,
|
|
75
|
-
value.
|
|
76
|
-
value.height,
|
|
77
|
-
jni::make_jstring(value.iconSvg)
|
|
71
|
+
value.iconSvg.has_value() ? JRNMarkerSvg::fromCpp(value.iconSvg.value()) : nullptr
|
|
78
72
|
);
|
|
79
73
|
}
|
|
80
74
|
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JRNMarkerSvg.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 "RNMarkerSvg.hpp"
|
|
12
|
+
|
|
13
|
+
#include <string>
|
|
14
|
+
|
|
15
|
+
namespace margelo::nitro::rngooglemapsplus {
|
|
16
|
+
|
|
17
|
+
using namespace facebook;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The C++ JNI bridge between the C++ struct "RNMarkerSvg" and the the Kotlin data class "RNMarkerSvg".
|
|
21
|
+
*/
|
|
22
|
+
struct JRNMarkerSvg final: public jni::JavaClass<JRNMarkerSvg> {
|
|
23
|
+
public:
|
|
24
|
+
static auto constexpr kJavaDescriptor = "Lcom/rngooglemapsplus/RNMarkerSvg;";
|
|
25
|
+
|
|
26
|
+
public:
|
|
27
|
+
/**
|
|
28
|
+
* Convert this Java/Kotlin-based struct to the C++ struct RNMarkerSvg by copying all values to C++.
|
|
29
|
+
*/
|
|
30
|
+
[[maybe_unused]]
|
|
31
|
+
[[nodiscard]]
|
|
32
|
+
RNMarkerSvg toCpp() const {
|
|
33
|
+
static const auto clazz = javaClassStatic();
|
|
34
|
+
static const auto fieldWidth = clazz->getField<double>("width");
|
|
35
|
+
double width = this->getFieldValue(fieldWidth);
|
|
36
|
+
static const auto fieldHeight = clazz->getField<double>("height");
|
|
37
|
+
double height = this->getFieldValue(fieldHeight);
|
|
38
|
+
static const auto fieldSvgString = clazz->getField<jni::JString>("svgString");
|
|
39
|
+
jni::local_ref<jni::JString> svgString = this->getFieldValue(fieldSvgString);
|
|
40
|
+
return RNMarkerSvg(
|
|
41
|
+
width,
|
|
42
|
+
height,
|
|
43
|
+
svgString->toStdString()
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public:
|
|
48
|
+
/**
|
|
49
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
50
|
+
*/
|
|
51
|
+
[[maybe_unused]]
|
|
52
|
+
static jni::local_ref<JRNMarkerSvg::javaobject> fromCpp(const RNMarkerSvg& value) {
|
|
53
|
+
return newInstance(
|
|
54
|
+
value.width,
|
|
55
|
+
value.height,
|
|
56
|
+
jni::make_jstring(value.svgString)
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
} // namespace margelo::nitro::rngooglemapsplus
|
|
@@ -35,13 +35,7 @@ data class RNMarker
|
|
|
35
35
|
val anchor: RNPosition?,
|
|
36
36
|
@DoNotStrip
|
|
37
37
|
@Keep
|
|
38
|
-
val
|
|
39
|
-
@DoNotStrip
|
|
40
|
-
@Keep
|
|
41
|
-
val height: Double,
|
|
42
|
-
@DoNotStrip
|
|
43
|
-
@Keep
|
|
44
|
-
val iconSvg: String
|
|
38
|
+
val iconSvg: RNMarkerSvg?
|
|
45
39
|
) {
|
|
46
40
|
/* main constructor */
|
|
47
41
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNMarkerSvg.kt
|
|
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
|
+
package com.rngooglemapsplus
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
import com.margelo.nitro.core.*
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Represents the JavaScript object/struct "RNMarkerSvg".
|
|
17
|
+
*/
|
|
18
|
+
@DoNotStrip
|
|
19
|
+
@Keep
|
|
20
|
+
data class RNMarkerSvg
|
|
21
|
+
@DoNotStrip
|
|
22
|
+
@Keep
|
|
23
|
+
constructor(
|
|
24
|
+
@DoNotStrip
|
|
25
|
+
@Keep
|
|
26
|
+
val width: Double,
|
|
27
|
+
@DoNotStrip
|
|
28
|
+
@Keep
|
|
29
|
+
val height: Double,
|
|
30
|
+
@DoNotStrip
|
|
31
|
+
@Keep
|
|
32
|
+
val svgString: String
|
|
33
|
+
) {
|
|
34
|
+
/* main constructor */
|
|
35
|
+
}
|
|
@@ -52,6 +52,8 @@ namespace margelo::nitro::rngooglemapsplus { struct RNMapPadding; }
|
|
|
52
52
|
namespace margelo::nitro::rngooglemapsplus { enum class RNMapType; }
|
|
53
53
|
// Forward declaration of `RNMapUiSettings` to properly resolve imports.
|
|
54
54
|
namespace margelo::nitro::rngooglemapsplus { struct RNMapUiSettings; }
|
|
55
|
+
// Forward declaration of `RNMarkerSvg` to properly resolve imports.
|
|
56
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNMarkerSvg; }
|
|
55
57
|
// Forward declaration of `RNMarker` to properly resolve imports.
|
|
56
58
|
namespace margelo::nitro::rngooglemapsplus { struct RNMarker; }
|
|
57
59
|
// Forward declaration of `RNPolygon` to properly resolve imports.
|
|
@@ -95,6 +97,7 @@ namespace RNGoogleMapsPlus { class HybridRNGoogleMapsPlusViewSpec_cxx; }
|
|
|
95
97
|
#include "RNMapType.hpp"
|
|
96
98
|
#include "RNMapUiSettings.hpp"
|
|
97
99
|
#include "RNMarker.hpp"
|
|
100
|
+
#include "RNMarkerSvg.hpp"
|
|
98
101
|
#include "RNPolygon.hpp"
|
|
99
102
|
#include "RNPolyline.hpp"
|
|
100
103
|
#include "RNPosition.hpp"
|
|
@@ -406,6 +409,21 @@ namespace margelo::nitro::rngooglemapsplus::bridge::swift {
|
|
|
406
409
|
return *optional;
|
|
407
410
|
}
|
|
408
411
|
|
|
412
|
+
// pragma MARK: std::optional<RNMarkerSvg>
|
|
413
|
+
/**
|
|
414
|
+
* Specialized version of `std::optional<RNMarkerSvg>`.
|
|
415
|
+
*/
|
|
416
|
+
using std__optional_RNMarkerSvg_ = std::optional<RNMarkerSvg>;
|
|
417
|
+
inline std::optional<RNMarkerSvg> create_std__optional_RNMarkerSvg_(const RNMarkerSvg& value) noexcept {
|
|
418
|
+
return std::optional<RNMarkerSvg>(value);
|
|
419
|
+
}
|
|
420
|
+
inline bool has_value_std__optional_RNMarkerSvg_(const std::optional<RNMarkerSvg>& optional) noexcept {
|
|
421
|
+
return optional.has_value();
|
|
422
|
+
}
|
|
423
|
+
inline RNMarkerSvg get_std__optional_RNMarkerSvg_(const std::optional<RNMarkerSvg>& optional) noexcept {
|
|
424
|
+
return *optional;
|
|
425
|
+
}
|
|
426
|
+
|
|
409
427
|
// pragma MARK: std::vector<RNMarker>
|
|
410
428
|
/**
|
|
411
429
|
* Specialized version of `std::vector<RNMarker>`.
|
|
@@ -52,6 +52,8 @@ namespace margelo::nitro::rngooglemapsplus { struct RNMapPadding; }
|
|
|
52
52
|
namespace margelo::nitro::rngooglemapsplus { enum class RNMapType; }
|
|
53
53
|
// Forward declaration of `RNMapUiSettings` to properly resolve imports.
|
|
54
54
|
namespace margelo::nitro::rngooglemapsplus { struct RNMapUiSettings; }
|
|
55
|
+
// Forward declaration of `RNMarkerSvg` to properly resolve imports.
|
|
56
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNMarkerSvg; }
|
|
55
57
|
// Forward declaration of `RNMarker` to properly resolve imports.
|
|
56
58
|
namespace margelo::nitro::rngooglemapsplus { struct RNMarker; }
|
|
57
59
|
// Forward declaration of `RNPolygon` to properly resolve imports.
|
|
@@ -89,6 +91,7 @@ namespace margelo::nitro::rngooglemapsplus { enum class RNUserInterfaceStyle; }
|
|
|
89
91
|
#include "RNMapType.hpp"
|
|
90
92
|
#include "RNMapUiSettings.hpp"
|
|
91
93
|
#include "RNMarker.hpp"
|
|
94
|
+
#include "RNMarkerSvg.hpp"
|
|
92
95
|
#include "RNPolygon.hpp"
|
|
93
96
|
#include "RNPolyline.hpp"
|
|
94
97
|
#include "RNPosition.hpp"
|
|
@@ -30,6 +30,8 @@ namespace margelo::nitro::rngooglemapsplus { enum class RNMapType; }
|
|
|
30
30
|
namespace margelo::nitro::rngooglemapsplus { struct RNMarker; }
|
|
31
31
|
// Forward declaration of `RNPosition` to properly resolve imports.
|
|
32
32
|
namespace margelo::nitro::rngooglemapsplus { struct RNPosition; }
|
|
33
|
+
// Forward declaration of `RNMarkerSvg` to properly resolve imports.
|
|
34
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNMarkerSvg; }
|
|
33
35
|
// Forward declaration of `RNPolygon` to properly resolve imports.
|
|
34
36
|
namespace margelo::nitro::rngooglemapsplus { struct RNPolygon; }
|
|
35
37
|
// Forward declaration of `RNPolyline` to properly resolve imports.
|
|
@@ -77,6 +79,7 @@ namespace margelo::nitro::rngooglemapsplus { enum class RNIOSPermissionResult; }
|
|
|
77
79
|
#include "RNMarker.hpp"
|
|
78
80
|
#include <vector>
|
|
79
81
|
#include "RNPosition.hpp"
|
|
82
|
+
#include "RNMarkerSvg.hpp"
|
|
80
83
|
#include "RNPolygon.hpp"
|
|
81
84
|
#include "RNPolyline.hpp"
|
|
82
85
|
#include "RNLineCapType.hpp"
|
|
@@ -18,7 +18,7 @@ public extension RNMarker {
|
|
|
18
18
|
/**
|
|
19
19
|
* Create a new instance of `RNMarker`.
|
|
20
20
|
*/
|
|
21
|
-
init(id: String, zIndex: Double?, coordinate: RNLatLng, anchor: RNPosition?,
|
|
21
|
+
init(id: String, zIndex: Double?, coordinate: RNLatLng, anchor: RNPosition?, iconSvg: RNMarkerSvg?) {
|
|
22
22
|
self.init(std.string(id), { () -> bridge.std__optional_double_ in
|
|
23
23
|
if let __unwrappedValue = zIndex {
|
|
24
24
|
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
@@ -31,7 +31,13 @@ public extension RNMarker {
|
|
|
31
31
|
} else {
|
|
32
32
|
return .init()
|
|
33
33
|
}
|
|
34
|
-
}(),
|
|
34
|
+
}(), { () -> bridge.std__optional_RNMarkerSvg_ in
|
|
35
|
+
if let __unwrappedValue = iconSvg {
|
|
36
|
+
return bridge.create_std__optional_RNMarkerSvg_(__unwrappedValue)
|
|
37
|
+
} else {
|
|
38
|
+
return .init()
|
|
39
|
+
}
|
|
40
|
+
}())
|
|
35
41
|
}
|
|
36
42
|
|
|
37
43
|
var id: String {
|
|
@@ -97,36 +103,27 @@ public extension RNMarker {
|
|
|
97
103
|
}
|
|
98
104
|
}
|
|
99
105
|
|
|
100
|
-
var
|
|
106
|
+
var iconSvg: RNMarkerSvg? {
|
|
101
107
|
@inline(__always)
|
|
102
108
|
get {
|
|
103
|
-
return
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
var height: Double {
|
|
112
|
-
@inline(__always)
|
|
113
|
-
get {
|
|
114
|
-
return self.__height
|
|
115
|
-
}
|
|
116
|
-
@inline(__always)
|
|
117
|
-
set {
|
|
118
|
-
self.__height = newValue
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
var iconSvg: String {
|
|
123
|
-
@inline(__always)
|
|
124
|
-
get {
|
|
125
|
-
return String(self.__iconSvg)
|
|
109
|
+
return { () -> RNMarkerSvg? in
|
|
110
|
+
if bridge.has_value_std__optional_RNMarkerSvg_(self.__iconSvg) {
|
|
111
|
+
let __unwrapped = bridge.get_std__optional_RNMarkerSvg_(self.__iconSvg)
|
|
112
|
+
return __unwrapped
|
|
113
|
+
} else {
|
|
114
|
+
return nil
|
|
115
|
+
}
|
|
116
|
+
}()
|
|
126
117
|
}
|
|
127
118
|
@inline(__always)
|
|
128
119
|
set {
|
|
129
|
-
self.__iconSvg =
|
|
120
|
+
self.__iconSvg = { () -> bridge.std__optional_RNMarkerSvg_ in
|
|
121
|
+
if let __unwrappedValue = newValue {
|
|
122
|
+
return bridge.create_std__optional_RNMarkerSvg_(__unwrappedValue)
|
|
123
|
+
} else {
|
|
124
|
+
return .init()
|
|
125
|
+
}
|
|
126
|
+
}()
|
|
130
127
|
}
|
|
131
128
|
}
|
|
132
129
|
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNMarkerSvg.swift
|
|
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
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents an instance of `RNMarkerSvg`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias RNMarkerSvg = margelo.nitro.rngooglemapsplus.RNMarkerSvg
|
|
14
|
+
|
|
15
|
+
public extension RNMarkerSvg {
|
|
16
|
+
private typealias bridge = margelo.nitro.rngooglemapsplus.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `RNMarkerSvg`.
|
|
20
|
+
*/
|
|
21
|
+
init(width: Double, height: Double, svgString: String) {
|
|
22
|
+
self.init(width, height, std.string(svgString))
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var width: Double {
|
|
26
|
+
@inline(__always)
|
|
27
|
+
get {
|
|
28
|
+
return self.__width
|
|
29
|
+
}
|
|
30
|
+
@inline(__always)
|
|
31
|
+
set {
|
|
32
|
+
self.__width = newValue
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
var height: Double {
|
|
37
|
+
@inline(__always)
|
|
38
|
+
get {
|
|
39
|
+
return self.__height
|
|
40
|
+
}
|
|
41
|
+
@inline(__always)
|
|
42
|
+
set {
|
|
43
|
+
self.__height = newValue
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
var svgString: String {
|
|
48
|
+
@inline(__always)
|
|
49
|
+
get {
|
|
50
|
+
return String(self.__svgString)
|
|
51
|
+
}
|
|
52
|
+
@inline(__always)
|
|
53
|
+
set {
|
|
54
|
+
self.__svgString = std.string(newValue)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -22,11 +22,14 @@
|
|
|
22
22
|
namespace margelo::nitro::rngooglemapsplus { struct RNLatLng; }
|
|
23
23
|
// Forward declaration of `RNPosition` to properly resolve imports.
|
|
24
24
|
namespace margelo::nitro::rngooglemapsplus { struct RNPosition; }
|
|
25
|
+
// Forward declaration of `RNMarkerSvg` to properly resolve imports.
|
|
26
|
+
namespace margelo::nitro::rngooglemapsplus { struct RNMarkerSvg; }
|
|
25
27
|
|
|
26
28
|
#include <string>
|
|
27
29
|
#include <optional>
|
|
28
30
|
#include "RNLatLng.hpp"
|
|
29
31
|
#include "RNPosition.hpp"
|
|
32
|
+
#include "RNMarkerSvg.hpp"
|
|
30
33
|
|
|
31
34
|
namespace margelo::nitro::rngooglemapsplus {
|
|
32
35
|
|
|
@@ -39,13 +42,11 @@ namespace margelo::nitro::rngooglemapsplus {
|
|
|
39
42
|
std::optional<double> zIndex SWIFT_PRIVATE;
|
|
40
43
|
RNLatLng coordinate SWIFT_PRIVATE;
|
|
41
44
|
std::optional<RNPosition> anchor SWIFT_PRIVATE;
|
|
42
|
-
|
|
43
|
-
double height SWIFT_PRIVATE;
|
|
44
|
-
std::string iconSvg SWIFT_PRIVATE;
|
|
45
|
+
std::optional<RNMarkerSvg> iconSvg SWIFT_PRIVATE;
|
|
45
46
|
|
|
46
47
|
public:
|
|
47
48
|
RNMarker() = default;
|
|
48
|
-
explicit RNMarker(std::string id, std::optional<double> zIndex, RNLatLng coordinate, std::optional<RNPosition> anchor,
|
|
49
|
+
explicit RNMarker(std::string id, std::optional<double> zIndex, RNLatLng coordinate, std::optional<RNPosition> anchor, std::optional<RNMarkerSvg> iconSvg): id(id), zIndex(zIndex), coordinate(coordinate), anchor(anchor), iconSvg(iconSvg) {}
|
|
49
50
|
};
|
|
50
51
|
|
|
51
52
|
} // namespace margelo::nitro::rngooglemapsplus
|
|
@@ -62,9 +63,7 @@ namespace margelo::nitro {
|
|
|
62
63
|
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "zIndex")),
|
|
63
64
|
JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::fromJSI(runtime, obj.getProperty(runtime, "coordinate")),
|
|
64
65
|
JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNPosition>>::fromJSI(runtime, obj.getProperty(runtime, "anchor")),
|
|
65
|
-
JSIConverter<
|
|
66
|
-
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "height")),
|
|
67
|
-
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "iconSvg"))
|
|
66
|
+
JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNMarkerSvg>>::fromJSI(runtime, obj.getProperty(runtime, "iconSvg"))
|
|
68
67
|
);
|
|
69
68
|
}
|
|
70
69
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNMarker& arg) {
|
|
@@ -73,9 +72,7 @@ namespace margelo::nitro {
|
|
|
73
72
|
obj.setProperty(runtime, "zIndex", JSIConverter<std::optional<double>>::toJSI(runtime, arg.zIndex));
|
|
74
73
|
obj.setProperty(runtime, "coordinate", JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::toJSI(runtime, arg.coordinate));
|
|
75
74
|
obj.setProperty(runtime, "anchor", JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNPosition>>::toJSI(runtime, arg.anchor));
|
|
76
|
-
obj.setProperty(runtime, "
|
|
77
|
-
obj.setProperty(runtime, "height", JSIConverter<double>::toJSI(runtime, arg.height));
|
|
78
|
-
obj.setProperty(runtime, "iconSvg", JSIConverter<std::string>::toJSI(runtime, arg.iconSvg));
|
|
75
|
+
obj.setProperty(runtime, "iconSvg", JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNMarkerSvg>>::toJSI(runtime, arg.iconSvg));
|
|
79
76
|
return obj;
|
|
80
77
|
}
|
|
81
78
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -87,9 +84,7 @@ namespace margelo::nitro {
|
|
|
87
84
|
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "zIndex"))) return false;
|
|
88
85
|
if (!JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::canConvert(runtime, obj.getProperty(runtime, "coordinate"))) return false;
|
|
89
86
|
if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNPosition>>::canConvert(runtime, obj.getProperty(runtime, "anchor"))) return false;
|
|
90
|
-
if (!JSIConverter<
|
|
91
|
-
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "height"))) return false;
|
|
92
|
-
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "iconSvg"))) return false;
|
|
87
|
+
if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNMarkerSvg>>::canConvert(runtime, obj.getProperty(runtime, "iconSvg"))) return false;
|
|
93
88
|
return true;
|
|
94
89
|
}
|
|
95
90
|
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNMarkerSvg.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
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
#include <string>
|
|
24
|
+
|
|
25
|
+
namespace margelo::nitro::rngooglemapsplus {
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* A struct which can be represented as a JavaScript object (RNMarkerSvg).
|
|
29
|
+
*/
|
|
30
|
+
struct RNMarkerSvg {
|
|
31
|
+
public:
|
|
32
|
+
double width SWIFT_PRIVATE;
|
|
33
|
+
double height SWIFT_PRIVATE;
|
|
34
|
+
std::string svgString SWIFT_PRIVATE;
|
|
35
|
+
|
|
36
|
+
public:
|
|
37
|
+
RNMarkerSvg() = default;
|
|
38
|
+
explicit RNMarkerSvg(double width, double height, std::string svgString): width(width), height(height), svgString(svgString) {}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
} // namespace margelo::nitro::rngooglemapsplus
|
|
42
|
+
|
|
43
|
+
namespace margelo::nitro {
|
|
44
|
+
|
|
45
|
+
// C++ RNMarkerSvg <> JS RNMarkerSvg (object)
|
|
46
|
+
template <>
|
|
47
|
+
struct JSIConverter<margelo::nitro::rngooglemapsplus::RNMarkerSvg> final {
|
|
48
|
+
static inline margelo::nitro::rngooglemapsplus::RNMarkerSvg fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
49
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
50
|
+
return margelo::nitro::rngooglemapsplus::RNMarkerSvg(
|
|
51
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "width")),
|
|
52
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "height")),
|
|
53
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "svgString"))
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNMarkerSvg& arg) {
|
|
57
|
+
jsi::Object obj(runtime);
|
|
58
|
+
obj.setProperty(runtime, "width", JSIConverter<double>::toJSI(runtime, arg.width));
|
|
59
|
+
obj.setProperty(runtime, "height", JSIConverter<double>::toJSI(runtime, arg.height));
|
|
60
|
+
obj.setProperty(runtime, "svgString", JSIConverter<std::string>::toJSI(runtime, arg.svgString));
|
|
61
|
+
return obj;
|
|
62
|
+
}
|
|
63
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
64
|
+
if (!value.isObject()) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
jsi::Object obj = value.getObject(runtime);
|
|
68
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "width"))) return false;
|
|
69
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "height"))) return false;
|
|
70
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "svgString"))) return false;
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
} // namespace margelo::nitro
|
package/package.json
CHANGED
package/src/types.ts
CHANGED
|
@@ -131,9 +131,13 @@ export type RNMarker = {
|
|
|
131
131
|
zIndex?: number;
|
|
132
132
|
coordinate: RNLatLng;
|
|
133
133
|
anchor?: RNPosition;
|
|
134
|
+
iconSvg?: RNMarkerSvg;
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
export type RNMarkerSvg = {
|
|
134
138
|
width: number;
|
|
135
139
|
height: number;
|
|
136
|
-
|
|
140
|
+
svgString: string;
|
|
137
141
|
};
|
|
138
142
|
|
|
139
143
|
export type RNPolygon = {
|