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

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 (88) 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 +124 -128
  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 +34 -16
  9. package/android/src/main/java/com/rngooglemapsplus/extensions/BitmapExtension.kt +35 -0
  10. package/android/src/main/java/com/rngooglemapsplus/extensions/CameraPositionExtension.kt +3 -2
  11. package/android/src/main/java/com/rngooglemapsplus/extensions/LatLngBoundsExtension.kt +31 -0
  12. package/android/src/main/java/com/rngooglemapsplus/extensions/MapObjectTagExtensions.kt +84 -0
  13. package/android/src/main/java/com/rngooglemapsplus/extensions/RNLineCapTypeExtension.kt +14 -0
  14. package/android/src/main/java/com/rngooglemapsplus/extensions/RNLineJoinTypeExtension.kt +12 -0
  15. package/android/src/main/java/com/rngooglemapsplus/extensions/RNMapCircleExtension.kt +7 -1
  16. package/android/src/main/java/com/rngooglemapsplus/extensions/RNMarkerExtension.kt +54 -17
  17. package/android/src/main/java/com/rngooglemapsplus/extensions/RNPolygonExtension.kt +31 -1
  18. package/android/src/main/java/com/rngooglemapsplus/extensions/RNPolylineExtension.kt +6 -1
  19. package/ios/GoogleMapViewImpl.swift +89 -69
  20. package/ios/LocationHandler.swift +3 -1
  21. package/ios/MapCircleBuilder.swift +2 -3
  22. package/ios/MapHelper.swift +3 -5
  23. package/ios/MapMarkerBuilder.swift +147 -91
  24. package/ios/MapPolygonBuilder.swift +6 -41
  25. package/ios/MapPolylineBuilder.swift +2 -10
  26. package/ios/RNGoogleMapsPlusView.swift +49 -33
  27. package/ios/extensions/GMSCameraPosition+Extension.swift +2 -2
  28. package/ios/extensions/MapObjectTag+Extension.swift +93 -0
  29. package/ios/extensions/RNCircle+Extension.swift +14 -5
  30. package/ios/extensions/RNLatLng+Extension.swift +11 -0
  31. package/ios/extensions/RNLineCapType+Extension.swift +10 -0
  32. package/ios/extensions/RNLineJoinType+Extension.swift +11 -0
  33. package/ios/extensions/RNMarker+Extension.swift +43 -12
  34. package/ios/extensions/RNPolygon+Extension.swift.swift +50 -21
  35. package/ios/extensions/RNPolyline+Extension.swift.swift +15 -26
  36. package/ios/extensions/SVGKImage+Extension.swift +22 -0
  37. package/ios/extensions/UIImage+Extension.swift +45 -0
  38. package/lib/module/types.js.map +1 -1
  39. package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts +17 -15
  40. package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts.map +1 -1
  41. package/lib/typescript/src/types.d.ts +8 -1
  42. package/lib/typescript/src/types.d.ts.map +1 -1
  43. package/nitrogen/generated/android/RNGoogleMapsPlusOnLoad.cpp +8 -8
  44. package/nitrogen/generated/android/c++/{JFunc_void_RNRegion_RNCamera.hpp → JFunc_void_RNRegion_RNCameraChange.hpp} +21 -22
  45. package/nitrogen/generated/android/c++/JFunc_void_RNRegion_RNCameraChange_bool.hpp +82 -0
  46. package/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +75 -0
  47. package/nitrogen/generated/android/c++/JFunc_void_std__string_RNLatLng.hpp +77 -0
  48. package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.cpp +142 -130
  49. package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.hpp +30 -28
  50. package/nitrogen/generated/android/c++/JRNCameraChange.hpp +70 -0
  51. package/nitrogen/generated/android/c++/JRNInitialProps.hpp +7 -3
  52. package/nitrogen/generated/android/c++/JRNMarker.hpp +7 -7
  53. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/{Func_void_RNRegion_RNCamera.kt → Func_void_RNRegion_RNCameraChange.kt} +9 -9
  54. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/{Func_void_RNRegion_RNCamera_bool.kt → Func_void_RNRegion_RNCameraChange_bool.kt} +9 -9
  55. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/{Func_void_std__optional_std__string_.kt → Func_void_std__string.kt} +12 -12
  56. 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
  57. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/HybridRNGoogleMapsPlusViewSpec.kt +50 -42
  58. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNCameraChange.kt +46 -0
  59. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNInitialProps.kt +6 -3
  60. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNMarker.kt +6 -6
  61. package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.cpp +24 -16
  62. package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.hpp +97 -72
  63. package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Umbrella.hpp +3 -0
  64. package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusViewSpecSwift.hpp +43 -28
  65. package/nitrogen/generated/ios/swift/{Func_void_RNRegion_RNCamera.swift → Func_void_RNRegion_RNCameraChange.swift} +10 -10
  66. package/nitrogen/generated/ios/swift/{Func_void_RNRegion_RNCamera_bool.swift → Func_void_RNRegion_RNCameraChange_bool.swift} +10 -10
  67. package/nitrogen/generated/ios/swift/Func_void_std__optional_std__string_.swift +6 -6
  68. package/nitrogen/generated/ios/swift/Func_void_std__string.swift +47 -0
  69. package/nitrogen/generated/ios/swift/Func_void_std__string_RNLatLng.swift +47 -0
  70. package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec.swift +16 -14
  71. package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec_cxx.swift +186 -224
  72. package/nitrogen/generated/ios/swift/RNCameraChange.swift +68 -0
  73. package/nitrogen/generated/ios/swift/RNInitialProps.swift +31 -1
  74. package/nitrogen/generated/ios/swift/RNMarker.swift +24 -31
  75. package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.cpp +2 -0
  76. package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.hpp +36 -31
  77. package/nitrogen/generated/shared/c++/RNCameraChange.hpp +88 -0
  78. package/nitrogen/generated/shared/c++/RNInitialProps.hpp +6 -2
  79. package/nitrogen/generated/shared/c++/RNMarker.hpp +6 -6
  80. package/nitrogen/generated/shared/c++/views/HybridRNGoogleMapsPlusViewComponent.cpp +28 -28
  81. package/nitrogen/generated/shared/c++/views/HybridRNGoogleMapsPlusViewComponent.hpp +15 -15
  82. package/package.json +1 -1
  83. package/src/RNGoogleMapsPlusView.nitro.ts +19 -14
  84. package/src/types.ts +9 -1
  85. package/nitrogen/generated/android/c++/JFunc_void_RNRegion_RNCamera_bool.hpp +0 -83
  86. package/nitrogen/generated/android/c++/JFunc_void_std__optional_std__string_.hpp +0 -76
  87. package/nitrogen/generated/android/c++/JFunc_void_std__optional_std__string__RNLatLng.hpp +0 -78
  88. package/nitrogen/generated/ios/swift/Func_void_std__optional_std__string__RNLatLng.swift +0 -54
