react-native-google-maps-plus 1.7.0-dev.9 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/android/build.gradle +1 -1
  2. package/android/gradle.properties +2 -1
  3. package/android/src/main/java/com/rngooglemapsplus/GoogleMapsViewImpl.kt +120 -124
  4. package/android/src/main/java/com/rngooglemapsplus/MapCircleBuilder.kt +2 -3
  5. package/android/src/main/java/com/rngooglemapsplus/MapMarkerBuilder.kt +83 -53
  6. package/android/src/main/java/com/rngooglemapsplus/MapPolygonBuilder.kt +6 -23
  7. package/android/src/main/java/com/rngooglemapsplus/MapPolylineBuilder.kt.kt +12 -39
  8. package/android/src/main/java/com/rngooglemapsplus/RNGoogleMapsPlusView.kt +30 -12
  9. package/android/src/main/java/com/rngooglemapsplus/extensions/BitmapExtension.kt +35 -0
  10. package/android/src/main/java/com/rngooglemapsplus/extensions/LatLngBoundsExtension.kt +31 -0
  11. package/android/src/main/java/com/rngooglemapsplus/extensions/MapObjectTagExtensions.kt +84 -0
  12. package/android/src/main/java/com/rngooglemapsplus/extensions/RNLineCapTypeExtension.kt +14 -0
  13. package/android/src/main/java/com/rngooglemapsplus/extensions/RNLineJoinTypeExtension.kt +12 -0
  14. package/android/src/main/java/com/rngooglemapsplus/extensions/RNMapCircleExtension.kt +7 -1
  15. package/android/src/main/java/com/rngooglemapsplus/extensions/RNMarkerExtension.kt +54 -17
  16. package/android/src/main/java/com/rngooglemapsplus/extensions/RNPolygonExtension.kt +31 -1
  17. package/android/src/main/java/com/rngooglemapsplus/extensions/RNPolylineExtension.kt +6 -1
  18. package/ios/GoogleMapViewImpl.swift +81 -64
  19. package/ios/MapCircleBuilder.swift +2 -3
  20. package/ios/MapMarkerBuilder.swift +106 -50
  21. package/ios/MapPolygonBuilder.swift +6 -41
  22. package/ios/MapPolylineBuilder.swift +2 -10
  23. package/ios/RNGoogleMapsPlusView.swift +24 -11
  24. package/ios/extensions/MapObjectTag+Extension.swift +93 -0
  25. package/ios/extensions/RNCircle+Extension.swift +14 -5
  26. package/ios/extensions/RNLatLng+Extension.swift +11 -0
  27. package/ios/extensions/RNLineCapType+Extension.swift +10 -0
  28. package/ios/extensions/RNLineJoinType+Extension.swift +11 -0
  29. package/ios/extensions/RNMarker+Extension.swift +43 -12
  30. package/ios/extensions/RNPolygon+Extension.swift.swift +50 -21
  31. package/ios/extensions/RNPolyline+Extension.swift.swift +15 -26
  32. package/ios/extensions/UIImage+Extension.swift +45 -0
  33. package/lib/module/types.js.map +1 -1
  34. package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts +12 -10
  35. package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts.map +1 -1
  36. package/lib/typescript/src/types.d.ts +2 -1
  37. package/lib/typescript/src/types.d.ts.map +1 -1
  38. package/nitrogen/generated/android/RNGoogleMapsPlusOnLoad.cpp +4 -4
  39. package/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +75 -0
  40. package/nitrogen/generated/android/c++/JFunc_void_std__string_RNLatLng.hpp +77 -0
  41. package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.cpp +100 -92
  42. package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.hpp +22 -20
  43. package/nitrogen/generated/android/c++/JRNInitialProps.hpp +7 -3
  44. package/nitrogen/generated/android/c++/JRNMarker.hpp +7 -7
  45. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/{Func_void_std__optional_std__string_.kt → Func_void_std__string.kt} +12 -12
  46. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/{Func_void_std__optional_std__string__RNLatLng.kt → Func_void_std__string_RNLatLng.kt} +12 -12
  47. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/HybridRNGoogleMapsPlusViewSpec.kt +38 -30
  48. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNInitialProps.kt +6 -3
  49. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNMarker.kt +6 -6
  50. package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.cpp +16 -8
  51. package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.hpp +58 -36
  52. package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusViewSpecSwift.hpp +32 -20
  53. package/nitrogen/generated/ios/swift/Func_void_std__optional_std__string_.swift +6 -6
  54. package/nitrogen/generated/ios/swift/Func_void_std__string.swift +47 -0
  55. package/nitrogen/generated/ios/swift/Func_void_std__string_RNLatLng.swift +47 -0
  56. package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec.swift +12 -10
  57. package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec_cxx.swift +142 -180
  58. package/nitrogen/generated/ios/swift/RNInitialProps.swift +31 -1
  59. package/nitrogen/generated/ios/swift/RNMarker.swift +24 -31
  60. package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.cpp +2 -0
  61. package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.hpp +22 -20
  62. package/nitrogen/generated/shared/c++/RNInitialProps.hpp +6 -2
  63. package/nitrogen/generated/shared/c++/RNMarker.hpp +6 -6
  64. package/nitrogen/generated/shared/c++/views/HybridRNGoogleMapsPlusViewComponent.cpp +20 -20
  65. package/nitrogen/generated/shared/c++/views/HybridRNGoogleMapsPlusViewComponent.hpp +10 -10
  66. package/package.json +1 -1
  67. package/src/RNGoogleMapsPlusView.nitro.ts +14 -10
  68. package/src/types.ts +2 -1
  69. package/nitrogen/generated/android/c++/JFunc_void_std__optional_std__string_.hpp +0 -76
  70. package/nitrogen/generated/android/c++/JFunc_void_std__optional_std__string__RNLatLng.hpp +0 -78
  71. package/nitrogen/generated/ios/swift/Func_void_std__optional_std__string__RNLatLng.swift +0 -54
