react-native-google-maps-plus 1.3.0-dev.2 → 1.3.0-dev.4

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 (52) hide show
  1. package/android/src/main/java/com/rngooglemapsplus/GoogleMapsViewImpl.kt +92 -8
  2. package/android/src/main/java/com/rngooglemapsplus/LocationHandler.kt +0 -1
  3. package/android/src/main/java/com/rngooglemapsplus/RNGoogleMapsPlusView.kt +52 -9
  4. package/android/src/main/java/com/rngooglemapsplus/extensions/RNLatLngBoundsExtension.kt +17 -0
  5. package/android/src/main/java/com/rngooglemapsplus/extensions/RNSize.kt +7 -0
  6. package/android/src/main/java/com/rngooglemapsplus/extensions/RNSnapshotFormat.kt +16 -0
  7. package/android/src/main/java/com/rngooglemapsplus/extensions/RNSnapshotResultType.kt +9 -0
  8. package/ios/GoogleMapViewImpl.swift +285 -145
  9. package/ios/RNGoogleMapsPlusView.swift +86 -38
  10. package/ios/extensions/RNLatLngBounds+Extension.swift +16 -0
  11. package/ios/extensions/RNSize+Extension.swift +7 -0
  12. package/ios/extensions/RNSnapshotFormat+Extension.swift +28 -0
  13. package/ios/extensions/RNSnapshotResultType+Extension.swift +12 -0
  14. package/lib/module/types.js.map +1 -1
  15. package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts +6 -3
  16. package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts.map +1 -1
  17. package/lib/typescript/src/types.d.ts +13 -1
  18. package/lib/typescript/src/types.d.ts.map +1 -1
  19. package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.cpp +51 -7
  20. package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.hpp +5 -2
  21. package/nitrogen/generated/android/c++/JRNLatLngBounds.hpp +58 -0
  22. package/nitrogen/generated/android/c++/JRNSize.hpp +57 -0
  23. package/nitrogen/generated/android/c++/JRNSnapshotFormat.hpp +62 -0
  24. package/nitrogen/generated/android/c++/JRNSnapshotOptions.hpp +71 -0
  25. package/nitrogen/generated/android/c++/JRNSnapshotResultType.hpp +59 -0
  26. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/HybridRNGoogleMapsPlusViewSpec.kt +14 -2
  27. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNLatLngBounds.kt +32 -0
  28. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNSize.kt +32 -0
  29. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNSnapshotFormat.kt +22 -0
  30. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNSnapshotOptions.kt +38 -0
  31. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNSnapshotResultType.kt +21 -0
  32. package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.hpp +57 -0
  33. package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Umbrella.hpp +15 -0
  34. package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusViewSpecSwift.hpp +40 -5
  35. package/nitrogen/generated/ios/c++/views/HybridRNGoogleMapsPlusViewComponent.mm +7 -0
  36. package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec.swift +5 -2
  37. package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec_cxx.swift +58 -4
  38. package/nitrogen/generated/ios/swift/RNLatLngBounds.swift +46 -0
  39. package/nitrogen/generated/ios/swift/RNSize.swift +46 -0
  40. package/nitrogen/generated/ios/swift/RNSnapshotFormat.swift +44 -0
  41. package/nitrogen/generated/ios/swift/RNSnapshotOptions.swift +87 -0
  42. package/nitrogen/generated/ios/swift/RNSnapshotResultType.swift +40 -0
  43. package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.cpp +3 -0
  44. package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.hpp +12 -3
  45. package/nitrogen/generated/shared/c++/RNLatLngBounds.hpp +72 -0
  46. package/nitrogen/generated/shared/c++/RNSize.hpp +71 -0
  47. package/nitrogen/generated/shared/c++/RNSnapshotFormat.hpp +80 -0
  48. package/nitrogen/generated/shared/c++/RNSnapshotOptions.hpp +87 -0
  49. package/nitrogen/generated/shared/c++/RNSnapshotResultType.hpp +76 -0
  50. package/package.json +1 -1
  51. package/src/RNGoogleMapsPlusView.nitro.ts +15 -2
  52. package/src/types.ts +24 -2
