react-native-google-maps-plus 1.1.0-dev.3 → 1.1.0-dev.5
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/README.md +7 -5
- package/RNGoogleMapsPlus.podspec +2 -1
- package/android/src/main/java/com/rngooglemapsplus/GoogleMapsViewImpl.kt +54 -0
- package/android/src/main/java/com/rngooglemapsplus/MapHeatmapBuilder.kt +31 -0
- package/android/src/main/java/com/rngooglemapsplus/RNGoogleMapsPlusView.kt +16 -0
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNHeatmapPointExtension.kt +9 -0
- package/ios/GoogleMapViewImpl.swift +38 -4
- package/ios/MapHeatmapBuilder.swift +27 -0
- package/ios/RNGoogleMapsPlusView.swift +22 -0
- package/ios/extensions/RNHeatmap+Extension.swift +16 -0
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts +2 -1
- package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +19 -0
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.cpp +38 -0
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.hpp +2 -0
- package/nitrogen/generated/android/c++/JRNHeatmap.hpp +100 -0
- package/nitrogen/generated/android/c++/JRNHeatmapGradient.hpp +89 -0
- package/nitrogen/generated/android/c++/JRNHeatmapPoint.hpp +61 -0
- package/nitrogen/generated/android/c++/views/JHybridRNGoogleMapsPlusViewStateUpdater.cpp +4 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/HybridRNGoogleMapsPlusViewSpec.kt +6 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNHeatmap.kt +47 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNHeatmapGradient.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNHeatmapPoint.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/views/HybridRNGoogleMapsPlusViewManager.kt +1 -1
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.cpp +13 -13
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.hpp +116 -39
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Umbrella.hpp +9 -0
- package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusViewSpecSwift.hpp +17 -1
- package/nitrogen/generated/ios/c++/views/HybridRNGoogleMapsPlusViewComponent.mm +5 -0
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec.swift +1 -0
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec_cxx.swift +110 -42
- package/nitrogen/generated/ios/swift/RNCamera.swift +8 -1
- package/nitrogen/generated/ios/swift/RNHeatmap.swift +180 -0
- package/nitrogen/generated/ios/swift/RNHeatmapGradient.swift +81 -0
- package/nitrogen/generated/ios/swift/RNHeatmapPoint.swift +57 -0
- package/nitrogen/generated/ios/swift/RNInitialProps.swift +8 -1
- package/nitrogen/generated/ios/swift/RNLocationConfig.swift +16 -2
- package/nitrogen/generated/ios/swift/RNMarker.swift +16 -2
- package/nitrogen/generated/ios/swift/RNPolygon.swift +15 -11
- package/nitrogen/generated/ios/swift/RNPolyline.swift +15 -11
- package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.cpp +2 -0
- package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.hpp +5 -0
- package/nitrogen/generated/shared/c++/RNHeatmap.hpp +98 -0
- package/nitrogen/generated/shared/c++/RNHeatmapGradient.hpp +76 -0
- package/nitrogen/generated/shared/c++/RNHeatmapPoint.hpp +75 -0
- package/nitrogen/generated/shared/c++/views/HybridRNGoogleMapsPlusViewComponent.cpp +12 -0
- package/nitrogen/generated/shared/c++/views/HybridRNGoogleMapsPlusViewComponent.hpp +2 -0
- package/nitrogen/generated/shared/json/RNGoogleMapsPlusViewConfig.json +1 -0
- package/package.json +2 -2
- package/src/RNGoogleMapsPlusView.nitro.ts +2 -0
- package/src/types.ts +22 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNHeatmapGradient.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
|
+
|
|
22
|
+
|
|
23
|
+
#include <string>
|
|
24
|
+
#include <vector>
|
|
25
|
+
|
|
26
|
+
namespace margelo::nitro::rngooglemapsplus {
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A struct which can be represented as a JavaScript object (RNHeatmapGradient).
|
|
30
|
+
*/
|
|
31
|
+
struct RNHeatmapGradient {
|
|
32
|
+
public:
|
|
33
|
+
std::vector<std::string> colors SWIFT_PRIVATE;
|
|
34
|
+
std::vector<double> startPoints SWIFT_PRIVATE;
|
|
35
|
+
double colorMapSize SWIFT_PRIVATE;
|
|
36
|
+
|
|
37
|
+
public:
|
|
38
|
+
RNHeatmapGradient() = default;
|
|
39
|
+
explicit RNHeatmapGradient(std::vector<std::string> colors, std::vector<double> startPoints, double colorMapSize): colors(colors), startPoints(startPoints), colorMapSize(colorMapSize) {}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
} // namespace margelo::nitro::rngooglemapsplus
|
|
43
|
+
|
|
44
|
+
namespace margelo::nitro {
|
|
45
|
+
|
|
46
|
+
// C++ RNHeatmapGradient <> JS RNHeatmapGradient (object)
|
|
47
|
+
template <>
|
|
48
|
+
struct JSIConverter<margelo::nitro::rngooglemapsplus::RNHeatmapGradient> final {
|
|
49
|
+
static inline margelo::nitro::rngooglemapsplus::RNHeatmapGradient fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
50
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
51
|
+
return margelo::nitro::rngooglemapsplus::RNHeatmapGradient(
|
|
52
|
+
JSIConverter<std::vector<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "colors")),
|
|
53
|
+
JSIConverter<std::vector<double>>::fromJSI(runtime, obj.getProperty(runtime, "startPoints")),
|
|
54
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "colorMapSize"))
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNHeatmapGradient& arg) {
|
|
58
|
+
jsi::Object obj(runtime);
|
|
59
|
+
obj.setProperty(runtime, "colors", JSIConverter<std::vector<std::string>>::toJSI(runtime, arg.colors));
|
|
60
|
+
obj.setProperty(runtime, "startPoints", JSIConverter<std::vector<double>>::toJSI(runtime, arg.startPoints));
|
|
61
|
+
obj.setProperty(runtime, "colorMapSize", JSIConverter<double>::toJSI(runtime, arg.colorMapSize));
|
|
62
|
+
return obj;
|
|
63
|
+
}
|
|
64
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
65
|
+
if (!value.isObject()) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
jsi::Object obj = value.getObject(runtime);
|
|
69
|
+
if (!JSIConverter<std::vector<std::string>>::canConvert(runtime, obj.getProperty(runtime, "colors"))) return false;
|
|
70
|
+
if (!JSIConverter<std::vector<double>>::canConvert(runtime, obj.getProperty(runtime, "startPoints"))) return false;
|
|
71
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "colorMapSize"))) return false;
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RNHeatmapPoint.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
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
namespace margelo::nitro::rngooglemapsplus {
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* A struct which can be represented as a JavaScript object (RNHeatmapPoint).
|
|
29
|
+
*/
|
|
30
|
+
struct RNHeatmapPoint {
|
|
31
|
+
public:
|
|
32
|
+
double latitude SWIFT_PRIVATE;
|
|
33
|
+
double longitude SWIFT_PRIVATE;
|
|
34
|
+
double weight SWIFT_PRIVATE;
|
|
35
|
+
|
|
36
|
+
public:
|
|
37
|
+
RNHeatmapPoint() = default;
|
|
38
|
+
explicit RNHeatmapPoint(double latitude, double longitude, double weight): latitude(latitude), longitude(longitude), weight(weight) {}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
} // namespace margelo::nitro::rngooglemapsplus
|
|
42
|
+
|
|
43
|
+
namespace margelo::nitro {
|
|
44
|
+
|
|
45
|
+
// C++ RNHeatmapPoint <> JS RNHeatmapPoint (object)
|
|
46
|
+
template <>
|
|
47
|
+
struct JSIConverter<margelo::nitro::rngooglemapsplus::RNHeatmapPoint> final {
|
|
48
|
+
static inline margelo::nitro::rngooglemapsplus::RNHeatmapPoint fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
49
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
50
|
+
return margelo::nitro::rngooglemapsplus::RNHeatmapPoint(
|
|
51
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "latitude")),
|
|
52
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "longitude")),
|
|
53
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "weight"))
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rngooglemapsplus::RNHeatmapPoint& arg) {
|
|
57
|
+
jsi::Object obj(runtime);
|
|
58
|
+
obj.setProperty(runtime, "latitude", JSIConverter<double>::toJSI(runtime, arg.latitude));
|
|
59
|
+
obj.setProperty(runtime, "longitude", JSIConverter<double>::toJSI(runtime, arg.longitude));
|
|
60
|
+
obj.setProperty(runtime, "weight", JSIConverter<double>::toJSI(runtime, arg.weight));
|
|
61
|
+
return obj;
|
|
62
|
+
}
|
|
63
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
64
|
+
if (!value.isObject()) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
jsi::Object obj = value.getObject(runtime);
|
|
68
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "latitude"))) return false;
|
|
69
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "longitude"))) return false;
|
|
70
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "weight"))) return false;
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
} // namespace margelo::nitro
|
|
@@ -175,6 +175,16 @@ namespace margelo::nitro::rngooglemapsplus::views {
|
|
|
175
175
|
throw std::runtime_error(std::string("RNGoogleMapsPlusView.circles: ") + exc.what());
|
|
176
176
|
}
|
|
177
177
|
}()),
|
|
178
|
+
heatmaps([&]() -> CachedProp<std::optional<std::vector<RNHeatmap>>> {
|
|
179
|
+
try {
|
|
180
|
+
const react::RawValue* rawValue = rawProps.at("heatmaps", nullptr, nullptr);
|
|
181
|
+
if (rawValue == nullptr) return sourceProps.heatmaps;
|
|
182
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
183
|
+
return CachedProp<std::optional<std::vector<RNHeatmap>>>::fromRawValue(*runtime, value, sourceProps.heatmaps);
|
|
184
|
+
} catch (const std::exception& exc) {
|
|
185
|
+
throw std::runtime_error(std::string("RNGoogleMapsPlusView.heatmaps: ") + exc.what());
|
|
186
|
+
}
|
|
187
|
+
}()),
|
|
178
188
|
locationConfig([&]() -> CachedProp<std::optional<RNLocationConfig>> {
|
|
179
189
|
try {
|
|
180
190
|
const react::RawValue* rawValue = rawProps.at("locationConfig", nullptr, nullptr);
|
|
@@ -333,6 +343,7 @@ namespace margelo::nitro::rngooglemapsplus::views {
|
|
|
333
343
|
polygons(other.polygons),
|
|
334
344
|
polylines(other.polylines),
|
|
335
345
|
circles(other.circles),
|
|
346
|
+
heatmaps(other.heatmaps),
|
|
336
347
|
locationConfig(other.locationConfig),
|
|
337
348
|
onMapError(other.onMapError),
|
|
338
349
|
onMapReady(other.onMapReady),
|
|
@@ -365,6 +376,7 @@ namespace margelo::nitro::rngooglemapsplus::views {
|
|
|
365
376
|
case hashString("polygons"): return true;
|
|
366
377
|
case hashString("polylines"): return true;
|
|
367
378
|
case hashString("circles"): return true;
|
|
379
|
+
case hashString("heatmaps"): return true;
|
|
368
380
|
case hashString("locationConfig"): return true;
|
|
369
381
|
case hashString("onMapError"): return true;
|
|
370
382
|
case hashString("onMapReady"): return true;
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
#include "RNPolygon.hpp"
|
|
30
30
|
#include "RNPolyline.hpp"
|
|
31
31
|
#include "RNCircle.hpp"
|
|
32
|
+
#include "RNHeatmap.hpp"
|
|
32
33
|
#include "RNLocationConfig.hpp"
|
|
33
34
|
#include "RNMapErrorCode.hpp"
|
|
34
35
|
#include <functional>
|
|
@@ -76,6 +77,7 @@ namespace margelo::nitro::rngooglemapsplus::views {
|
|
|
76
77
|
CachedProp<std::optional<std::vector<RNPolygon>>> polygons;
|
|
77
78
|
CachedProp<std::optional<std::vector<RNPolyline>>> polylines;
|
|
78
79
|
CachedProp<std::optional<std::vector<RNCircle>>> circles;
|
|
80
|
+
CachedProp<std::optional<std::vector<RNHeatmap>>> heatmaps;
|
|
79
81
|
CachedProp<std::optional<RNLocationConfig>> locationConfig;
|
|
80
82
|
CachedProp<std::optional<std::function<void(RNMapErrorCode /* error */)>>> onMapError;
|
|
81
83
|
CachedProp<std::optional<std::function<void(bool /* ready */)>>> onMapReady;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-google-maps-plus",
|
|
3
|
-
"version": "1.1.0-dev.
|
|
3
|
+
"version": "1.1.0-dev.5",
|
|
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",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"eslint-plugin-prettier": "5.5.4",
|
|
94
94
|
"jest": "30.2.0",
|
|
95
95
|
"lefthook": "1.13.6",
|
|
96
|
-
"nitrogen": "0.29.
|
|
96
|
+
"nitrogen": "0.29.6",
|
|
97
97
|
"prettier": "3.6.2",
|
|
98
98
|
"react": "19.2.0",
|
|
99
99
|
"react-native": "0.82.0",
|
|
@@ -22,6 +22,7 @@ import type {
|
|
|
22
22
|
RNMapUiSettings,
|
|
23
23
|
RNLocationConfig,
|
|
24
24
|
RNMapZoomConfig,
|
|
25
|
+
RNHeatmap,
|
|
25
26
|
} from './types';
|
|
26
27
|
|
|
27
28
|
export interface RNGoogleMapsPlusViewProps extends HybridViewProps {
|
|
@@ -40,6 +41,7 @@ export interface RNGoogleMapsPlusViewProps extends HybridViewProps {
|
|
|
40
41
|
polygons?: RNPolygon[];
|
|
41
42
|
polylines?: RNPolyline[];
|
|
42
43
|
circles?: RNCircle[];
|
|
44
|
+
heatmaps?: RNHeatmap[];
|
|
43
45
|
locationConfig?: RNLocationConfig;
|
|
44
46
|
onMapError?: (error: RNMapErrorCode) => void;
|
|
45
47
|
onMapReady?: (ready: boolean) => void;
|
package/src/types.ts
CHANGED
|
@@ -177,6 +177,28 @@ export type RNCircle = {
|
|
|
177
177
|
fillColor?: string;
|
|
178
178
|
};
|
|
179
179
|
|
|
180
|
+
export type RNHeatmap = {
|
|
181
|
+
id: string;
|
|
182
|
+
pressable?: boolean;
|
|
183
|
+
zIndex?: number;
|
|
184
|
+
weightedData: RNHeatmapPoint[];
|
|
185
|
+
radius?: number;
|
|
186
|
+
opacity?: number;
|
|
187
|
+
gradient?: RNHeatmapGradient;
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
export type RNHeatmapPoint = {
|
|
191
|
+
latitude: number;
|
|
192
|
+
longitude: number;
|
|
193
|
+
weight: number;
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
export type RNHeatmapGradient = {
|
|
197
|
+
colors: string[];
|
|
198
|
+
startPoints: number[];
|
|
199
|
+
colorMapSize: number;
|
|
200
|
+
};
|
|
201
|
+
|
|
180
202
|
export type RNLocationConfig = {
|
|
181
203
|
android?: RNAndroidLocationConfig;
|
|
182
204
|
ios?: RNIOSLocationConfig;
|