@@ -176,30 +176,30 @@ namespace margelo::nitro::rngooglemapsplus {
176
176
  virtual void setOnMapLongPress(const std::optional<std::function<void(const RNLatLng& /* coordinate */)>>& onMapLongPress) = 0;
177
177
  virtual std::optional<std::function<void(const std::string& /* placeId */, const std::string& /* name */, const RNLatLng& /* coordinate */)>> getOnPoiPress() = 0;
178
178
  virtual void setOnPoiPress(const std::optional<std::function<void(const std::string& /* placeId */, const std::string& /* name */, const RNLatLng& /* coordinate */)>>& onPoiPress) = 0;
179
- virtual std::optional<std::function<void(const std::optional<std::string>& /* id */)>> getOnMarkerPress() = 0;
180
- virtual void setOnMarkerPress(const std::optional<std::function<void(const std::optional<std::string>& /* id */)>>& onMarkerPress) = 0;
181
- virtual std::optional<std::function<void(const std::optional<std::string>& /* id */)>> getOnPolylinePress() = 0;
182
- virtual void setOnPolylinePress(const std::optional<std::function<void(const std::optional<std::string>& /* id */)>>& onPolylinePress) = 0;
183
- virtual std::optional<std::function<void(const std::optional<std::string>& /* id */)>> getOnPolygonPress() = 0;
184
- virtual void setOnPolygonPress(const std::optional<std::function<void(const std::optional<std::string>& /* id */)>>& onPolygonPress) = 0;
185
- virtual std::optional<std::function<void(const std::optional<std::string>& /* id */)>> getOnCirclePress() = 0;
186
- virtual void setOnCirclePress(const std::optional<std::function<void(const std::optional<std::string>& /* id */)>>& onCirclePress) = 0;
187
- virtual std::optional<std::function<void(const std::optional<std::string>& /* id */, const RNLatLng& /* location */)>> getOnMarkerDragStart() = 0;
188
- virtual void setOnMarkerDragStart(const std::optional<std::function<void(const std::optional<std::string>& /* id */, const RNLatLng& /* location */)>>& onMarkerDragStart) = 0;
189
- virtual std::optional<std::function<void(const std::optional<std::string>& /* id */, const RNLatLng& /* location */)>> getOnMarkerDrag() = 0;
190
- virtual void setOnMarkerDrag(const std::optional<std::function<void(const std::optional<std::string>& /* id */, const RNLatLng& /* location */)>>& onMarkerDrag) = 0;
191
- virtual std::optional<std::function<void(const std::optional<std::string>& /* id */, const RNLatLng& /* location */)>> getOnMarkerDragEnd() = 0;
192
- virtual void setOnMarkerDragEnd(const std::optional<std::function<void(const std::optional<std::string>& /* id */, const RNLatLng& /* location */)>>& onMarkerDragEnd) = 0;
179
+ virtual std::optional<std::function<void(const std::string& /* id */)>> getOnMarkerPress() = 0;
180
+ virtual void setOnMarkerPress(const std::optional<std::function<void(const std::string& /* id */)>>& onMarkerPress) = 0;
181
+ virtual std::optional<std::function<void(const std::string& /* id */)>> getOnPolylinePress() = 0;
182
+ virtual void setOnPolylinePress(const std::optional<std::function<void(const std::string& /* id */)>>& onPolylinePress) = 0;
183
+ virtual std::optional<std::function<void(const std::string& /* id */)>> getOnPolygonPress() = 0;
184
+ virtual void setOnPolygonPress(const std::optional<std::function<void(const std::string& /* id */)>>& onPolygonPress) = 0;
185
+ virtual std::optional<std::function<void(const std::string& /* id */)>> getOnCirclePress() = 0;
186
+ virtual void setOnCirclePress(const std::optional<std::function<void(const std::string& /* id */)>>& onCirclePress) = 0;
187
+ virtual std::optional<std::function<void(const std::string& /* id */, const RNLatLng& /* location */)>> getOnMarkerDragStart() = 0;
188
+ virtual void setOnMarkerDragStart(const std::optional<std::function<void(const std::string& /* id */, const RNLatLng& /* location */)>>& onMarkerDragStart) = 0;
189
+ virtual std::optional<std::function<void(const std::string& /* id */, const RNLatLng& /* location */)>> getOnMarkerDrag() = 0;
190
+ virtual void setOnMarkerDrag(const std::optional<std::function<void(const std::string& /* id */, const RNLatLng& /* location */)>>& onMarkerDrag) = 0;
191
+ virtual std::optional<std::function<void(const std::string& /* id */, const RNLatLng& /* location */)>> getOnMarkerDragEnd() = 0;
192
+ virtual void setOnMarkerDragEnd(const std::optional<std::function<void(const std::string& /* id */, const RNLatLng& /* location */)>>& onMarkerDragEnd) = 0;
193
193
  virtual std::optional<std::function<void(const RNIndoorBuilding& /* indoorBuilding */)>> getOnIndoorBuildingFocused() = 0;
194
194
  virtual void setOnIndoorBuildingFocused(const std::optional<std::function<void(const RNIndoorBuilding& /* indoorBuilding */)>>& onIndoorBuildingFocused) = 0;
195
195
  virtual std::optional<std::function<void(const RNIndoorLevel& /* indoorLevel */)>> getOnIndoorLevelActivated() = 0;
196
196
  virtual void setOnIndoorLevelActivated(const std::optional<std::function<void(const RNIndoorLevel& /* indoorLevel */)>>& onIndoorLevelActivated) = 0;
197
- virtual std::optional<std::function<void(const std::optional<std::string>& /* id */)>> getOnInfoWindowPress() = 0;
198
- virtual void setOnInfoWindowPress(const std::optional<std::function<void(const std::optional<std::string>& /* id */)>>& onInfoWindowPress) = 0;
199
- virtual std::optional<std::function<void(const std::optional<std::string>& /* id */)>> getOnInfoWindowClose() = 0;
200
- virtual void setOnInfoWindowClose(const std::optional<std::function<void(const std::optional<std::string>& /* id */)>>& onInfoWindowClose) = 0;
201
- virtual std::optional<std::function<void(const std::optional<std::string>& /* id */)>> getOnInfoWindowLongPress() = 0;
202
- virtual void setOnInfoWindowLongPress(const std::optional<std::function<void(const std::optional<std::string>& /* id */)>>& onInfoWindowLongPress) = 0;
197
+ virtual std::optional<std::function<void(const std::string& /* id */)>> getOnInfoWindowPress() = 0;
198
+ virtual void setOnInfoWindowPress(const std::optional<std::function<void(const std::string& /* id */)>>& onInfoWindowPress) = 0;
199
+ virtual std::optional<std::function<void(const std::string& /* id */)>> getOnInfoWindowClose() = 0;
200
+ virtual void setOnInfoWindowClose(const std::optional<std::function<void(const std::string& /* id */)>>& onInfoWindowClose) = 0;
201
+ virtual std::optional<std::function<void(const std::string& /* id */)>> getOnInfoWindowLongPress() = 0;
202
+ virtual void setOnInfoWindowLongPress(const std::optional<std::function<void(const std::string& /* id */)>>& onInfoWindowLongPress) = 0;
203
203
  virtual std::optional<std::function<void(const RNLocation& /* location */)>> getOnMyLocationPress() = 0;
204
204
  virtual void setOnMyLocationPress(const std::optional<std::function<void(const RNLocation& /* location */)>>& onMyLocationPress) = 0;
205
205
  virtual std::optional<std::function<void(bool /* pressed */)>> getOnMyLocationButtonPress() = 0;
@@ -213,6 +213,8 @@ namespace margelo::nitro::rngooglemapsplus {
213
213
 
214
214
  public:
215
215
  // Methods
216
+ virtual void showMarkerInfoWindow(const std::string& id) = 0;
217
+ virtual void hideMarkerInfoWindow(const std::string& id) = 0;
216
218
  virtual void setCamera(const RNCamera& camera, std::optional<bool> animated, std::optional<double> durationMs) = 0;
217
219
  virtual void setCameraToCoordinates(const std::vector<RNLatLng>& coordinates, const std::optional<RNMapPadding>& padding, std::optional<bool> animated, std::optional<double> durationMs) = 0;
218
220
  virtual void setCameraBounds(const std::optional<RNLatLngBounds>& bounds) = 0;
@@ -40,10 +40,11 @@ namespace margelo::nitro::rngooglemapsplus {
40
40
  std::optional<std::string> mapId SWIFT_PRIVATE;
41
41
  std::optional<bool> liteMode SWIFT_PRIVATE;
42
42
  std::optional<RNCamera> camera SWIFT_PRIVATE;
43
+ std::optional<std::string> backgroundColor SWIFT_PRIVATE;
43
44
 
44
45
  public:
45
46
  RNInitialProps() = default;
46
- explicit RNInitialProps(std::optional<std::string> mapId, std::optional<bool> liteMode, std::optional<RNCamera> camera): mapId(mapId), liteMode(liteMode), camera(camera) {}
47
+ explicit RNInitialProps(std::optional<std::string> mapId, std::optional<bool> liteMode, std::optional<RNCamera> camera, std::optional<std::string> backgroundColor): mapId(mapId), liteMode(liteMode), camera(camera), backgroundColor(backgroundColor) {}
47
48
  };
48
49
 
49
50
  } // namespace margelo::nitro::rngooglemapsplus
@@ -58,7 +59,8 @@ namespace margelo::nitro {
58
59
  return margelo::nitro::rngooglemapsplus::RNInitialProps(
59
60
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "mapId")),
60
61
  JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "liteMode")),