@@ -235,12 +235,12 @@ namespace margelo::nitro::rngooglemapsplus::views {
235
235
  throw std::runtime_error(std::string("RNGoogleMapsPlusView.onMapReady: ") + exc.what());
236
236
  }
237
237
  }()),
238
- onMapLoaded([&]() -> CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */)>>> {
238
+ onMapLoaded([&]() -> CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */)>>> {
239
239
  try {
240
240
  const react::RawValue* rawValue = rawProps.at("onMapLoaded", nullptr, nullptr);
241
241
  if (rawValue == nullptr) return sourceProps.onMapLoaded;
242
242
  const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
243
- return CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onMapLoaded);
243
+ return CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onMapLoaded);
244
244
  } catch (const std::exception& exc) {
245
245
  throw std::runtime_error(std::string("RNGoogleMapsPlusView.onMapLoaded: ") + exc.what());
246
246
  }
@@ -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
  }
@@ -435,32 +435,32 @@ namespace margelo::nitro::rngooglemapsplus::views {
435
435
  throw std::runtime_error(std::string("RNGoogleMapsPlusView.onMyLocationButtonPress: ") + exc.what());
436
436
  }
437
437
  }()),
438
- onCameraChangeStart([&]() -> CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>>> {
438
+ onCameraChangeStart([&]() -> CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */, bool /* isGesture */)>>> {
439
439
  try {
440
440
  const react::RawValue* rawValue = rawProps.at("onCameraChangeStart", nullptr, nullptr);
441
441
  if (rawValue == nullptr) return sourceProps.onCameraChangeStart;
442
442
  const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
443
- return CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onCameraChangeStart);
443
+ return CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */, bool /* isGesture */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onCameraChangeStart);
444
444
  } catch (const std::exception& exc) {
445
445
  throw std::runtime_error(std::string("RNGoogleMapsPlusView.onCameraChangeStart: ") + exc.what());
446
446
  }
447
447
  }()),