@@ -0,0 +1,87 @@
1
+ ///
2
+ /// RNSnapshotOptions.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+
21
+ // Forward declaration of `RNSize` to properly resolve imports.
22
+ namespace margelo::nitro::rngooglemapsplus { struct RNSize; }
23
+ // Forward declaration of `RNSnapshotFormat` to properly resolve imports.
24
+ namespace margelo::nitro::rngooglemapsplus { enum class RNSnapshotFormat; }
25
+ // Forward declaration of `RNSnapshotResultType` to properly resolve imports.
26
+ namespace margelo::nitro::rngooglemapsplus { enum class RNSnapshotResultType; }
27
+
28
+ #include "RNSize.hpp"
29
+ #include <optional>
30
+ #include "RNSnapshotFormat.hpp"
31
+ #include "RNSnapshotResultType.hpp"
32
+
33
+ namespace margelo::nitro::rngooglemapsplus {
34
+
35
+ /**
36
+ * A struct which can be represented as a JavaScript object (RNSnapshotOptions).
37
+ */
38
+ struct RNSnapshotOptions {
39
+ public:
40
+ std::optional<RNSize> size SWIFT_PRIVATE;
41
+ RNSnapshotFormat format SWIFT_PRIVATE;
42
+ double quality SWIFT_PRIVATE;
43
+ RNSnapshotResultType resultType SWIFT_PRIVATE;
44
+
45
+ public:
46
+ RNSnapshotOptions() = default;
47
+ explicit RNSnapshotOptions(std::optional<RNSize> size, RNSnapshotFormat format, double quality, RNSnapshotResultType resultType): size(size), format(format), quality(quality), resultType(resultType) {}
48
+ };
49
+
50
+ } // namespace margelo::nitro::rngooglemapsplus
51
+
52
+ namespace margelo::nitro {
53
+
54
+ // C++ RNSnapshotOptions <> JS RNSnapshotOptions (object)
55
+ template <>
56
+ struct JSIConverter<margelo::nitro::rngooglemapsplus::RNSnapshotOptions> final {
57
+ static inline margelo::nitro::rngooglemapsplus::RNSnapshotOptions fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
58
+ jsi::Object obj = arg.asObject(runtime);
59
+ return margelo::nitro::rngooglemapsplus::RNSnapshotOptions(
60
+ JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNSize>>::fromJSI(runtime, obj.getProperty(runtime, "size")),
61
+ JSIConverter<margelo::nitro::rngooglemapsplus::RNSnapshotFormat>::fromJSI(runtime, obj.getProperty(runtime, "format")),
62
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "quality")),
63
+ JSIConverter<margelo::nitro::rngooglemapsplus::RNSnapshotResultType>::fromJSI(runtime, obj.getProperty(runtime, "resultType"))
64
+ );
65
+ }
66
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNSnapshotOptions& arg) {
67
+ jsi::Object obj(runtime);
68
+ obj.setProperty(runtime, "size", JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNSize>>::toJSI(runtime, arg.size));
69
+ obj.setProperty(runtime, "format", JSIConverter<margelo::nitro::rngooglemapsplus::RNSnapshotFormat>::toJSI(runtime, arg.format));
70
+ obj.setProperty(runtime, "quality", JSIConverter<double>::toJSI(runtime, arg.quality));
71
+ obj.setProperty(runtime, "resultType", JSIConverter<margelo::nitro::rngooglemapsplus::RNSnapshotResultType>::toJSI(runtime, arg.resultType));
72
+ return obj;
73
+ }
74
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
75
+ if (!value.isObject()) {
76
+ return false;
77
+ }
78
+ jsi::Object obj = value.getObject(runtime);
79
+ if (!JSIConverter<std::optional<margelo::nitro::rngooglemapsplus::RNSize>>::canConvert(runtime, obj.getProperty(runtime, "size"))) return false;
80
+ if (!JSIConverter<margelo::nitro::rngooglemapsplus::RNSnapshotFormat>::canConvert(runtime, obj.getProperty(runtime, "format"))) return false;
81
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "quality"))) return false;
82
+ if (!JSIConverter<margelo::nitro::rngooglemapsplus::RNSnapshotResultType>::canConvert(runtime, obj.getProperty(runtime, "resultType"))) return false;
83
+ return true;
84
+ }
85
+ };
86
+
87
+ } // namespace margelo::nitro
@@ -0,0 +1,76 @@
1
+ ///
2
+ /// RNSnapshotResultType.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #if __has_include(<NitroModules/NitroHash.hpp>)
11
+ #include <NitroModules/NitroHash.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
16
+ #include <NitroModules/JSIConverter.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
21
+ #include <NitroModules/NitroDefines.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
25
+
26
+ namespace margelo::nitro::rngooglemapsplus {
27
+
28
+ /**
29
+ * An enum which can be represented as a JavaScript union (RNSnapshotResultType).
30
+ */
31
+ enum class RNSnapshotResultType {
32
+ BASE64 SWIFT_NAME(base64) = 0,
33
+ FILE SWIFT_NAME(file) = 1,
34
+ } CLOSED_ENUM;
35
+
36
+ } // namespace margelo::nitro::rngooglemapsplus
37
+
38
+ namespace margelo::nitro {
39
+
40
+ // C++ RNSnapshotResultType <> JS RNSnapshotResultType (union)
41
+ template <>
42
+ struct JSIConverter<margelo::nitro::rngooglemapsplus::RNSnapshotResultType> final {
43
+ static inline margelo::nitro::rngooglemapsplus::RNSnapshotResultType fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
44
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
45
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
46
+ case hashString("base64"): return margelo::nitro::rngooglemapsplus::RNSnapshotResultType::BASE64;
47
+ case hashString("file"): return margelo::nitro::rngooglemapsplus::RNSnapshotResultType::FILE;
48
+ default: [[unlikely]]
49
+ throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum RNSnapshotResultType - invalid value!");
50
+ }
51
+ }
52
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::rngooglemapsplus::RNSnapshotResultType arg) {
53
+ switch (arg) {
54
+ case margelo::nitro::rngooglemapsplus::RNSnapshotResultType::BASE64: return JSIConverter<std::string>::toJSI(runtime, "base64");
55
+ case margelo::nitro::rngooglemapsplus::RNSnapshotResultType::FILE: return JSIConverter<std::string>::toJSI(runtime, "file");
56
+ default: [[unlikely]]
57
+ throw std::invalid_argument("Cannot convert RNSnapshotResultType to JS - invalid value: "
58
+ + std::to_string(static_cast<int>(arg)) + "!");
59
+ }
60
+ }
61
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
62
+ if (!value.isString()) {
63
+ return false;
64
+ }
65
+ std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
66
+ switch (hashString(unionValue.c_str(), unionValue.size())) {
67
+ case hashString("base64"):
68
+ case hashString("file"):
69
+ return true;
70
+ default:
71
+ return false;
72
+ }
73
+ }
74
+ };
75
+
76
+ } // namespace margelo::nitro
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-google-maps-plus",
3
- "version": "1.3.0-dev.2",
3
+ "version": "1.3.0-dev.4",
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",
@@ -26,6 +26,8 @@ import type {
26
26
  RNKMLayer,
27
27
  RNIndoorBuilding,
28
28
  RNIndoorLevel,
29
+ RNLatLngBounds,
30
+ RNSnapshotOptions,
29
31
  } from './types';