61
- JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNCamera>>::fromJSI(runtime, obj.getProperty(runtime, "camera"))
62
+ JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNCamera>>::fromJSI(runtime, obj.getProperty(runtime, "camera")),
63
+ JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "backgroundColor"))
62
64
  );
63
65
  }
64
66
  static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNInitialProps& arg) {
@@ -66,6 +68,7 @@ namespace margelo::nitro {
66
68
  obj.setProperty(runtime, "mapId", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.mapId));
67
69
  obj.setProperty(runtime, "liteMode", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.liteMode));
68
70
  obj.setProperty(runtime, "camera", JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNCamera>>::toJSI(runtime, arg.camera));
71
+ obj.setProperty(runtime, "backgroundColor", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.backgroundColor));
69
72
  return obj;
70
73
  }
71
74
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -79,6 +82,7 @@ namespace margelo::nitro {
79
82
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "mapId"))) return false;
80
83
  if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "liteMode"))) return false;
81
84
  if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNCamera>>::canConvert(runtime, obj.getProperty(runtime, "camera"))) return false;
85
+ if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "backgroundColor"))) return false;
82
86
  return true;
83
87
  }
84
88
  };
@@ -47,7 +47,6 @@ namespace margelo::nitro::rngooglemapsplus {
47
47
  std::optional<double> zIndex SWIFT_PRIVATE;
48
48
  RNLatLng coordinate SWIFT_PRIVATE;
49
49
  std::optional<RNPosition> anchor SWIFT_PRIVATE;
50
- std::optional<bool> showInfoWindow SWIFT_PRIVATE;
51
50
  std::optional<std::string> title SWIFT_PRIVATE;
52
51
  std::optional<std::string> snippet SWIFT_PRIVATE;
53
52
  std::optional<double> opacity SWIFT_PRIVATE;
@@ -56,10 +55,11 @@ namespace margelo::nitro::rngooglemapsplus {
56
55
  std::optional<double> rotation SWIFT_PRIVATE;
57
56
  std::optional<RNPosition> infoWindowAnchor SWIFT_PRIVATE;
58
57
  std::optional<RNMarkerSvg> iconSvg SWIFT_PRIVATE;
58
+ std::optional<RNMarkerSvg> infoWindowIconSvg SWIFT_PRIVATE;
59
59
 
60
60
  public:
61
61
  RNMarker() = default;
62
- explicit RNMarker(std::string id, std::optional<double> zIndex, RNLatLng coordinate, std::optional<RNPosition> anchor, std::optional<bool> showInfoWindow, std::optional<std::string> title, std::optional<std::string> snippet, std::optional<double> opacity, std::optional<bool> flat, std::optional<bool> draggable, std::optional<double> rotation, std::optional<RNPosition> infoWindowAnchor, std::optional<RNMarkerSvg> iconSvg): id(id), zIndex(zIndex), coordinate(coordinate), anchor(anchor), showInfoWindow(showInfoWindow), title(title), snippet(snippet), opacity(opacity), flat(flat), draggable(draggable), rotation(rotation), infoWindowAnchor(infoWindowAnchor), iconSvg(iconSvg) {}
62
+ explicit RNMarker(std::string id, std::optional<double> zIndex, RNLatLng coordinate, std::optional<RNPosition> anchor, std::optional<std::string> title, std::optional<std::string> snippet, std::optional<double> opacity, std::optional<bool> flat, std::optional<bool> draggable, std::optional<double> rotation, std::optional<RNPosition> infoWindowAnchor, std::optional<RNMarkerSvg> iconSvg, std::optional<RNMarkerSvg> infoWindowIconSvg): id(id), zIndex(zIndex), coordinate(coordinate), anchor(anchor), title(title), snippet(snippet), opacity(opacity), flat(flat), draggable(draggable), rotation(rotation), infoWindowAnchor(infoWindowAnchor), iconSvg(iconSvg), infoWindowIconSvg(infoWindowIconSvg) {}
63
63
  };
64
64
 
65
65
  } // namespace margelo::nitro::rngooglemapsplus