448
- onCameraChange([&]() -> CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>>> {
448
+ onCameraChange([&]() -> CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */, bool /* isGesture */)>>> {
449
449
  try {
450
450
  const react::RawValue* rawValue = rawProps.at("onCameraChange", nullptr, nullptr);
451
451
  if (rawValue == nullptr) return sourceProps.onCameraChange;
452
452
  const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
453
- return CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onCameraChange);
453
+ return CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */, bool /* isGesture */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onCameraChange);
454
454
  } catch (const std::exception& exc) {
455
455
  throw std::runtime_error(std::string("RNGoogleMapsPlusView.onCameraChange: ") + exc.what());
456
456
  }
457
457
  }()),
458
- onCameraChangeComplete([&]() -> CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>>> {
458
+ onCameraChangeComplete([&]() -> CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */, bool /* isGesture */)>>> {
459
459
  try {
460
460
  const react::RawValue* rawValue = rawProps.at("onCameraChangeComplete", nullptr, nullptr);
461
461
  if (rawValue == nullptr) return sourceProps.onCameraChangeComplete;
462
462
  const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
463
- return CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onCameraChangeComplete);
463
+ return CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */, bool /* isGesture */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onCameraChangeComplete);
464
464
  } catch (const std::exception& exc) {
465
465
  throw std::runtime_error(std::string("RNGoogleMapsPlusView.onCameraChangeComplete: ") + exc.what());
466
466
  }
@@ -36,7 +36,7 @@
36
36
  #include "RNMapErrorCode.hpp"
37
37
  #include <functional>
38
38
  #include "RNRegion.hpp"
39
- #include "RNCamera.hpp"
39
+ #include "RNCameraChange.hpp"
40
40
  #include "RNLocation.hpp"
41
41
  #include "RNLocationErrorCode.hpp"
42
42
  #include "RNLatLng.hpp"
@@ -87,29 +87,29 @@ namespace margelo::nitro::rngooglemapsplus::views {
87
87
  CachedProp<std::optional<RNLocationConfig>> locationConfig;
88
88
  CachedProp<std::optional<std::function<void(RNMapErrorCode /* error */)>>> onMapError;
89
89
  CachedProp<std::optional<std::function<void(bool /* ready */)>>> onMapReady;
90
- CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */)>>> onMapLoaded;
90
+ CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */)>>> onMapLoaded;
91
91
  CachedProp<std::optional<std::function<void(const RNLocation& /* location */)>>> onLocationUpdate;
92
92
  CachedProp<std::optional<std::function<void(RNLocationErrorCode /* error */)>>> onLocationError;
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
- CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>>> onCameraChangeStart;
111
- CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>>> onCameraChange;
112
- CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>>> onCameraChangeComplete;
110
+ CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */, bool /* isGesture */)>>> onCameraChangeStart;
111
+ CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */, bool /* isGesture */)>>> onCameraChange;
112
+ CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCameraChange& /* camera */, bool /* isGesture */)>>> onCameraChangeComplete;
113
113
  CachedProp<std::optional<std::function<void(const std::shared_ptr<HybridRNGoogleMapsPlusViewSpec>& /* ref */)>>> hybridRef;
114
114
 
115
115
  private:
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-dev.1",
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",
@@ -5,6 +5,7 @@ import type {
5
5
  } from 'react-native-nitro-modules';