30
32
 
31
33
  export interface RNGoogleMapsPlusViewProps extends HybridViewProps {
@@ -79,15 +81,26 @@ export interface RNGoogleMapsPlusViewProps extends HybridViewProps {
79
81
  }
80
82
 
81
83
  export interface RNGoogleMapsPlusViewMethods extends HybridViewMethods {
82
- setCamera(camera: RNCamera, animated?: boolean, durationMS?: number): void;
84
+ setCamera(camera: RNCamera, animated?: boolean, durationMs?: number): void;
83
85
 
84
86
  setCameraToCoordinates(
85
87
  coordinates: RNLatLng[],
86
88
  padding?: RNMapPadding,
87
89
  animated?: boolean,
88
- durationMS?: number
90
+ durationMs?: number
89
91
  ): void;
90
92
 
93
+ setCameraBounds(bounds?: RNLatLngBounds): void;
94
+
95
+ animateToBounds(
96
+ bounds: RNLatLngBounds,
97
+ padding?: number,
98
+ durationMs?: number,
99
+ lockBounds?: boolean
100
+ ): void;
101
+
102
+ snapshot(options: RNSnapshotOptions): Promise<string | undefined>;
103
+
91
104
  showLocationDialog(): void;
92
105
 
93
106
  openLocationSettings(): void;
package/src/types.ts CHANGED
@@ -23,9 +23,31 @@ export type RNMapUiSettings = {
23
23
  zoomGesturesEnabled?: boolean;
24
24
  };
25
25
 
26
- export type RNLatLng = { latitude: number; longitude: number };
26
+ export type RNLatLng = {
27
+ latitude: number;
28
+ longitude: number;
29
+ };
30
+
31
+ export type RNLatLngBounds = {
32
+ northEast: RNLatLng;
33
+ southWest: RNLatLng;
34
+ };
35
+
36
+ export type RNSnapshotOptions = {
37
+ size?: RNSize;
38
+ format: RNSnapshotFormat;
39
+ quality: number;
40
+ resultType: RNSnapshotResultType;
41
+ };
42
+
43
+ export type RNSize = {
44
+ width: number;
45
+ height: number;
46
+ };
47
+
48
+ export type RNSnapshotFormat = 'png' | 'jpg' | 'jpeg';
27
49
 
28
- export type RNBoundingBox = { northEast: RNLatLng; southWest: RNLatLng };
50
+ export type RNSnapshotResultType = 'base64' | 'file';
29
51
 
30
52
  export type RNMapPadding = {
31
53
  top: number;