@@ -76,7 +76,6 @@ namespace margelo::nitro {
76
76
  JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "zIndex")),
77
77
  JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::fromJSI(runtime, obj.getProperty(runtime, "coordinate")),
78
78
  JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNPosition>>::fromJSI(runtime, obj.getProperty(runtime, "anchor")),
79
- JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "showInfoWindow")),
80
79
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "title")),
81
80
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "snippet")),
82
81
  JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "opacity")),
@@ -84,7 +83,8 @@ namespace margelo::nitro {
84
83
  JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "draggable")),
85
84
  JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "rotation")),
86
85
  JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNPosition>>::fromJSI(runtime, obj.getProperty(runtime, "infoWindowAnchor")),
87
- JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNMarkerSvg>>::fromJSI(runtime, obj.getProperty(runtime, "iconSvg"))
86
+ JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNMarkerSvg>>::fromJSI(runtime, obj.getProperty(runtime, "iconSvg")),
87
+ JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNMarkerSvg>>::fromJSI(runtime, obj.getProperty(runtime, "infoWindowIconSvg"))
88
88
  );
89
89
  }
90
90
  static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNMarker& arg) {
@@ -93,7 +93,6 @@ namespace margelo::nitro {
93
93
  obj.setProperty(runtime, "zIndex", JSIConverter<std::optional<double>>::toJSI(runtime, arg.zIndex));
94
94
  obj.setProperty(runtime, "coordinate", JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::toJSI(runtime, arg.coordinate));
95
95
  obj.setProperty(runtime, "anchor", JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNPosition>>::toJSI(runtime, arg.anchor));
96
- obj.setProperty(runtime, "showInfoWindow", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.showInfoWindow));
97
96
  obj.setProperty(runtime, "title", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.title));
98
97
  obj.setProperty(runtime, "snippet", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.snippet));
99
98
  obj.setProperty(runtime, "opacity", JSIConverter<std::optional<double>>::toJSI(runtime, arg.opacity));
@@ -102,6 +101,7 @@ namespace margelo::nitro {
102
101
  obj.setProperty(runtime, "rotation", JSIConverter<std::optional<double>>::toJSI(runtime, arg.rotation));
103
102
  obj.setProperty(runtime, "infoWindowAnchor", JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNPosition>>::toJSI(runtime, arg.infoWindowAnchor));
104
103
  obj.setProperty(runtime, "iconSvg", JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNMarkerSvg>>::toJSI(runtime, arg.iconSvg));
104
+ obj.setProperty(runtime, "infoWindowIconSvg", JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNMarkerSvg>>::toJSI(runtime, arg.infoWindowIconSvg));
105
105
  return obj;
106
106
  }
107
107
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -116,7 +116,6 @@ namespace margelo::nitro {
116
116
  if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "zIndex"))) return false;
117
117
  if (!JSIConverter<margelo::nitro::rngooglemapsplus::RNLatLng>::canConvert(runtime, obj.getProperty(runtime, "coordinate"))) return false;
118
118
  if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNPosition>>::canConvert(runtime, obj.getProperty(runtime, "anchor"))) return false;
119
- if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "showInfoWindow"))) return false;
120
119
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "title"))) return false;
121
120
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "snippet"))) return false;
122
121
  if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "opacity"))) return false;
