react-native-google-maps-plus 0.1.0 → 1.0.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.
- package/LICENSE +20 -0
- package/README.md +156 -0
- package/RNGoogleMapsPlus.podspec +34 -0
- package/android/CMakeLists.txt +32 -0
- package/android/build.gradle +135 -0
- package/android/fix-prefab.gradle +51 -0
- package/android/gradle.properties +8 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/cpp/cpp-adapter.cpp +6 -0
- package/android/src/main/java/com/rngooglemapsplus/Color.kt +65 -0
- package/android/src/main/java/com/rngooglemapsplus/GoogleMapsViewImpl.kt +847 -0
- package/android/src/main/java/com/rngooglemapsplus/LocationHandler.kt +205 -0
- package/android/src/main/java/com/rngooglemapsplus/MapCircle.kt +29 -0
- package/android/src/main/java/com/rngooglemapsplus/MapMarker.kt +146 -0
- package/android/src/main/java/com/rngooglemapsplus/MapPolygon.kt +38 -0
- package/android/src/main/java/com/rngooglemapsplus/MapPolyline.kt +61 -0
- package/android/src/main/java/com/rngooglemapsplus/PermissionHandler.kt +116 -0
- package/android/src/main/java/com/rngooglemapsplus/PlayServicesHandler.kt +25 -0
- package/android/src/main/java/com/rngooglemapsplus/RNGoogleMapsPlusModule.kt +22 -0
- package/android/src/main/java/com/rngooglemapsplus/RNGoogleMapsPlusPackage.kt +35 -0
- package/android/src/main/java/com/rngooglemapsplus/RNGoogleMapsPlusView.kt +364 -0
- package/ios/Color.swift +109 -0
- package/ios/GoogleMapViewImpl.swift +645 -0
- package/ios/LocationHandler.swift +205 -0
- package/ios/MapCircle.swift +43 -0
- package/ios/MapHelper.swift +18 -0
- package/ios/MapMarker.swift +200 -0
- package/ios/MapPolygon.swift +58 -0
- package/ios/MapPolyline.swift +85 -0
- package/ios/PermissionHandler.swift +73 -0
- package/ios/RNGoogleMapsPlusModule.swift +27 -0
- package/ios/RNGoogleMapsPlusView.swift +391 -0
- package/lib/module/RNGoogleMapsPlusModule.nitro.js +4 -0
- package/lib/module/RNGoogleMapsPlusModule.nitro.js.map +1 -0
- package/lib/module/RNGoogleMapsPlusView.nitro.js +4 -0
- package/lib/module/RNGoogleMapsPlusView.nitro.js.map +1 -0
- package/lib/module/index.js +8 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/types.js +78 -0
- package/lib/module/types.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/RNGoogleMapsPlusModule.nitro.d.ts +12 -0
- package/lib/typescript/src/RNGoogleMapsPlusModule.nitro.d.ts.map +1 -0
- package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts +39 -0
- package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +7 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +131 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/nitro.json +28 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/RNGoogleMapsPlus+autolinking.cmake +85 -0
- package/nitrogen/generated/android/RNGoogleMapsPlus+autolinking.gradle +27 -0
- package/nitrogen/generated/android/RNGoogleMapsPlusOnLoad.cpp +70 -0
- package/nitrogen/generated/android/RNGoogleMapsPlusOnLoad.hpp +25 -0
- package/nitrogen/generated/android/c++/JFunc_void_RNLatLng.hpp +76 -0
- package/nitrogen/generated/android/c++/JFunc_void_RNLocation.hpp +78 -0
- package/nitrogen/generated/android/c++/JFunc_void_RNLocationErrorCode.hpp +76 -0
- package/nitrogen/generated/android/c++/JFunc_void_RNMapErrorCode.hpp +76 -0
- package/nitrogen/generated/android/c++/JFunc_void_RNRegion_RNCamera_bool.hpp +81 -0
- package/nitrogen/generated/android/c++/JFunc_void_bool.hpp +74 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +75 -0
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusModuleSpec.cpp +83 -0
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusModuleSpec.hpp +67 -0
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.cpp +589 -0
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.hpp +118 -0
- package/nitrogen/generated/android/c++/JRNAndroidLocationPermissionResult.hpp +62 -0
- package/nitrogen/generated/android/c++/JRNCamera.hpp +67 -0
- package/nitrogen/generated/android/c++/JRNCircle.hpp +84 -0
- package/nitrogen/generated/android/c++/JRNIOSPermissionResult.hpp +59 -0
- package/nitrogen/generated/android/c++/JRNInitialProps.hpp +66 -0
- package/nitrogen/generated/android/c++/JRNLatLng.hpp +57 -0
- package/nitrogen/generated/android/c++/JRNLineCapType.hpp +62 -0
- package/nitrogen/generated/android/c++/JRNLineJoinType.hpp +62 -0
- package/nitrogen/generated/android/c++/JRNLocation.hpp +58 -0
- package/nitrogen/generated/android/c++/JRNLocationErrorCode.hpp +71 -0
- package/nitrogen/generated/android/c++/JRNLocationPermissionResult.hpp +61 -0
- package/nitrogen/generated/android/c++/JRNMapErrorCode.hpp +74 -0
- package/nitrogen/generated/android/c++/JRNMapPadding.hpp +65 -0
- package/nitrogen/generated/android/c++/JRNMapType.hpp +68 -0
- package/nitrogen/generated/android/c++/JRNMarker.hpp +82 -0
- package/nitrogen/generated/android/c++/JRNPolygon.hpp +98 -0
- package/nitrogen/generated/android/c++/JRNPolyline.hpp +106 -0
- package/nitrogen/generated/android/c++/JRNPosition.hpp +57 -0
- package/nitrogen/generated/android/c++/JRNRegion.hpp +62 -0
- package/nitrogen/generated/android/c++/JRNUserInterfaceStyle.hpp +62 -0
- package/nitrogen/generated/android/c++/views/JHybridRNGoogleMapsPlusViewStateUpdater.cpp +152 -0
- package/nitrogen/generated/android/c++/views/JHybridRNGoogleMapsPlusViewStateUpdater.hpp +49 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/Func_void_RNLatLng.kt +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/Func_void_RNLocation.kt +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/Func_void_RNLocationErrorCode.kt +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/Func_void_RNMapErrorCode.kt +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/Func_void_RNRegion_RNCamera_bool.kt +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/Func_void_bool.kt +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/Func_void_std__string.kt +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/HybridRNGoogleMapsPlusModuleSpec.kt +64 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/HybridRNGoogleMapsPlusViewSpec.kt +317 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNAndroidLocationPermissionResult.kt +22 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNCamera.kt +38 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNCircle.kt +50 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNGoogleMapsPlusOnLoad.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNIOSPermissionResult.kt +21 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNInitialProps.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNLatLng.kt +32 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNLineCapType.kt +22 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNLineJoinType.kt +22 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNLocation.kt +32 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNLocationErrorCode.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNLocationPermissionResult.kt +32 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNMapErrorCode.kt +26 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNMapPadding.kt +38 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNMapType.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNMarker.kt +47 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNPolygon.kt +47 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNPolyline.kt +50 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNPosition.kt +32 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNRegion.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNUserInterfaceStyle.kt +22 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/views/HybridRNGoogleMapsPlusViewManager.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/views/HybridRNGoogleMapsPlusViewStateUpdater.kt +23 -0
- package/nitrogen/generated/ios/RNGoogleMapsPlus+autolinking.rb +60 -0
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.cpp +121 -0
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.hpp +792 -0
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Umbrella.hpp +113 -0
- package/nitrogen/generated/ios/RNGoogleMapsPlusAutolinking.mm +41 -0
- package/nitrogen/generated/ios/RNGoogleMapsPlusAutolinking.swift +40 -0
- package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusModuleSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusModuleSpecSwift.hpp +102 -0
- package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusViewSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusViewSpecSwift.hpp +342 -0
- package/nitrogen/generated/ios/c++/views/HybridRNGoogleMapsPlusViewComponent.mm +216 -0
- package/nitrogen/generated/ios/swift/Func_void_RNLatLng.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_RNLocation.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_RNLocationErrorCode.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_RNLocationPermissionResult.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_RNMapErrorCode.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_RNRegion_RNCamera_bool.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusModuleSpec.swift +52 -0
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusModuleSpec_cxx.swift +164 -0
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec.swift +78 -0
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec_cxx.swift +881 -0
- package/nitrogen/generated/ios/swift/RNAndroidLocationPermissionResult.swift +44 -0
- package/nitrogen/generated/ios/swift/RNCamera.swift +123 -0
- package/nitrogen/generated/ios/swift/RNCircle.swift +198 -0
- package/nitrogen/generated/ios/swift/RNIOSPermissionResult.swift +40 -0
- package/nitrogen/generated/ios/swift/RNInitialProps.swift +107 -0
- package/nitrogen/generated/ios/swift/RNLatLng.swift +46 -0
- package/nitrogen/generated/ios/swift/RNLineCapType.swift +44 -0
- package/nitrogen/generated/ios/swift/RNLineJoinType.swift +44 -0
- package/nitrogen/generated/ios/swift/RNLocation.swift +46 -0
- package/nitrogen/generated/ios/swift/RNLocationErrorCode.swift +56 -0
- package/nitrogen/generated/ios/swift/RNLocationPermissionResult.swift +70 -0
- package/nitrogen/generated/ios/swift/RNMapErrorCode.swift +60 -0
- package/nitrogen/generated/ios/swift/RNMapPadding.swift +68 -0
- package/nitrogen/generated/ios/swift/RNMapType.swift +52 -0
- package/nitrogen/generated/ios/swift/RNMarker.swift +132 -0
- package/nitrogen/generated/ios/swift/RNPolygon.swift +187 -0
- package/nitrogen/generated/ios/swift/RNPolyline.swift +203 -0
- package/nitrogen/generated/ios/swift/RNPosition.swift +46 -0
- package/nitrogen/generated/ios/swift/RNRegion.swift +57 -0
- package/nitrogen/generated/ios/swift/RNUserInterfaceStyle.swift +44 -0
- package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusModuleSpec.cpp +24 -0
- package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusModuleSpec.hpp +67 -0
- package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.cpp +76 -0
- package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.hpp +164 -0
- package/nitrogen/generated/shared/c++/RNAndroidLocationPermissionResult.hpp +67 -0
- package/nitrogen/generated/shared/c++/RNCamera.hpp +81 -0
- package/nitrogen/generated/shared/c++/RNCircle.hpp +98 -0
- package/nitrogen/generated/shared/c++/RNIOSPermissionResult.hpp +65 -0
- package/nitrogen/generated/shared/c++/RNInitialProps.hpp +78 -0
- package/nitrogen/generated/shared/c++/RNLatLng.hpp +71 -0
- package/nitrogen/generated/shared/c++/RNLineCapType.hpp +80 -0
- package/nitrogen/generated/shared/c++/RNLineJoinType.hpp +80 -0
- package/nitrogen/generated/shared/c++/RNLocation.hpp +72 -0
- package/nitrogen/generated/shared/c++/RNLocationErrorCode.hpp +73 -0
- package/nitrogen/generated/shared/c++/RNLocationPermissionResult.hpp +76 -0
- package/nitrogen/generated/shared/c++/RNMapErrorCode.hpp +67 -0
- package/nitrogen/generated/shared/c++/RNMapPadding.hpp +79 -0
- package/nitrogen/generated/shared/c++/RNMapType.hpp +88 -0
- package/nitrogen/generated/shared/c++/RNMarker.hpp +97 -0
- package/nitrogen/generated/shared/c++/RNPolygon.hpp +95 -0
- package/nitrogen/generated/shared/c++/RNPolyline.hpp +105 -0
- package/nitrogen/generated/shared/c++/RNPosition.hpp +71 -0
- package/nitrogen/generated/shared/c++/RNRegion.hpp +76 -0
- package/nitrogen/generated/shared/c++/RNUserInterfaceStyle.hpp +80 -0
- package/nitrogen/generated/shared/c++/views/HybridRNGoogleMapsPlusViewComponent.cpp +375 -0
- package/nitrogen/generated/shared/c++/views/HybridRNGoogleMapsPlusViewComponent.hpp +147 -0
- package/nitrogen/generated/shared/json/RNGoogleMapsPlusViewConfig.json +34 -0
- package/package.json +24 -8
- package/src/RNGoogleMapsPlusModule.nitro.ts +13 -0
- package/src/RNGoogleMapsPlusView.nitro.ts +86 -0
- package/src/index.tsx +24 -0
- package/src/types.ts +195 -0
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridRNGoogleMapsPlusViewComponent.cpp
|
|
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
|
+
#include "HybridRNGoogleMapsPlusViewComponent.hpp"
|
|
9
|
+
|
|
10
|
+
#include <string>
|
|
11
|
+
#include <exception>
|
|
12
|
+
#include <utility>
|
|
13
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
14
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
15
|
+
#include <react/renderer/core/RawValue.h>
|
|
16
|
+
#include <react/renderer/core/ShadowNode.h>
|
|
17
|
+
#include <react/renderer/core/ComponentDescriptor.h>
|
|
18
|
+
#include <react/renderer/components/view/ViewProps.h>
|
|
19
|
+
|
|
20
|
+
namespace margelo::nitro::rngooglemapsplus::views {
|
|
21
|
+
|
|
22
|
+
extern const char HybridRNGoogleMapsPlusViewComponentName[] = "RNGoogleMapsPlusView";
|
|
23
|
+
|
|
24
|
+
HybridRNGoogleMapsPlusViewProps::HybridRNGoogleMapsPlusViewProps(const react::PropsParserContext& context,
|
|
25
|
+
const HybridRNGoogleMapsPlusViewProps& sourceProps,
|
|
26
|
+
const react::RawProps& rawProps):
|
|
27
|
+
react::ViewProps(context, sourceProps, rawProps, filterObjectKeys),
|
|
28
|
+
initialProps([&]() -> CachedProp<std::optional<RNInitialProps>> {
|
|
29
|
+
try {
|
|
30
|
+
const react::RawValue* rawValue = rawProps.at("initialProps", nullptr, nullptr);
|
|
31
|
+
if (rawValue == nullptr) return sourceProps.initialProps;
|
|
32
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
33
|
+
return CachedProp<std::optional<RNInitialProps>>::fromRawValue(*runtime, value, sourceProps.initialProps);
|
|
34
|
+
} catch (const std::exception& exc) {
|
|
35
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.initialProps: ") + exc.what());
|
|
36
|
+
}
|
|
37
|
+
}()),
|
|
38
|
+
buildingEnabled([&]() -> CachedProp<std::optional<bool>> {
|
|
39
|
+
try {
|
|
40
|
+
const react::RawValue* rawValue = rawProps.at("buildingEnabled", nullptr, nullptr);
|
|
41
|
+
if (rawValue == nullptr) return sourceProps.buildingEnabled;
|
|
42
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
43
|
+
return CachedProp<std::optional<bool>>::fromRawValue(*runtime, value, sourceProps.buildingEnabled);
|
|
44
|
+
} catch (const std::exception& exc) {
|
|
45
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.buildingEnabled: ") + exc.what());
|
|
46
|
+
}
|
|
47
|
+
}()),
|
|
48
|
+
trafficEnabled([&]() -> CachedProp<std::optional<bool>> {
|
|
49
|
+
try {
|
|
50
|
+
const react::RawValue* rawValue = rawProps.at("trafficEnabled", nullptr, nullptr);
|
|
51
|
+
if (rawValue == nullptr) return sourceProps.trafficEnabled;
|
|
52
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
53
|
+
return CachedProp<std::optional<bool>>::fromRawValue(*runtime, value, sourceProps.trafficEnabled);
|
|
54
|
+
} catch (const std::exception& exc) {
|
|
55
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.trafficEnabled: ") + exc.what());
|
|
56
|
+
}
|
|
57
|
+
}()),
|
|
58
|
+
customMapStyle([&]() -> CachedProp<std::optional<std::string>> {
|
|
59
|
+
try {
|
|
60
|
+
const react::RawValue* rawValue = rawProps.at("customMapStyle", nullptr, nullptr);
|
|
61
|
+
if (rawValue == nullptr) return sourceProps.customMapStyle;
|
|
62
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
63
|
+
return CachedProp<std::optional<std::string>>::fromRawValue(*runtime, value, sourceProps.customMapStyle);
|
|
64
|
+
} catch (const std::exception& exc) {
|
|
65
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.customMapStyle: ") + exc.what());
|
|
66
|
+
}
|
|
67
|
+
}()),
|
|
68
|
+
userInterfaceStyle([&]() -> CachedProp<std::optional<RNUserInterfaceStyle>> {
|
|
69
|
+
try {
|
|
70
|
+
const react::RawValue* rawValue = rawProps.at("userInterfaceStyle", nullptr, nullptr);
|
|
71
|
+
if (rawValue == nullptr) return sourceProps.userInterfaceStyle;
|
|
72
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
73
|
+
return CachedProp<std::optional<RNUserInterfaceStyle>>::fromRawValue(*runtime, value, sourceProps.userInterfaceStyle);
|
|
74
|
+
} catch (const std::exception& exc) {
|
|
75
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.userInterfaceStyle: ") + exc.what());
|
|
76
|
+
}
|
|
77
|
+
}()),
|
|
78
|
+
minZoomLevel([&]() -> CachedProp<std::optional<double>> {
|
|
79
|
+
try {
|
|
80
|
+
const react::RawValue* rawValue = rawProps.at("minZoomLevel", nullptr, nullptr);
|
|
81
|
+
if (rawValue == nullptr) return sourceProps.minZoomLevel;
|
|
82
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
83
|
+
return CachedProp<std::optional<double>>::fromRawValue(*runtime, value, sourceProps.minZoomLevel);
|
|
84
|
+
} catch (const std::exception& exc) {
|
|
85
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.minZoomLevel: ") + exc.what());
|
|
86
|
+
}
|
|
87
|
+
}()),
|
|
88
|
+
maxZoomLevel([&]() -> CachedProp<std::optional<double>> {
|
|
89
|
+
try {
|
|
90
|
+
const react::RawValue* rawValue = rawProps.at("maxZoomLevel", nullptr, nullptr);
|
|
91
|
+
if (rawValue == nullptr) return sourceProps.maxZoomLevel;
|
|
92
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
93
|
+
return CachedProp<std::optional<double>>::fromRawValue(*runtime, value, sourceProps.maxZoomLevel);
|
|
94
|
+
} catch (const std::exception& exc) {
|
|
95
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.maxZoomLevel: ") + exc.what());
|
|
96
|
+
}
|
|
97
|
+
}()),
|
|
98
|
+
mapPadding([&]() -> CachedProp<std::optional<RNMapPadding>> {
|
|
99
|
+
try {
|
|
100
|
+
const react::RawValue* rawValue = rawProps.at("mapPadding", nullptr, nullptr);
|
|
101
|
+
if (rawValue == nullptr) return sourceProps.mapPadding;
|
|
102
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
103
|
+
return CachedProp<std::optional<RNMapPadding>>::fromRawValue(*runtime, value, sourceProps.mapPadding);
|
|
104
|
+
} catch (const std::exception& exc) {
|
|
105
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.mapPadding: ") + exc.what());
|
|
106
|
+
}
|
|
107
|
+
}()),
|
|
108
|
+
mapType([&]() -> CachedProp<std::optional<RNMapType>> {
|
|
109
|
+
try {
|
|
110
|
+
const react::RawValue* rawValue = rawProps.at("mapType", nullptr, nullptr);
|
|
111
|
+
if (rawValue == nullptr) return sourceProps.mapType;
|
|
112
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
113
|
+
return CachedProp<std::optional<RNMapType>>::fromRawValue(*runtime, value, sourceProps.mapType);
|
|
114
|
+
} catch (const std::exception& exc) {
|
|
115
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.mapType: ") + exc.what());
|
|
116
|
+
}
|
|
117
|
+
}()),
|
|
118
|
+
markers([&]() -> CachedProp<std::optional<std::vector<RNMarker>>> {
|
|
119
|
+
try {
|
|
120
|
+
const react::RawValue* rawValue = rawProps.at("markers", nullptr, nullptr);
|
|
121
|
+
if (rawValue == nullptr) return sourceProps.markers;
|
|
122
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
123
|
+
return CachedProp<std::optional<std::vector<RNMarker>>>::fromRawValue(*runtime, value, sourceProps.markers);
|
|
124
|
+
} catch (const std::exception& exc) {
|
|
125
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.markers: ") + exc.what());
|
|
126
|
+
}
|
|
127
|
+
}()),
|
|
128
|
+
polygons([&]() -> CachedProp<std::optional<std::vector<RNPolygon>>> {
|
|
129
|
+
try {
|
|
130
|
+
const react::RawValue* rawValue = rawProps.at("polygons", nullptr, nullptr);
|
|
131
|
+
if (rawValue == nullptr) return sourceProps.polygons;
|
|
132
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
133
|
+
return CachedProp<std::optional<std::vector<RNPolygon>>>::fromRawValue(*runtime, value, sourceProps.polygons);
|
|
134
|
+
} catch (const std::exception& exc) {
|
|
135
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.polygons: ") + exc.what());
|
|
136
|
+
}
|
|
137
|
+
}()),
|
|
138
|
+
polylines([&]() -> CachedProp<std::optional<std::vector<RNPolyline>>> {
|
|
139
|
+
try {
|
|
140
|
+
const react::RawValue* rawValue = rawProps.at("polylines", nullptr, nullptr);
|
|
141
|
+
if (rawValue == nullptr) return sourceProps.polylines;
|
|
142
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
143
|
+
return CachedProp<std::optional<std::vector<RNPolyline>>>::fromRawValue(*runtime, value, sourceProps.polylines);
|
|
144
|
+
} catch (const std::exception& exc) {
|
|
145
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.polylines: ") + exc.what());
|
|
146
|
+
}
|
|
147
|
+
}()),
|
|
148
|
+
circles([&]() -> CachedProp<std::optional<std::vector<RNCircle>>> {
|
|
149
|
+
try {
|
|
150
|
+
const react::RawValue* rawValue = rawProps.at("circles", nullptr, nullptr);
|
|
151
|
+
if (rawValue == nullptr) return sourceProps.circles;
|
|
152
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
153
|
+
return CachedProp<std::optional<std::vector<RNCircle>>>::fromRawValue(*runtime, value, sourceProps.circles);
|
|
154
|
+
} catch (const std::exception& exc) {
|
|
155
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.circles: ") + exc.what());
|
|
156
|
+
}
|
|
157
|
+
}()),
|
|
158
|
+
onMapError([&]() -> CachedProp<std::optional<std::function<void(RNMapErrorCode /* error */)>>> {
|
|
159
|
+
try {
|
|
160
|
+
const react::RawValue* rawValue = rawProps.at("onMapError", nullptr, nullptr);
|
|
161
|
+
if (rawValue == nullptr) return sourceProps.onMapError;
|
|
162
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
163
|
+
return CachedProp<std::optional<std::function<void(RNMapErrorCode /* error */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onMapError);
|
|
164
|
+
} catch (const std::exception& exc) {
|
|
165
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onMapError: ") + exc.what());
|
|
166
|
+
}
|
|
167
|
+
}()),
|
|
168
|
+
onMapReady([&]() -> CachedProp<std::optional<std::function<void(bool /* ready */)>>> {
|
|
169
|
+
try {
|
|
170
|
+
const react::RawValue* rawValue = rawProps.at("onMapReady", nullptr, nullptr);
|
|
171
|
+
if (rawValue == nullptr) return sourceProps.onMapReady;
|
|
172
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
173
|
+
return CachedProp<std::optional<std::function<void(bool /* ready */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onMapReady);
|
|
174
|
+
} catch (const std::exception& exc) {
|
|
175
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onMapReady: ") + exc.what());
|
|
176
|
+
}
|
|
177
|
+
}()),
|
|
178
|
+
onLocationUpdate([&]() -> CachedProp<std::optional<std::function<void(const RNLocation& /* location */)>>> {
|
|
179
|
+
try {
|
|
180
|
+
const react::RawValue* rawValue = rawProps.at("onLocationUpdate", nullptr, nullptr);
|
|
181
|
+
if (rawValue == nullptr) return sourceProps.onLocationUpdate;
|
|
182
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
183
|
+
return CachedProp<std::optional<std::function<void(const RNLocation& /* location */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onLocationUpdate);
|
|
184
|
+
} catch (const std::exception& exc) {
|
|
185
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onLocationUpdate: ") + exc.what());
|
|
186
|
+
}
|
|
187
|
+
}()),
|
|
188
|
+
onLocationError([&]() -> CachedProp<std::optional<std::function<void(RNLocationErrorCode /* error */)>>> {
|
|
189
|
+
try {
|
|
190
|
+
const react::RawValue* rawValue = rawProps.at("onLocationError", nullptr, nullptr);
|
|
191
|
+
if (rawValue == nullptr) return sourceProps.onLocationError;
|
|
192
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
193
|
+
return CachedProp<std::optional<std::function<void(RNLocationErrorCode /* error */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onLocationError);
|
|
194
|
+
} catch (const std::exception& exc) {
|
|
195
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onLocationError: ") + exc.what());
|
|
196
|
+
}
|
|
197
|
+
}()),
|
|
198
|
+
onMapPress([&]() -> CachedProp<std::optional<std::function<void(const RNLatLng& /* coordinate */)>>> {
|
|
199
|
+
try {
|
|
200
|
+
const react::RawValue* rawValue = rawProps.at("onMapPress", nullptr, nullptr);
|
|
201
|
+
if (rawValue == nullptr) return sourceProps.onMapPress;
|
|
202
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
203
|
+
return CachedProp<std::optional<std::function<void(const RNLatLng& /* coordinate */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onMapPress);
|
|
204
|
+
} catch (const std::exception& exc) {
|
|
205
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onMapPress: ") + exc.what());
|
|
206
|
+
}
|
|
207
|
+
}()),
|
|
208
|
+
onMarkerPress([&]() -> CachedProp<std::optional<std::function<void(const std::string& /* id */)>>> {
|
|
209
|
+
try {
|
|
210
|
+
const react::RawValue* rawValue = rawProps.at("onMarkerPress", nullptr, nullptr);
|
|
211
|
+
if (rawValue == nullptr) return sourceProps.onMarkerPress;
|
|
212
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
213
|
+
return CachedProp<std::optional<std::function<void(const std::string& /* id */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onMarkerPress);
|
|
214
|
+
} catch (const std::exception& exc) {
|
|
215
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onMarkerPress: ") + exc.what());
|
|
216
|
+
}
|
|
217
|
+
}()),
|
|
218
|
+
onPolylinePress([&]() -> CachedProp<std::optional<std::function<void(const std::string& /* id */)>>> {
|
|
219
|
+
try {
|
|
220
|
+
const react::RawValue* rawValue = rawProps.at("onPolylinePress", nullptr, nullptr);
|
|
221
|
+
if (rawValue == nullptr) return sourceProps.onPolylinePress;
|
|
222
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
223
|
+
return CachedProp<std::optional<std::function<void(const std::string& /* id */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onPolylinePress);
|
|
224
|
+
} catch (const std::exception& exc) {
|
|
225
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onPolylinePress: ") + exc.what());
|
|
226
|
+
}
|
|
227
|
+
}()),
|
|
228
|
+
onPolygonPress([&]() -> CachedProp<std::optional<std::function<void(const std::string& /* id */)>>> {
|
|
229
|
+
try {
|
|
230
|
+
const react::RawValue* rawValue = rawProps.at("onPolygonPress", nullptr, nullptr);
|
|
231
|
+
if (rawValue == nullptr) return sourceProps.onPolygonPress;
|
|
232
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
233
|
+
return CachedProp<std::optional<std::function<void(const std::string& /* id */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onPolygonPress);
|
|
234
|
+
} catch (const std::exception& exc) {
|
|
235
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onPolygonPress: ") + exc.what());
|
|
236
|
+
}
|
|
237
|
+
}()),
|
|
238
|
+
onCirclePress([&]() -> CachedProp<std::optional<std::function<void(const std::string& /* id */)>>> {
|
|
239
|
+
try {
|
|
240
|
+
const react::RawValue* rawValue = rawProps.at("onCirclePress", nullptr, nullptr);
|
|
241
|
+
if (rawValue == nullptr) return sourceProps.onCirclePress;
|
|
242
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
243
|
+
return CachedProp<std::optional<std::function<void(const std::string& /* id */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onCirclePress);
|
|
244
|
+
} catch (const std::exception& exc) {
|
|
245
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onCirclePress: ") + exc.what());
|
|
246
|
+
}
|
|
247
|
+
}()),
|
|
248
|
+
onCameraChangeStart([&]() -> CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>>> {
|
|
249
|
+
try {
|
|
250
|
+
const react::RawValue* rawValue = rawProps.at("onCameraChangeStart", nullptr, nullptr);
|
|
251
|
+
if (rawValue == nullptr) return sourceProps.onCameraChangeStart;
|
|
252
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
253
|
+
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);
|
|
254
|
+
} catch (const std::exception& exc) {
|
|
255
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onCameraChangeStart: ") + exc.what());
|
|
256
|
+
}
|
|
257
|
+
}()),
|
|
258
|
+
onCameraChange([&]() -> CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>>> {
|
|
259
|
+
try {
|
|
260
|
+
const react::RawValue* rawValue = rawProps.at("onCameraChange", nullptr, nullptr);
|
|
261
|
+
if (rawValue == nullptr) return sourceProps.onCameraChange;
|
|
262
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
263
|
+
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);
|
|
264
|
+
} catch (const std::exception& exc) {
|
|
265
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onCameraChange: ") + exc.what());
|
|
266
|
+
}
|
|
267
|
+
}()),
|
|
268
|
+
onCameraChangeComplete([&]() -> CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>>> {
|
|
269
|
+
try {
|
|
270
|
+
const react::RawValue* rawValue = rawProps.at("onCameraChangeComplete", nullptr, nullptr);
|
|
271
|
+
if (rawValue == nullptr) return sourceProps.onCameraChangeComplete;
|
|
272
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
273
|
+
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);
|
|
274
|
+
} catch (const std::exception& exc) {
|
|
275
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.onCameraChangeComplete: ") + exc.what());
|
|
276
|
+
}
|
|
277
|
+
}()),
|
|
278
|
+
hybridRef([&]() -> CachedProp<std::optional<std::function<void(const std::shared_ptr<HybridRNGoogleMapsPlusViewSpec>& /* ref */)>>> {
|
|
279
|
+
try {
|
|
280
|
+
const react::RawValue* rawValue = rawProps.at("hybridRef", nullptr, nullptr);
|
|
281
|
+
if (rawValue == nullptr) return sourceProps.hybridRef;
|
|
282
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
283
|
+
return CachedProp<std::optional<std::function<void(const std::shared_ptr<HybridRNGoogleMapsPlusViewSpec>& /* ref */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.hybridRef);
|
|
284
|
+
} catch (const std::exception& exc) {
|
|
285
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.hybridRef: ") + exc.what());
|
|
286
|
+
}
|
|
287
|
+
}()) { }
|
|
288
|
+
|
|
289
|
+
HybridRNGoogleMapsPlusViewProps::HybridRNGoogleMapsPlusViewProps(const HybridRNGoogleMapsPlusViewProps& other):
|
|
290
|
+
react::ViewProps(),
|
|
291
|
+
initialProps(other.initialProps),
|
|
292
|
+
buildingEnabled(other.buildingEnabled),
|
|
293
|
+
trafficEnabled(other.trafficEnabled),
|
|
294
|
+
customMapStyle(other.customMapStyle),
|
|
295
|
+
userInterfaceStyle(other.userInterfaceStyle),
|
|
296
|
+
minZoomLevel(other.minZoomLevel),
|
|
297
|
+
maxZoomLevel(other.maxZoomLevel),
|
|
298
|
+
mapPadding(other.mapPadding),
|
|
299
|
+
mapType(other.mapType),
|
|
300
|
+
markers(other.markers),
|
|
301
|
+
polygons(other.polygons),
|
|
302
|
+
polylines(other.polylines),
|
|
303
|
+
circles(other.circles),
|
|
304
|
+
onMapError(other.onMapError),
|
|
305
|
+
onMapReady(other.onMapReady),
|
|
306
|
+
onLocationUpdate(other.onLocationUpdate),
|
|
307
|
+
onLocationError(other.onLocationError),
|
|
308
|
+
onMapPress(other.onMapPress),
|
|
309
|
+
onMarkerPress(other.onMarkerPress),
|
|
310
|
+
onPolylinePress(other.onPolylinePress),
|
|
311
|
+
onPolygonPress(other.onPolygonPress),
|
|
312
|
+
onCirclePress(other.onCirclePress),
|
|
313
|
+
onCameraChangeStart(other.onCameraChangeStart),
|
|
314
|
+
onCameraChange(other.onCameraChange),
|
|
315
|
+
onCameraChangeComplete(other.onCameraChangeComplete),
|
|
316
|
+
hybridRef(other.hybridRef) { }
|
|
317
|
+
|
|
318
|
+
bool HybridRNGoogleMapsPlusViewProps::filterObjectKeys(const std::string& propName) {
|
|
319
|
+
switch (hashString(propName)) {
|
|
320
|
+
case hashString("initialProps"): return true;
|
|
321
|
+
case hashString("buildingEnabled"): return true;
|
|
322
|
+
case hashString("trafficEnabled"): return true;
|
|
323
|
+
case hashString("customMapStyle"): return true;
|
|
324
|
+
case hashString("userInterfaceStyle"): return true;
|
|
325
|
+
case hashString("minZoomLevel"): return true;
|
|
326
|
+
case hashString("maxZoomLevel"): return true;
|
|
327
|
+
case hashString("mapPadding"): return true;
|
|
328
|
+
case hashString("mapType"): return true;
|
|
329
|
+
case hashString("markers"): return true;
|
|
330
|
+
case hashString("polygons"): return true;
|
|
331
|
+
case hashString("polylines"): return true;
|
|
332
|
+
case hashString("circles"): return true;
|
|
333
|
+
case hashString("onMapError"): return true;
|
|
334
|
+
case hashString("onMapReady"): return true;
|
|
335
|
+
case hashString("onLocationUpdate"): return true;
|
|
336
|
+
case hashString("onLocationError"): return true;
|
|
337
|
+
case hashString("onMapPress"): return true;
|
|
338
|
+
case hashString("onMarkerPress"): return true;
|
|
339
|
+
case hashString("onPolylinePress"): return true;
|
|
340
|
+
case hashString("onPolygonPress"): return true;
|
|
341
|
+
case hashString("onCirclePress"): return true;
|
|
342
|
+
case hashString("onCameraChangeStart"): return true;
|
|
343
|
+
case hashString("onCameraChange"): return true;
|
|
344
|
+
case hashString("onCameraChangeComplete"): return true;
|
|
345
|
+
case hashString("hybridRef"): return true;
|
|
346
|
+
default: return false;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
HybridRNGoogleMapsPlusViewComponentDescriptor::HybridRNGoogleMapsPlusViewComponentDescriptor(const react::ComponentDescriptorParameters& parameters)
|
|
351
|
+
: ConcreteComponentDescriptor(parameters,
|
|
352
|
+
react::RawPropsParser(/* enableJsiParser */ true)) {}
|
|
353
|
+
|
|
354
|
+
std::shared_ptr<const react::Props> HybridRNGoogleMapsPlusViewComponentDescriptor::cloneProps(const react::PropsParserContext& context,
|
|
355
|
+
const std::shared_ptr<const react::Props>& props,
|
|
356
|
+
react::RawProps rawProps) const {
|
|
357
|
+
// 1. Prepare raw props parser
|
|
358
|
+
rawProps.parse(rawPropsParser_);
|
|
359
|
+
// 2. Copy props with Nitro's cached copy constructor
|
|
360
|
+
return HybridRNGoogleMapsPlusViewShadowNode::Props(context, /* & */ rawProps, props);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
#ifdef ANDROID
|
|
364
|
+
void HybridRNGoogleMapsPlusViewComponentDescriptor::adopt(react::ShadowNode& shadowNode) const {
|
|
365
|
+
// This is called immediately after `ShadowNode` is created, cloned or in progress.
|
|
366
|
+
// On Android, we need to wrap props in our state, which gets routed through Java and later unwrapped in JNI/C++.
|
|
367
|
+
auto& concreteShadowNode = dynamic_cast<HybridRNGoogleMapsPlusViewShadowNode&>(shadowNode);
|
|
368
|
+
const HybridRNGoogleMapsPlusViewProps& props = concreteShadowNode.getConcreteProps();
|
|
369
|
+
HybridRNGoogleMapsPlusViewState state;
|
|
370
|
+
state.setProps(props);
|
|
371
|
+
concreteShadowNode.setStateData(std::move(state));
|
|
372
|
+
}
|
|
373
|
+
#endif
|
|
374
|
+
|
|
375
|
+
} // namespace margelo::nitro::rngooglemapsplus::views
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridRNGoogleMapsPlusViewComponent.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 <optional>
|
|
11
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
12
|
+
#include <NitroModules/NitroHash.hpp>
|
|
13
|
+
#include <NitroModules/CachedProp.hpp>
|
|
14
|
+
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
15
|
+
#include <react/renderer/core/PropsParserContext.h>
|
|
16
|
+
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
|
|
17
|
+
#include <react/renderer/components/view/ViewProps.h>
|
|
18
|
+
|
|
19
|
+
#include "RNInitialProps.hpp"
|
|
20
|
+
#include <optional>
|
|
21
|
+
#include <string>
|
|
22
|
+
#include "RNUserInterfaceStyle.hpp"
|
|
23
|
+
#include "RNMapPadding.hpp"
|
|
24
|
+
#include "RNMapType.hpp"
|
|
25
|
+
#include "RNMarker.hpp"
|
|
26
|
+
#include <vector>
|
|
27
|
+
#include "RNPolygon.hpp"
|
|
28
|
+
#include "RNPolyline.hpp"
|
|
29
|
+
#include "RNCircle.hpp"
|
|
30
|
+
#include "RNMapErrorCode.hpp"
|
|
31
|
+
#include <functional>
|
|
32
|
+
#include "RNLocation.hpp"
|
|
33
|
+
#include "RNLocationErrorCode.hpp"
|
|
34
|
+
#include "RNLatLng.hpp"
|
|
35
|
+
#include "RNRegion.hpp"
|
|
36
|
+
#include "RNCamera.hpp"
|
|
37
|
+
#include <memory>
|
|
38
|
+
#include "HybridRNGoogleMapsPlusViewSpec.hpp"
|
|
39
|
+
|
|
40
|
+
namespace margelo::nitro::rngooglemapsplus::views {
|
|
41
|
+
|
|
42
|
+
using namespace facebook;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The name of the actual native View.
|
|
46
|
+
*/
|
|
47
|
+
extern const char HybridRNGoogleMapsPlusViewComponentName[];
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Props for the "RNGoogleMapsPlusView" View.
|
|
51
|
+
*/
|
|
52
|
+
class HybridRNGoogleMapsPlusViewProps final: public react::ViewProps {
|
|
53
|
+
public:
|
|
54
|
+
HybridRNGoogleMapsPlusViewProps() = default;
|
|
55
|
+
HybridRNGoogleMapsPlusViewProps(const HybridRNGoogleMapsPlusViewProps&);
|
|
56
|
+
HybridRNGoogleMapsPlusViewProps(const react::PropsParserContext& context,
|
|
57
|
+
const HybridRNGoogleMapsPlusViewProps& sourceProps,
|
|
58
|
+
const react::RawProps& rawProps);
|
|
59
|
+
|
|
60
|
+
public:
|
|
61
|
+
CachedProp<std::optional<RNInitialProps>> initialProps;
|
|
62
|
+
CachedProp<std::optional<bool>> buildingEnabled;
|
|
63
|
+
CachedProp<std::optional<bool>> trafficEnabled;
|
|
64
|
+
CachedProp<std::optional<std::string>> customMapStyle;
|
|
65
|
+
CachedProp<std::optional<RNUserInterfaceStyle>> userInterfaceStyle;
|
|
66
|
+
CachedProp<std::optional<double>> minZoomLevel;
|
|
67
|
+
CachedProp<std::optional<double>> maxZoomLevel;
|
|
68
|
+
CachedProp<std::optional<RNMapPadding>> mapPadding;
|
|
69
|
+
CachedProp<std::optional<RNMapType>> mapType;
|
|
70
|
+
CachedProp<std::optional<std::vector<RNMarker>>> markers;
|
|
71
|
+
CachedProp<std::optional<std::vector<RNPolygon>>> polygons;
|
|
72
|
+
CachedProp<std::optional<std::vector<RNPolyline>>> polylines;
|
|
73
|
+
CachedProp<std::optional<std::vector<RNCircle>>> circles;
|
|
74
|
+
CachedProp<std::optional<std::function<void(RNMapErrorCode /* error */)>>> onMapError;
|
|
75
|
+
CachedProp<std::optional<std::function<void(bool /* ready */)>>> onMapReady;
|
|
76
|
+
CachedProp<std::optional<std::function<void(const RNLocation& /* location */)>>> onLocationUpdate;
|
|
77
|
+
CachedProp<std::optional<std::function<void(RNLocationErrorCode /* error */)>>> onLocationError;
|
|
78
|
+
CachedProp<std::optional<std::function<void(const RNLatLng& /* coordinate */)>>> onMapPress;
|
|
79
|
+
CachedProp<std::optional<std::function<void(const std::string& /* id */)>>> onMarkerPress;
|
|
80
|
+
CachedProp<std::optional<std::function<void(const std::string& /* id */)>>> onPolylinePress;
|
|
81
|
+
CachedProp<std::optional<std::function<void(const std::string& /* id */)>>> onPolygonPress;
|
|
82
|
+
CachedProp<std::optional<std::function<void(const std::string& /* id */)>>> onCirclePress;
|
|
83
|
+
CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>>> onCameraChangeStart;
|
|
84
|
+
CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>>> onCameraChange;
|
|
85
|
+
CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>>> onCameraChangeComplete;
|
|
86
|
+
CachedProp<std::optional<std::function<void(const std::shared_ptr<HybridRNGoogleMapsPlusViewSpec>& /* ref */)>>> hybridRef;
|
|
87
|
+
|
|
88
|
+
private:
|
|
89
|
+
static bool filterObjectKeys(const std::string& propName);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* State for the "RNGoogleMapsPlusView" View.
|
|
94
|
+
*/
|
|
95
|
+
class HybridRNGoogleMapsPlusViewState final {
|
|
96
|
+
public:
|
|
97
|
+
HybridRNGoogleMapsPlusViewState() = default;
|
|
98
|
+
|
|
99
|
+
public:
|
|
100
|
+
void setProps(const HybridRNGoogleMapsPlusViewProps& props) { _props.emplace(props); }
|
|
101
|
+
const std::optional<HybridRNGoogleMapsPlusViewProps>& getProps() const { return _props; }
|
|
102
|
+
|
|
103
|
+
public:
|
|
104
|
+
#ifdef ANDROID
|
|
105
|
+
HybridRNGoogleMapsPlusViewState(const HybridRNGoogleMapsPlusViewState& /* previousState */, folly::dynamic /* data */) {}
|
|
106
|
+
folly::dynamic getDynamic() const {
|
|
107
|
+
throw std::runtime_error("HybridRNGoogleMapsPlusViewState does not support folly!");
|
|
108
|
+
}
|
|
109
|
+
react::MapBuffer getMapBuffer() const {
|
|
110
|
+
throw std::runtime_error("HybridRNGoogleMapsPlusViewState does not support MapBuffer!");
|
|
111
|
+
};
|
|
112
|
+
#endif
|
|
113
|
+
|
|
114
|
+
private:
|
|
115
|
+
std::optional<HybridRNGoogleMapsPlusViewProps> _props;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* The Shadow Node for the "RNGoogleMapsPlusView" View.
|
|
120
|
+
*/
|
|
121
|
+
using HybridRNGoogleMapsPlusViewShadowNode = react::ConcreteViewShadowNode<HybridRNGoogleMapsPlusViewComponentName /* "HybridRNGoogleMapsPlusView" */,
|
|
122
|
+
HybridRNGoogleMapsPlusViewProps /* custom props */,
|
|
123
|
+
react::ViewEventEmitter /* default */,
|
|
124
|
+
HybridRNGoogleMapsPlusViewState /* custom state */>;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* The Component Descriptor for the "RNGoogleMapsPlusView" View.
|
|
128
|
+
*/
|
|
129
|
+
class HybridRNGoogleMapsPlusViewComponentDescriptor final: public react::ConcreteComponentDescriptor<HybridRNGoogleMapsPlusViewShadowNode> {
|
|
130
|
+
public:
|
|
131
|
+
HybridRNGoogleMapsPlusViewComponentDescriptor(const react::ComponentDescriptorParameters& parameters);
|
|
132
|
+
|
|
133
|
+
public:
|
|
134
|
+
/**
|
|
135
|
+
* A faster path for cloning props - reuses the caching logic from `HybridRNGoogleMapsPlusViewProps`.
|
|
136
|
+
*/
|
|
137
|
+
std::shared_ptr<const react::Props> cloneProps(const react::PropsParserContext& context,
|
|
138
|
+
const std::shared_ptr<const react::Props>& props,
|
|
139
|
+
react::RawProps rawProps) const override;
|
|
140
|
+
#ifdef ANDROID
|
|
141
|
+
void adopt(react::ShadowNode& shadowNode) const override;
|
|
142
|
+
#endif
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
/* The actual view for "RNGoogleMapsPlusView" needs to be implemented in platform-specific code. */
|
|
146
|
+
|
|
147
|
+
} // namespace margelo::nitro::rngooglemapsplus::views
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"uiViewClassName": "RNGoogleMapsPlusView",
|
|
3
|
+
"supportsRawText": false,
|
|
4
|
+
"bubblingEventTypes": {},
|
|
5
|
+
"directEventTypes": {},
|
|
6
|
+
"validAttributes": {
|
|
7
|
+
"initialProps": true,
|
|
8
|
+
"buildingEnabled": true,
|
|
9
|
+
"trafficEnabled": true,
|
|
10
|
+
"customMapStyle": true,
|
|
11
|
+
"userInterfaceStyle": true,
|
|
12
|
+
"minZoomLevel": true,
|
|
13
|
+
"maxZoomLevel": true,
|
|
14
|
+
"mapPadding": true,
|
|
15
|
+
"mapType": true,
|
|
16
|
+
"markers": true,
|
|
17
|
+
"polygons": true,
|
|
18
|
+
"polylines": true,
|
|
19
|
+
"circles": true,
|
|
20
|
+
"onMapError": true,
|
|
21
|
+
"onMapReady": true,
|
|
22
|
+
"onLocationUpdate": true,
|
|
23
|
+
"onLocationError": true,
|
|
24
|
+
"onMapPress": true,
|
|
25
|
+
"onMarkerPress": true,
|
|
26
|
+
"onPolylinePress": true,
|
|
27
|
+
"onPolygonPress": true,
|
|
28
|
+
"onCirclePress": true,
|
|
29
|
+
"onCameraChangeStart": true,
|
|
30
|
+
"onCameraChange": true,
|
|
31
|
+
"onCameraChangeComplete": true,
|
|
32
|
+
"hybridRef": true
|
|
33
|
+
}
|
|
34
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-google-maps-plus",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "1.0.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",
|
|
@@ -11,21 +11,28 @@
|
|
|
11
11
|
"lint": "yarn lint:js && yarn lint:android && yarn lint:ios",
|
|
12
12
|
"lint:js": "eslint . --max-warnings 0 && yarn prettier --check .",
|
|
13
13
|
"lint:android": "cd android && ktlint -F ./**/*.kt*",
|
|
14
|
-
"lint:ios": "cd ios && swiftlint --quiet",
|
|
14
|
+
"lint:ios": "cd ios && swiftlint --quiet && swiftformat . --lint",
|
|
15
15
|
"format": "yarn format:js && yarn format:ios && yarn format:android",
|
|
16
16
|
"format:js": "prettier --write .",
|
|
17
|
-
"format:android": "cd android && ktlint ./**/*.kt*",
|
|
18
|
-
"format:ios": "cd ios &&
|
|
17
|
+
"format:android": "cd android && ktlint --format ./**/*.kt*",
|
|
18
|
+
"format:ios": "cd ios && swiftformat .",
|
|
19
19
|
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
20
20
|
"test": "jest",
|
|
21
21
|
"git:clean": "git clean -dfX",
|
|
22
22
|
"release": "semantic-release",
|
|
23
|
-
"build": "yarn
|
|
24
|
-
"nitrogen": "nitrogen --logLevel=\"debug\" && node scripts/
|
|
23
|
+
"build": "yarn nitrogen && bob build",
|
|
24
|
+
"nitrogen": "nitrogen --logLevel=\"debug\" && node scripts/nitrogen-patch.js",
|
|
25
|
+
"prepare": "bob build"
|
|
25
26
|
},
|
|
26
27
|
"keywords": [
|
|
27
28
|
"react-native",
|
|
28
|
-
"
|
|
29
|
+
"google-maps",
|
|
30
|
+
"react-native-google-maps",
|
|
31
|
+
"react-native-google-maps-plus",
|
|
32
|
+
"google-maps-sdk",
|
|
33
|
+
"android",
|
|
34
|
+
"ios",
|
|
35
|
+
"maps"
|
|
29
36
|
],
|
|
30
37
|
"files": [
|
|
31
38
|
"src",
|
|
@@ -59,6 +66,10 @@
|
|
|
59
66
|
"license": "MIT",
|
|
60
67
|
"bugs": "https://github.com/pinpong/react-native-google-maps-plus/issues",
|
|
61
68
|
"homepage": "https://github.com/pinpong/react-native-google-maps-plus#readme",
|
|
69
|
+
"publishConfig": {
|
|
70
|
+
"access": "public",
|
|
71
|
+
"provenance": true
|
|
72
|
+
},
|
|
62
73
|
"devDependencies": {
|
|
63
74
|
"@commitlint/cli": "20.0.0",
|
|
64
75
|
"@commitlint/config-conventional": "20.0.0",
|
|
@@ -70,6 +81,7 @@
|
|
|
70
81
|
"@react-native/eslint-config": "0.82.0-rc.4",
|
|
71
82
|
"@semantic-release/changelog": "6.0.3",
|
|
72
83
|
"@semantic-release/git": "10.0.1",
|
|
84
|
+
"@semantic-release/npm": "13.0.0-beta.1",
|
|
73
85
|
"@types/jest": "30.0.0",
|
|
74
86
|
"@types/react": "19.1.15",
|
|
75
87
|
"clang-format-node": "2.0.1",
|
|
@@ -87,9 +99,13 @@
|
|
|
87
99
|
"react-native": "0.82.0-rc.4",
|
|
88
100
|
"react-native-builder-bob": "0.40.13",
|
|
89
101
|
"react-native-nitro-modules": "0.29.6",
|
|
90
|
-
"semantic-release": "
|
|
102
|
+
"semantic-release": "25.0.0-beta.6",
|
|
91
103
|
"typescript": "5.9.2"
|
|
92
104
|
},
|
|
105
|
+
"overrides": {
|
|
106
|
+
"@semantic-release/npm": "13.0.0-beta.1",
|
|
107
|
+
"semantic-release": "25.0.0-beta.6"
|
|
108
|
+
},
|
|
93
109
|
"peerDependencies": {
|
|
94
110
|
"react": "*",
|
|
95
111
|
"react-native": "*",
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type HybridObject } from 'react-native-nitro-modules';
|
|
2
|
+
import type { RNLocationPermissionResult } from './types';
|
|
3
|
+
|
|
4
|
+
export interface RNGoogleMapsPlusModule
|
|
5
|
+
extends HybridObject<{ ios: 'swift'; android: 'kotlin' }> {
|
|
6
|
+
showLocationDialog(): void;
|
|
7
|
+
|
|
8
|
+
openLocationSettings(): void;
|
|
9
|
+
|
|
10
|
+
requestLocationPermission(): Promise<RNLocationPermissionResult>;
|
|
11
|
+
|
|
12
|
+
isGooglePlayServicesAvailable(): boolean;
|
|
13
|
+
}
|