react-native-google-maps-plus 1.7.0-dev.8 → 1.7.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 (50) hide show
  1. package/android/src/main/java/com/rngooglemapsplus/GoogleMapsViewImpl.kt +122 -126
  2. package/android/src/main/java/com/rngooglemapsplus/MapMarkerBuilder.kt +33 -0
  3. package/android/src/main/java/com/rngooglemapsplus/RNGoogleMapsPlusView.kt +27 -11
  4. package/android/src/main/java/com/rngooglemapsplus/extensions/BitmapExtension.kt +35 -0
  5. package/android/src/main/java/com/rngooglemapsplus/extensions/LatLngBoundsExtension.kt +31 -0
  6. package/android/src/main/java/com/rngooglemapsplus/extensions/MapObjectTagExtensions.kt +84 -0
  7. package/ios/GoogleMapViewImpl.swift +83 -66
  8. package/ios/MapMarkerBuilder.swift +55 -2
  9. package/ios/RNGoogleMapsPlusView.swift +20 -10
  10. package/ios/extensions/MapObjectTag+Extension.swift +93 -0
  11. package/ios/extensions/UIImage+Extension.swift +45 -0
  12. package/lib/module/types.js.map +1 -1
  13. package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts +12 -10
  14. package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts.map +1 -1
  15. package/lib/typescript/src/types.d.ts +3 -0
  16. package/lib/typescript/src/types.d.ts.map +1 -1
  17. package/nitrogen/generated/android/RNGoogleMapsPlusOnLoad.cpp +4 -4
  18. package/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +75 -0
  19. package/nitrogen/generated/android/c++/JFunc_void_std__string_RNLatLng.hpp +77 -0
  20. package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.cpp +100 -92
  21. package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.hpp +22 -20
  22. package/nitrogen/generated/android/c++/JRNMapUiSettings.hpp +11 -3
  23. package/nitrogen/generated/android/c++/JRNMarker.hpp +7 -3
  24. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/{Func_void_std__optional_std__string_.kt → Func_void_std__string.kt} +12 -12
  25. 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
  26. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/HybridRNGoogleMapsPlusViewSpec.kt +38 -30
  27. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNMapUiSettings.kt +9 -3
  28. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNMarker.kt +6 -3
  29. package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.cpp +16 -8
  30. package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.hpp +58 -36
  31. package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusViewSpecSwift.hpp +32 -20
  32. package/nitrogen/generated/ios/swift/Func_void_std__optional_std__string_.swift +6 -6
  33. package/nitrogen/generated/ios/swift/Func_void_std__string.swift +47 -0
  34. package/nitrogen/generated/ios/swift/Func_void_std__string_RNLatLng.swift +47 -0
  35. package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec.swift +12 -10
  36. package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec_cxx.swift +142 -180
  37. package/nitrogen/generated/ios/swift/RNMapUiSettings.swift +61 -1
  38. package/nitrogen/generated/ios/swift/RNMarker.swift +24 -1
  39. package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.cpp +2 -0
  40. package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.hpp +22 -20
  41. package/nitrogen/generated/shared/c++/RNMapUiSettings.hpp +10 -2
  42. package/nitrogen/generated/shared/c++/RNMarker.hpp +6 -2
  43. package/nitrogen/generated/shared/c++/views/HybridRNGoogleMapsPlusViewComponent.cpp +20 -20
  44. package/nitrogen/generated/shared/c++/views/HybridRNGoogleMapsPlusViewComponent.hpp +10 -10
  45. package/package.json +1 -1
  46. package/src/RNGoogleMapsPlusView.nitro.ts +14 -10
  47. package/src/types.ts +3 -0
  48. package/nitrogen/generated/android/c++/JFunc_void_std__optional_std__string_.hpp +0 -76
  49. package/nitrogen/generated/android/c++/JFunc_void_std__optional_std__string__RNLatLng.hpp +0 -78
  50. 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;