@@ -125,6 +124,7 @@ namespace margelo::nitro {
125
124
  if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "rotation"))) return false;
126
125
  if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNPosition>>::canConvert(runtime, obj.getProperty(runtime, "infoWindowAnchor"))) return false;
127
126
  if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNMarkerSvg>>::canConvert(runtime, obj.getProperty(runtime, "iconSvg"))) return false;
127
+ if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNMarkerSvg>>::canConvert(runtime, obj.getProperty(runtime, "infoWindowIconSvg"))) return false;
128
128
  return true;
129
129
  }
130
130
  };
@@ -295,72 +295,72 @@ namespace margelo::nitro::rngooglemapsplus::views {
295
295
  throw std::runtime_error(std::string("RNGoogleMapsPlusView.onPoiPress: ") + exc.what());
296
296
  }
297
297
  }()),
298
- onMarkerPress([&]() -> CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>> {
298
+ onMarkerPress([&]() -> CachedProp<std::optional<std::function<void(const std::string& /* id */)>>> {
299
299
  try {
300
300
  const react::RawValue* rawValue = rawProps.at("onMarkerPress", nullptr, nullptr);
301
301
  if (rawValue == nullptr) return sourceProps.onMarkerPress;
302
302
  const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
303
- return CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onMarkerPress);
303
+ return CachedProp<std::optional<std::function<void(const std::string& /* id */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onMarkerPress);
304
304
  } catch (const std::exception& exc) {
305
305
  throw std::runtime_error(std::string("RNGoogleMapsPlusView.onMarkerPress: ") + exc.what());
306
306
  }
307
307
  }()),
308
- onPolylinePress([&]() -> CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>> {
308
+ onPolylinePress([&]() -> CachedProp<std::optional<std::function<void(const std::string& /* id */)>>> {
309
309
  try {
310
310
  const react::RawValue* rawValue = rawProps.at("onPolylinePress", nullptr, nullptr);
311
311
  if (rawValue == nullptr) return sourceProps.onPolylinePress;
312
312
  const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
313
- return CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onPolylinePress);
313
+ return CachedProp<std::optional<std::function<void(const std::string& /* id */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onPolylinePress);
314
314
  } catch (const std::exception& exc) {
315
315
  throw std::runtime_error(std::string("RNGoogleMapsPlusView.onPolylinePress: ") + exc.what());
316
316
  }
317
317
  }()),
318
- onPolygonPress([&]() -> CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>> {
318
+ onPolygonPress([&]() -> CachedProp<std::optional<std::function<void(const std::string& /* id */)>>> {
319
319
  try {
320
320
  const react::RawValue* rawValue = rawProps.at("onPolygonPress", nullptr, nullptr);
321
321
  if (rawValue == nullptr) return sourceProps.onPolygonPress;
322
322
  const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
323
- return CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onPolygonPress);
323
+ return CachedProp<std::optional<std::function<void(const std::string& /* id */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onPolygonPress);
324
324
  } catch (const std::exception& exc) {
325
325
  throw std::runtime_error(std::string("RNGoogleMapsPlusView.onPolygonPress: ") + exc.what());
326
326
  }
327
327
  }()),
328
- onCirclePress([&]() -> CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>> {
328
+ onCirclePress([&]() -> CachedProp<std::optional<std::function<void(const std::string& /* id */)>>> {
329
329
  try {
330
330
  const react::RawValue* rawValue = rawProps.at("onCirclePress", nullptr, nullptr);
331
331
  if (rawValue == nullptr) return sourceProps.onCirclePress;
332
332
  const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
333
- return CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onCirclePress);
333
+ return CachedProp<std::optional<std::function<void(const std::string& /* id */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onCirclePress);
334
334
  } catch (const std::exception& exc) {
335
335
  throw std::runtime_error(std::string("RNGoogleMapsPlusView.onCirclePress: ") + exc.what());
336
336
  }
337
337
  }()),
338
- onMarkerDragStart([&]() -> CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */, const RNLatLng& /* location */)>>> {
338
+ onMarkerDragStart([&]() -> CachedProp<std::optional<std::function<void(const std::string& /* id */, const RNLatLng& /* location */)>>> {
339
339
  try {
340
340
  const react::RawValue* rawValue = rawProps.at("onMarkerDragStart", nullptr, nullptr);
341
341
  if (rawValue == nullptr) return sourceProps.onMarkerDragStart;
342
342
  const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
343
- return CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */, const RNLatLng& /* location */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onMarkerDragStart);
343
+ return CachedProp<std::optional<std::function<void(const std::string& /* id */, const RNLatLng& /* location */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onMarkerDragStart);
344
344
  } catch (const std::exception& exc) {
345
345
  throw std::runtime_error(std::string("RNGoogleMapsPlusView.onMarkerDragStart: ") + exc.what());
346
346
  }
347
347
  }()),
348
- onMarkerDrag([&]() -> CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */, const RNLatLng& /* location */)>>> {
348
+ onMarkerDrag([&]() -> CachedProp<std::optional<std::function<void(const std::string& /* id */, const RNLatLng& /* location */)>>> {
349
349
  try {
350
350
  const react::RawValue* rawValue = rawProps.at("onMarkerDrag", nullptr, nullptr);
351
351
  if (rawValue == nullptr) return sourceProps.onMarkerDrag;
352
352
  const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
353
- return CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */, const RNLatLng& /* location */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onMarkerDrag);
353
+ return CachedProp<std::optional<std::function<void(const std::string& /* id */, const RNLatLng& /* location */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onMarkerDrag);
354
354
  } catch (const std::exception& exc) {
355
355
  throw std::runtime_error(std::string("RNGoogleMapsPlusView.onMarkerDrag: ") + exc.what());
356
356
  }
357
357
  }()),
358
- onMarkerDragEnd([&]() -> CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */, const RNLatLng& /* location */)>>> {
358
+ onMarkerDragEnd([&]() -> CachedProp<std::optional<std::function<void(const std::string& /* id */, const RNLatLng& /* location */)>>> {
359
359
  try {
360
360
  const react::RawValue* rawValue = rawProps.at("onMarkerDragEnd", nullptr, nullptr);
361
361
  if (rawValue == nullptr) return sourceProps.onMarkerDragEnd;
362
362
  const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
363
- return CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */, const RNLatLng& /* location */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onMarkerDragEnd);
363
+ return CachedProp<std::optional<std::function<void(const std::string& /* id */, const RNLatLng& /* location */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onMarkerDragEnd);
364
364
  } catch (const std::exception& exc) {
365
365
  throw std::runtime_error(std::string("RNGoogleMapsPlusView.onMarkerDragEnd: ") + exc.what());
366
366
  }
@@ -385,32 +385,32 @@ namespace margelo::nitro::rngooglemapsplus::views {
385
385
  throw std::runtime_error(std::string("RNGoogleMapsPlusView.onIndoorLevelActivated: ") + exc.what());
386
386
  }
387
387
  }()),
388
- onInfoWindowPress([&]() -> CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>> {
388
+ onInfoWindowPress([&]() -> CachedProp<std::optional<std::function<void(const std::string& /* id */)>>> {
389
389
  try {
390
390
  const react::RawValue* rawValue = rawProps.at("onInfoWindowPress", nullptr, nullptr);
391
391
  if (rawValue == nullptr) return sourceProps.onInfoWindowPress;
392
392
  const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
393
- return CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onInfoWindowPress);
393
+ return CachedProp<std::optional<std::function<void(const std::string& /* id */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onInfoWindowPress);
394
394
  } catch (const std::exception& exc) {
395
395
  throw std::runtime_error(std::string("RNGoogleMapsPlusView.onInfoWindowPress: ") + exc.what());
396
396
  }
397
397
  }()),
398
- onInfoWindowClose([&]() -> CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>> {
398
+ onInfoWindowClose([&]() -> CachedProp<std::optional<std::function<void(const std::string& /* id */)>>> {
399
399
  try {
400
400
  const react::RawValue* rawValue = rawProps.at("onInfoWindowClose", nullptr, nullptr);
401
401
  if (rawValue == nullptr) return sourceProps.onInfoWindowClose;
402
402
  const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
403
- return CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onInfoWindowClose);
403
+ return CachedProp<std::optional<std::function<void(const std::string& /* id */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onInfoWindowClose);
404
404
  } catch (const std::exception& exc) {
405
405
  throw std::runtime_error(std::string("RNGoogleMapsPlusView.onInfoWindowClose: ") + exc.what());
406
406
  }
407
407
  }()),
408
- onInfoWindowLongPress([&]() -> CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>> {
408
+ onInfoWindowLongPress([&]() -> CachedProp<std::optional<std::function<void(const std::string& /* id */)>>> {
409
409
  try {
410
410
  const react::RawValue* rawValue = rawProps.at("onInfoWindowLongPress", nullptr, nullptr);
411
411
  if (rawValue == nullptr) return sourceProps.onInfoWindowLongPress;
412
412
  const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
413
- return CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onInfoWindowLongPress);
413
+ return CachedProp<std::optional<std::function<void(const std::string& /* id */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onInfoWindowLongPress);
414
414
  } catch (const std::exception& exc) {
415
415
  throw std::runtime_error(std::string("RNGoogleMapsPlusView.onInfoWindowLongPress: ") + exc.what());
416
416
  }
@@ -93,18 +93,18 @@ namespace margelo::nitro::rngooglemapsplus::views {
93
93
  CachedProp<std::optional<std::function<void(const RNLatLng& /* coordinate */)>>> onMapPress;
94
94
  CachedProp<std::optional<std::function<void(const RNLatLng& /* coordinate */)>>> onMapLongPress;
95
95
  CachedProp<std::optional<std::function<void(const std::string& /* placeId */, const std::string& /* name */, const RNLatLng& /* coordinate */)>>> onPoiPress;
96
- CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>> onMarkerPress;
97
- CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>> onPolylinePress;
98
- CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>> onPolygonPress;
99
- CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>> onCirclePress;
100
- CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */, const RNLatLng& /* location */)>>> onMarkerDragStart;
101
- CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */, const RNLatLng& /* location */)>>> onMarkerDrag;
102
- CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */, const RNLatLng& /* location */)>>> onMarkerDragEnd;
96
+ CachedProp<std::optional<std::function<void(const std::string& /* id */)>>> onMarkerPress;
97
+ CachedProp<std::optional<std::function<void(const std::string& /* id */)>>> onPolylinePress;
98
+ CachedProp<std::optional<std::function<void(const std::string& /* id */)>>> onPolygonPress;
99
+ CachedProp<std::optional<std::function<void(const std::string& /* id */)>>> onCirclePress;
100
+ CachedProp<std::optional<std::function<void(const std::string& /* id */, const RNLatLng& /* location */)>>> onMarkerDragStart;
101
+ CachedProp<std::optional<std::function<void(const std::string& /* id */, const RNLatLng& /* location */)>>> onMarkerDrag;
102
+ CachedProp<std::optional<std::function<void(const std::string& /* id */, const RNLatLng& /* location */)>>> onMarkerDragEnd;
103
103
  CachedProp<std::optional<std::function<void(const RNIndoorBuilding& /* indoorBuilding */)>>> onIndoorBuildingFocused;
104
104
  CachedProp<std::optional<std::function<void(const RNIndoorLevel& /* indoorLevel */)>>> onIndoorLevelActivated;
105
- CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>> onInfoWindowPress;
106
- CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>> onInfoWindowClose;
107
- CachedProp<std::optional<std::function<void(const std::optional<std::string>& /* id */)>>> onInfoWindowLongPress;
105
+ CachedProp<std::optional<std::function<void(const std::string& /* id */)>>> onInfoWindowPress;
106
+ CachedProp<std::optional<std::function<void(const std::string& /* id */)>>> onInfoWindowClose;
107
+ CachedProp<std::optional<std::function<void(const std::string& /* id */)>>> onInfoWindowLongPress;
108
108
  CachedProp<std::optional<std::function<void(const RNLocation& /* location */)>>> onMyLocationPress;
109
109
  CachedProp<std::optional<std::function<void(bool /* pressed */)>>> onMyLocationButtonPress;
110
110
  CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>>> onCameraChangeStart;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-google-maps-plus",
3
- "version": "1.7.0-dev.9",
3
+ "version": "1.8.0",
4
4
  "description": "React Native wrapper for Android & iOS Google Maps SDK",
5
5
  "main": "./lib/module/index.js",
6
6
  "module": "./lib/module/index.js",
@@ -59,18 +59,18 @@ export interface RNGoogleMapsPlusViewProps extends HybridViewProps {
59
59
  onMapPress?: (coordinate: RNLatLng) => void;
60
60
  onMapLongPress?: (coordinate: RNLatLng) => void;
61
61
  onPoiPress?: (placeId: string, name: string, coordinate: RNLatLng) => void;
62
- onMarkerPress?: (id?: string | undefined) => void;
63
- onPolylinePress?: (id?: string | undefined) => void;
64
- onPolygonPress?: (id?: string | undefined) => void;
65
- onCirclePress?: (id?: string | undefined) => void;
66
- onMarkerDragStart?: (id: string | undefined, location: RNLatLng) => void;
67
- onMarkerDrag?: (id: string | undefined, location: RNLatLng) => void;
68
- onMarkerDragEnd?: (id: string | undefined, location: RNLatLng) => void;
62
+ onMarkerPress?: (id: string) => void;
63
+ onPolylinePress?: (id: string) => void;
64
+ onPolygonPress?: (id: string) => void;
65
+ onCirclePress?: (id: string) => void;
66
+ onMarkerDragStart?: (id: string, location: RNLatLng) => void;
67
+ onMarkerDrag?: (id: string, location: RNLatLng) => void;
68
+ onMarkerDragEnd?: (id: string, location: RNLatLng) => void;
69
69
  onIndoorBuildingFocused?: (indoorBuilding: RNIndoorBuilding) => void;
70
70
  onIndoorLevelActivated?: (indoorLevel: RNIndoorLevel) => void;
71
- onInfoWindowPress?: (id?: string) => void;
72
- onInfoWindowClose?: (id?: string) => void;
73
- onInfoWindowLongPress?: (id?: string) => void;
71
+ onInfoWindowPress?: (id: string) => void;
72
+ onInfoWindowClose?: (id: string) => void;
73
+ onInfoWindowLongPress?: (id: string) => void;
74
74
  onMyLocationPress?: (location: RNLocation) => void;
75
75
  onMyLocationButtonPress?: (pressed: boolean) => void;
76
76
  onCameraChangeStart?: (
@@ -91,6 +91,10 @@ export interface RNGoogleMapsPlusViewProps extends HybridViewProps {
91
91
  }
92
92
 
93
93
  export interface RNGoogleMapsPlusViewMethods extends HybridViewMethods {
94
+ showMarkerInfoWindow(id: string): void;
95
+
96
+ hideMarkerInfoWindow(id: string): void;
97
+
94
98
  setCamera(camera: RNCamera, animated?: boolean, durationMs?: number): void;
95
99
 
96
100
  setCameraToCoordinates(
package/src/types.ts CHANGED
@@ -7,6 +7,7 @@ export type RNInitialProps = {
7
7
  mapId?: string;
8
8
  liteMode?: boolean;
9
9
  camera?: RNCamera;
10
+ backgroundColor?: string;
10
11
  };
11
12
 
12
13
  export type RNMapUiSettings = {
@@ -162,7 +163,6 @@ export type RNMarker = {
162
163
  zIndex?: number;
163
164
  coordinate: RNLatLng;
164
165
  anchor?: RNPosition;
165
- showInfoWindow?: boolean;
166
166
  title?: string;
167
167
  snippet?: string;
168
168
  opacity?: number;
@@ -171,6 +171,7 @@ export type RNMarker = {
171
171
  rotation?: number;
172
172
  infoWindowAnchor?: RNPosition;
173
173
  iconSvg?: RNMarkerSvg;
174
+ infoWindowIconSvg?: RNMarkerSvg;
174
175
  };
175
176
 
176
177
  export type RNMarkerSvg = {
@@ -1,76 +0,0 @@
1
- ///
2
- /// JFunc_void_std__optional_std__string_.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 <string>
14
- #include <optional>
15
- #include <functional>
16
-
17
- namespace margelo::nitro::rngooglemapsplus {
18
-
19
- using namespace facebook;
20
-
21
- /**
22
- * Represents the Java/Kotlin callback `(id: String?) -> Unit`.
23
- * This can be passed around between C++ and Java/Kotlin.
24
- */
25
- struct JFunc_void_std__optional_std__string_: public jni::JavaClass<JFunc_void_std__optional_std__string_> {
26
- public:
27
- static auto constexpr kJavaDescriptor = "Lcom/rngooglemapsplus/Func_void_std__optional_std__string_;";
28
-
29
- public:
30
- /**
31
- * Invokes the function this `JFunc_void_std__optional_std__string_` instance holds through JNI.
32
- */
33
- void invoke(const std::optional<std::string>& id) const {
34
- static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* id */)>("invoke");
35
- method(self(), id.has_value() ? jni::make_jstring(id.value()) : nullptr);
36
- }
37
- };
38
-
39
- /**
40
- * An implementation of Func_void_std__optional_std__string_ that is backed by a C++ implementation (using `std::function<...>`)
41
- */
42
- struct JFunc_void_std__optional_std__string__cxx final: public jni::HybridClass<JFunc_void_std__optional_std__string__cxx, JFunc_void_std__optional_std__string_> {
43
- public:
44
- static jni::local_ref<JFunc_void_std__optional_std__string_::javaobject> fromCpp(const std::function<void(const std::optional<std::string>& /* id */)>& func) {
45
- return JFunc_void_std__optional_std__string__cxx::newObjectCxxArgs(func);
46
- }
47
-
48
- public:
49
- /**
50
- * Invokes the C++ `std::function<...>` this `JFunc_void_std__optional_std__string__cxx` instance holds.
51
- */
52
- void invoke_cxx(jni::alias_ref<jni::JString> id) {
53
- _func(id != nullptr ? std::make_optional(id->toStdString()) : std::nullopt);
54
- }
55
-
56
- public:
57
- [[nodiscard]]
58
- inline const std::function<void(const std::optional<std::string>& /* id */)>& getFunction() const {
59
- return _func;
60
- }
61
-
62
- public:
63
- static auto constexpr kJavaDescriptor = "Lcom/rngooglemapsplus/Func_void_std__optional_std__string__cxx;";
64
- static void registerNatives() {
65
- registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_std__optional_std__string__cxx::invoke_cxx)});
66
- }
67
-
68
- private:
69
- explicit JFunc_void_std__optional_std__string__cxx(const std::function<void(const std::optional<std::string>& /* id */)>& func): _func(func) { }
70
-
71
- private:
72
- friend HybridBase;
73
- std::function<void(const std::optional<std::string>& /* id */)> _func;
74
- };
75
-
76
- } // namespace margelo::nitro::rngooglemapsplus
@@ -1,78 +0,0 @@
1
- ///
2
- /// JFunc_void_std__optional_std__string__RNLatLng.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 <string>
14
- #include <optional>
15
- #include "RNLatLng.hpp"
16
- #include <functional>
17
- #include "JRNLatLng.hpp"
18
-
19
- namespace margelo::nitro::rngooglemapsplus {
20
-
21
- using namespace facebook;
22
-
23
- /**
24
- * Represents the Java/Kotlin callback `(id: String?, location: RNLatLng) -> Unit`.
25
- * This can be passed around between C++ and Java/Kotlin.
26
- */
27
- struct JFunc_void_std__optional_std__string__RNLatLng: public jni::JavaClass<JFunc_void_std__optional_std__string__RNLatLng> {
28
- public:
29
- static auto constexpr kJavaDescriptor = "Lcom/rngooglemapsplus/Func_void_std__optional_std__string__RNLatLng;";
30
-
31
- public:
32
- /**
33
- * Invokes the function this `JFunc_void_std__optional_std__string__RNLatLng` instance holds through JNI.
34
- */
35
- void invoke(const std::optional<std::string>& id, const RNLatLng& location) const {
36
- static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* id */, jni::alias_ref<JRNLatLng> /* location */)>("invoke");
37
- method(self(), id.has_value() ? jni::make_jstring(id.value()) : nullptr, JRNLatLng::fromCpp(location));
38
- }
39
- };
40
-
41
- /**
42
- * An implementation of Func_void_std__optional_std__string__RNLatLng that is backed by a C++ implementation (using `std::function<...>`)
43
- */
44
- struct JFunc_void_std__optional_std__string__RNLatLng_cxx final: public jni::HybridClass<JFunc_void_std__optional_std__string__RNLatLng_cxx, JFunc_void_std__optional_std__string__RNLatLng> {
45
- public:
46
- static jni::local_ref<JFunc_void_std__optional_std__string__RNLatLng::javaobject> fromCpp(const std::function<void(const std::optional<std::string>& /* id */, const RNLatLng& /* location */)>& func) {
47
- return JFunc_void_std__optional_std__string__RNLatLng_cxx::newObjectCxxArgs(func);
48
- }
49
-
50
- public:
51
- /**
52
- * Invokes the C++ `std::function<...>` this `JFunc_void_std__optional_std__string__RNLatLng_cxx` instance holds.
53
- */
54
- void invoke_cxx(jni::alias_ref<jni::JString> id, jni::alias_ref<JRNLatLng> location) {
55
- _func(id != nullptr ? std::make_optional(id->toStdString()) : std::nullopt, location->toCpp());
56
- }
57
-
58
- public:
59
- [[nodiscard]]
60
- inline const std::function<void(const std::optional<std::string>& /* id */, const RNLatLng& /* location */)>& getFunction() const {
61
- return _func;
62
- }
63
-
64
- public:
65
- static auto constexpr kJavaDescriptor = "Lcom/rngooglemapsplus/Func_void_std__optional_std__string__RNLatLng_cxx;";
66
- static void registerNatives() {
67
- registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_std__optional_std__string__RNLatLng_cxx::invoke_cxx)});
68
- }
69
-
70
- private:
71
- explicit JFunc_void_std__optional_std__string__RNLatLng_cxx(const std::function<void(const std::optional<std::string>& /* id */, const RNLatLng& /* location */)>& func): _func(func) { }
72
-
73
- private:
74
- friend HybridBase;
75
- std::function<void(const std::optional<std::string>& /* id */, const RNLatLng& /* location */)> _func;
76
- };
77
-
78
- } // namespace margelo::nitro::rngooglemapsplus