6
6
  import type {
7
7
  RNCamera,
8
+ RNCameraChange,
8
9
  RNLatLng,
9
10
  RNMapPadding,
10
11
  RNPolygon,
@@ -53,44 +54,48 @@ export interface RNGoogleMapsPlusViewProps extends HybridViewProps {
53
54
  locationConfig?: RNLocationConfig;
54
55
  onMapError?: (error: RNMapErrorCode) => void;
55
56
  onMapReady?: (ready: boolean) => void;
56
- onMapLoaded?: (region: RNRegion, camera: RNCamera) => void;
57
+ onMapLoaded?: (region: RNRegion, camera: RNCameraChange) => void;
57
58
  onLocationUpdate?: (location: RNLocation) => void;
58
59
  onLocationError?: (error: RNLocationErrorCode) => void;
59
60
  onMapPress?: (coordinate: RNLatLng) => void;
60
61
  onMapLongPress?: (coordinate: RNLatLng) => void;
61
62
  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;
63
+ onMarkerPress?: (id: string) => void;
64
+ onPolylinePress?: (id: string) => void;
65
+ onPolygonPress?: (id: string) => void;
66
+ onCirclePress?: (id: string) => void;
67
+ onMarkerDragStart?: (id: string, location: RNLatLng) => void;
68
+ onMarkerDrag?: (id: string, location: RNLatLng) => void;
69
+ onMarkerDragEnd?: (id: string, location: RNLatLng) => void;
69
70
  onIndoorBuildingFocused?: (indoorBuilding: RNIndoorBuilding) => void;
70
71
  onIndoorLevelActivated?: (indoorLevel: RNIndoorLevel) => void;
71
- onInfoWindowPress?: (id?: string) => void;
72
- onInfoWindowClose?: (id?: string) => void;
73
- onInfoWindowLongPress?: (id?: string) => void;
72
+ onInfoWindowPress?: (id: string) => void;
73
+ onInfoWindowClose?: (id: string) => void;
74
+ onInfoWindowLongPress?: (id: string) => void;
74
75
  onMyLocationPress?: (location: RNLocation) => void;
75
76
  onMyLocationButtonPress?: (pressed: boolean) => void;
76
77
  onCameraChangeStart?: (
77
78
  region: RNRegion,
78
- camera: RNCamera,
79
+ camera: RNCameraChange,
79
80
  isGesture: boolean
80
81
  ) => void;
81
82
  onCameraChange?: (
82
83
  region: RNRegion,
83
- camera: RNCamera,
84
+ camera: RNCameraChange,
84
85
  isGesture: boolean
85
86
  ) => void;
86
87
  onCameraChangeComplete?: (
87
88
  region: RNRegion,
88
- camera: RNCamera,
89
+ camera: RNCameraChange,
89
90
  isGesture: boolean
90
91
  ) => void;
91
92
  }
92
93
 
93
94
  export interface RNGoogleMapsPlusViewMethods extends HybridViewMethods {
95
+ showMarkerInfoWindow(id: string): void;
96
+
97
+ hideMarkerInfoWindow(id: string): void;
98
+
94
99
  setCamera(camera: RNCamera, animated?: boolean, durationMs?: number): void;
95
100
 
96
101
  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 = {
@@ -129,6 +130,13 @@ export interface RNMapStyleElement {
129
130
  stylers: RNMapStyler[];
130
131
  }
131
132
 
133
+ export type RNCameraChange = {
134
+ center: RNLatLng;
135
+ zoom: number;
136
+ bearing: number;
137
+ tilt: number;
138
+ };
139
+
132
140
  export type RNCamera = {
133
141
  center?: RNLatLng;
134
142
  zoom?: number;
@@ -162,7 +170,6 @@ export type RNMarker = {
162
170
  zIndex?: number;
163
171
  coordinate: RNLatLng;
164
172
  anchor?: RNPosition;
165
- showInfoWindow?: boolean;
166
173
  title?: string;
167
174
  snippet?: string;
168
175
  opacity?: number;
@@ -171,6 +178,7 @@ export type RNMarker = {
171
178
  rotation?: number;
172
179
  infoWindowAnchor?: RNPosition;
173
180
  iconSvg?: RNMarkerSvg;
181
+ infoWindowIconSvg?: RNMarkerSvg;
174
182
  };
175
183
 
176
184
  export type RNMarkerSvg = {
@@ -1,83 +0,0 @@
1
- ///
2
- /// JFunc_void_RNRegion_RNCamera_bool.hpp
3
- /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
- /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2025 Marc Rousavy @ Margelo
6
- ///
7
-
8
- #pragma once
9
-
10
- #include <fbjni/fbjni.h>
11
- #include <functional>
12
-
13
- #include "RNRegion.hpp"
14
- #include "RNCamera.hpp"
15
- #include <functional>
16
- #include "JRNRegion.hpp"
17
- #include "RNLatLng.hpp"
18
- #include "JRNLatLng.hpp"
19
- #include "RNLatLngBounds.hpp"
20
- #include "JRNLatLngBounds.hpp"
21
- #include "JRNCamera.hpp"
22
- #include <optional>
23
-
24
- namespace margelo::nitro::rngooglemapsplus {
25
-
26
- using namespace facebook;
27
-
28
- /**
29
- * Represents the Java/Kotlin callback `(region: RNRegion, camera: RNCamera, isGesture: Boolean) -> Unit`.
30
- * This can be passed around between C++ and Java/Kotlin.
31
- */
32
- struct JFunc_void_RNRegion_RNCamera_bool: public jni::JavaClass<JFunc_void_RNRegion_RNCamera_bool> {
33
- public:
34
- static auto constexpr kJavaDescriptor = "Lcom/rngooglemapsplus/Func_void_RNRegion_RNCamera_bool;";
35
-
36
- public:
37
- /**
38
- * Invokes the function this `JFunc_void_RNRegion_RNCamera_bool` instance holds through JNI.
39
- */
40
- void invoke(const RNRegion& region, const RNCamera& camera, bool isGesture) const {
41
- static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JRNRegion> /* region */, jni::alias_ref<JRNCamera> /* camera */, jboolean /* isGesture */)>("invoke");
42
- method(self(), JRNRegion::fromCpp(region), JRNCamera::fromCpp(camera), isGesture);
43
- }
44
- };
45
-
46
- /**
47
- * An implementation of Func_void_RNRegion_RNCamera_bool that is backed by a C++ implementation (using `std::function<...>`)
48
- */
49
- struct JFunc_void_RNRegion_RNCamera_bool_cxx final: public jni::HybridClass<JFunc_void_RNRegion_RNCamera_bool_cxx, JFunc_void_RNRegion_RNCamera_bool> {
50
- public:
51
- static jni::local_ref<JFunc_void_RNRegion_RNCamera_bool::javaobject> fromCpp(const std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>& func) {
52
- return JFunc_void_RNRegion_RNCamera_bool_cxx::newObjectCxxArgs(func);
53
- }
54
-
55
- public:
56
- /**
57
- * Invokes the C++ `std::function<...>` this `JFunc_void_RNRegion_RNCamera_bool_cxx` instance holds.
58
- */
59
- void invoke_cxx(jni::alias_ref<JRNRegion> region, jni::alias_ref<JRNCamera> camera, jboolean isGesture) {
60
- _func(region->toCpp(), camera->toCpp(), static_cast<bool>(isGesture));
61
- }
62
-
63
- public:
64
- [[nodiscard]]
65
- inline const std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>& getFunction() const {
66
- return _func;
67
- }
68
-
69
- public:
70
- static auto constexpr kJavaDescriptor = "Lcom/rngooglemapsplus/Func_void_RNRegion_RNCamera_bool_cxx;";
71
- static void registerNatives() {
72
- registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_RNRegion_RNCamera_bool_cxx::invoke_cxx)});
73
- }
74
-
75
- private:
76
- explicit JFunc_void_RNRegion_RNCamera_bool_cxx(const std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>& func): _func(func) { }
77
-
78
- private:
79
- friend HybridBase;
80
- std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)> _func;
81
- };
82
-
83
- } // namespace margelo::nitro::rngooglemapsplus
@@ -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