@@ -45,10 +45,12 @@ namespace margelo::nitro::rngooglemapsplus {
45
45
  std::optional<bool> tiltEnabled SWIFT_PRIVATE;
46
46
  std::optional<bool> zoomControlsEnabled SWIFT_PRIVATE;
47
47
  std::optional<bool> zoomGesturesEnabled SWIFT_PRIVATE;
48
+ std::optional<bool> consumeOnMarkerPress SWIFT_PRIVATE;
49
+ std::optional<bool> consumeOnMyLocationButtonPress SWIFT_PRIVATE;
48
50
 
49
51
  public:
50
52
  RNMapUiSettings() = default;
51
- explicit RNMapUiSettings(std::optional<bool> allGesturesEnabled, std::optional<bool> compassEnabled, std::optional<bool> indoorLevelPickerEnabled, std::optional<bool> mapToolbarEnabled, std::optional<bool> myLocationButtonEnabled, std::optional<bool> rotateEnabled, std::optional<bool> scrollEnabled, std::optional<bool> scrollDuringRotateOrZoomEnabled, std::optional<bool> tiltEnabled, std::optional<bool> zoomControlsEnabled, std::optional<bool> zoomGesturesEnabled): allGesturesEnabled(allGesturesEnabled), compassEnabled(compassEnabled), indoorLevelPickerEnabled(indoorLevelPickerEnabled), mapToolbarEnabled(mapToolbarEnabled), myLocationButtonEnabled(myLocationButtonEnabled), rotateEnabled(rotateEnabled), scrollEnabled(scrollEnabled), scrollDuringRotateOrZoomEnabled(scrollDuringRotateOrZoomEnabled), tiltEnabled(tiltEnabled), zoomControlsEnabled(zoomControlsEnabled), zoomGesturesEnabled(zoomGesturesEnabled) {}
53
+ explicit RNMapUiSettings(std::optional<bool> allGesturesEnabled, std::optional<bool> compassEnabled, std::optional<bool> indoorLevelPickerEnabled, std::optional<bool> mapToolbarEnabled, std::optional<bool> myLocationButtonEnabled, std::optional<bool> rotateEnabled, std::optional<bool> scrollEnabled, std::optional<bool> scrollDuringRotateOrZoomEnabled, std::optional<bool> tiltEnabled, std::optional<bool> zoomControlsEnabled, std::optional<bool> zoomGesturesEnabled, std::optional<bool> consumeOnMarkerPress, std::optional<bool> consumeOnMyLocationButtonPress): allGesturesEnabled(allGesturesEnabled), compassEnabled(compassEnabled), indoorLevelPickerEnabled(indoorLevelPickerEnabled), mapToolbarEnabled(mapToolbarEnabled), myLocationButtonEnabled(myLocationButtonEnabled), rotateEnabled(rotateEnabled), scrollEnabled(scrollEnabled), scrollDuringRotateOrZoomEnabled(scrollDuringRotateOrZoomEnabled), tiltEnabled(tiltEnabled), zoomControlsEnabled(zoomControlsEnabled), zoomGesturesEnabled(zoomGesturesEnabled), consumeOnMarkerPress(consumeOnMarkerPress), consumeOnMyLocationButtonPress(consumeOnMyLocationButtonPress) {}
52
54
  };
53
55
 
54
56
  } // namespace margelo::nitro::rngooglemapsplus
@@ -71,7 +73,9 @@ namespace margelo::nitro {
71
73
  JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "scrollDuringRotateOrZoomEnabled")),
72
74
  JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "tiltEnabled")),
73
75
  JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "zoomControlsEnabled")),
74
- JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "zoomGesturesEnabled"))
76
+ JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "zoomGesturesEnabled")),
77
+ JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "consumeOnMarkerPress")),
78
+ JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "consumeOnMyLocationButtonPress"))
75
79
  );
76
80
  }
77
81
  static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNMapUiSettings& arg) {
@@ -87,6 +91,8 @@ namespace margelo::nitro {
87
91
  obj.setProperty(runtime, "tiltEnabled", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.tiltEnabled));
88
92
  obj.setProperty(runtime, "zoomControlsEnabled", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.zoomControlsEnabled));
89
93
  obj.setProperty(runtime, "zoomGesturesEnabled", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.zoomGesturesEnabled));
94
+ obj.setProperty(runtime, "consumeOnMarkerPress", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.consumeOnMarkerPress));
95
+ obj.setProperty(runtime, "consumeOnMyLocationButtonPress", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.consumeOnMyLocationButtonPress));
90
96
  return obj;
91
97
  }
92
98
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -108,6 +114,8 @@ namespace margelo::nitro {
108
114
  if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "tiltEnabled"))) return false;
109
115
  if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "zoomControlsEnabled"))) return false;
110
116
  if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "zoomGesturesEnabled"))) return false;
117
+ if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "consumeOnMarkerPress"))) return false;
118
+ if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "consumeOnMyLocationButtonPress"))) return false;
111
119
  return true;
112
120
  }
113
121
  };
@@ -56,10 +56,11 @@ namespace margelo::nitro::rngooglemapsplus {
56
56
  std::optional<double> rotation SWIFT_PRIVATE;
57
57
  std::optional<RNPosition> infoWindowAnchor SWIFT_PRIVATE;
58
58
  std::optional<RNMarkerSvg> iconSvg SWIFT_PRIVATE;
59
+ std::optional<RNMarkerSvg> infoWindowIconSvg SWIFT_PRIVATE;
59
60
 
60
61
  public:
61
62
  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) {}
63
+ 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, std::optional<RNMarkerSvg> infoWindowIconSvg): 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), infoWindowIconSvg(infoWindowIconSvg) {}
63
64
  };
64
65
 
65
66
  } // namespace margelo::nitro::rngooglemapsplus
@@ -84,7 +85,8 @@ namespace margelo::nitro {
84
85
  JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "draggable")),
85
86
  JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "rotation")),
86
87
  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"))
88
+ JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNMarkerSvg>>::fromJSI(runtime, obj.getProperty(runtime, "iconSvg")),
89
+ JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNMarkerSvg>>::fromJSI(runtime, obj.getProperty(runtime, "infoWindowIconSvg"))
88
90
  );
89
91
  }
90
92
  static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNMarker& arg) {
@@ -102,6 +104,7 @@ namespace margelo::nitro {
102
104
  obj.setProperty(runtime, "rotation", JSIConverter<std::optional<double>>::toJSI(runtime, arg.rotation));
103
105
  obj.setProperty(runtime, "infoWindowAnchor", JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNPosition>>::toJSI(runtime, arg.infoWindowAnchor));
104
106
  obj.setProperty(runtime, "iconSvg", JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNMarkerSvg>>::toJSI(runtime, arg.iconSvg));
107
+ obj.setProperty(runtime, "infoWindowIconSvg", JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNMarkerSvg>>::toJSI(runtime, arg.infoWindowIconSvg));
105
108
  return obj;
106
109
  }
107
110
  static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
@@ -125,6 +128,7 @@ namespace margelo::nitro {
125
128
  if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "rotation"))) return false;
126
129
  if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNPosition>>::canConvert(runtime, obj.getProperty(runtime, "infoWindowAnchor"))) return false;
127
130
  if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNMarkerSvg>>::canConvert(runtime, obj.getProperty(runtime, "iconSvg"))) return false;
131
+ if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNMarkerSvg>>::canConvert(runtime, obj.getProperty(runtime, "infoWindowIconSvg"))) return false;
128
132
  return true;
129
133
  }
130
134
  };
@@ -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.8",
3
+ "version": "1.7.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
@@ -21,6 +21,8 @@ export type RNMapUiSettings = {
21
21
  tiltEnabled?: boolean;
22
22
  zoomControlsEnabled?: boolean;
23
23
  zoomGesturesEnabled?: boolean;
24
+ consumeOnMarkerPress?: boolean;
25
+ consumeOnMyLocationButtonPress?: boolean;
24
26
  };
25
27
 
26
28
  export type RNLatLng = {
@@ -169,6 +171,7 @@ export type RNMarker = {
169
171
  rotation?: number;
170
172
  infoWindowAnchor?: RNPosition;
171
173
  iconSvg?: RNMarkerSvg;
174
+ infoWindowIconSvg?: RNMarkerSvg;
172
175
  };
173
176
 
174
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
@@ -1,54 +0,0 @@
1
- ///
2
- /// Func_void_std__optional_std__string__RNLatLng.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
- /**
12
- * Wraps a Swift `(_ id: String?, _ location: RNLatLng) -> Void` as a class.
13
- * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
14
- */
15
- public final class Func_void_std__optional_std__string__RNLatLng {
16
- public typealias bridge = margelo.nitro.rngooglemapsplus.bridge.swift
17
-
18
- private let closure: (_ id: String?, _ location: RNLatLng) -> Void
19
-
20
- public init(_ closure: @escaping (_ id: String?, _ location: RNLatLng) -> Void) {
21
- self.closure = closure
22
- }
23
-
24
- @inline(__always)
25
- public func call(id: bridge.std__optional_std__string_, location: RNLatLng) -> Void {
26
- self.closure({ () -> String? in
27
- if bridge.has_value_std__optional_std__string_(id) {
28
- let __unwrapped = bridge.get_std__optional_std__string_(id)
29
- return String(__unwrapped)
30
- } else {
31
- return nil
32
- }
33
- }(), location)
34
- }
35
-
36
- /**
37
- * Casts this instance to a retained unsafe raw pointer.
38
- * This acquires one additional strong reference on the object!
39
- */
40
- @inline(__always)
41
- public func toUnsafe() -> UnsafeMutableRawPointer {
42
- return Unmanaged.passRetained(self).toOpaque()
43
- }
44
-
45
- /**
46
- * Casts an unsafe pointer to a `Func_void_std__optional_std__string__RNLatLng`.
47
- * The pointer has to be a retained opaque `Unmanaged<Func_void_std__optional_std__string__RNLatLng>`.
48
- * This removes one strong reference from the object!
49
- */
50
- @inline(__always)
51
- public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__optional_std__string__RNLatLng {
52
- return Unmanaged<Func_void_std__optional_std__string__RNLatLng>.fromOpaque(pointer).takeRetainedValue()
53
- }
54
- }