react-native-maps 1.21.0-alpha.82 → 1.21.0-alpha.84
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/android/generated/java/com/facebook/react/viewmanagers/RNMapsCircleManagerDelegate.java +49 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsCircleManagerInterface.java +24 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsOverlayManagerDelegate.java +46 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsOverlayManagerInterface.java +24 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/ComponentDescriptors.cpp +1 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/ComponentDescriptors.h +1 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/EventEmitters.cpp +22 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/EventEmitters.h +22 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/Props.cpp +11 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/Props.h +45 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/ShadowNodes.cpp +1 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/ShadowNodes.h +11 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/States.h +12 -0
- package/android/src/main/java/com/rnmaps/fabric/MapViewManager.java +1 -0
- package/android/src/main/java/com/rnmaps/fabric/MarkerManager.java +0 -1
- package/android/src/main/java/com/rnmaps/fabric/OverlayManager.java +95 -0
- package/android/src/main/java/com/rnmaps/maps/MapAirModulePackage.java +5 -1
- package/android/src/main/java/com/rnmaps/maps/MapOverlay.java +287 -149
- package/ios/generated/RNMapsSpecs/ComponentDescriptors.cpp +1 -0
- package/ios/generated/RNMapsSpecs/ComponentDescriptors.h +1 -0
- package/ios/generated/RNMapsSpecs/EventEmitters.cpp +22 -0
- package/ios/generated/RNMapsSpecs/EventEmitters.h +22 -0
- package/ios/generated/RNMapsSpecs/Props.cpp +11 -0
- package/ios/generated/RNMapsSpecs/Props.h +45 -0
- package/ios/generated/RNMapsSpecs/RCTComponentViewHelpers.h +4 -0
- package/ios/generated/RNMapsSpecs/ShadowNodes.cpp +1 -0
- package/ios/generated/RNMapsSpecs/ShadowNodes.h +11 -0
- package/ios/generated/RNMapsSpecs/States.h +12 -0
- package/lib/MapMarker.js +6 -1
- package/lib/MapOverlay.d.ts +1 -0
- package/lib/MapOverlay.js +22 -4
- package/lib/decorateMapComponent.js +5 -0
- package/lib/specs/NativeComponentOverlay.d.ts +67 -0
- package/lib/specs/NativeComponentOverlay.js +7 -0
- package/package.json +1 -1
package/android/generated/java/com/facebook/react/viewmanagers/RNMapsCircleManagerDelegate.java
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GeneratePropsJavaDelegate.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
package com.facebook.react.viewmanagers;
|
|
11
|
+
|
|
12
|
+
import android.view.View;
|
|
13
|
+
import androidx.annotation.Nullable;
|
|
14
|
+
import com.facebook.react.bridge.ColorPropConverter;
|
|
15
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
16
|
+
import com.facebook.react.uimanager.BaseViewManager;
|
|
17
|
+
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
|
18
|
+
import com.facebook.react.uimanager.LayoutShadowNode;
|
|
19
|
+
|
|
20
|
+
public class RNMapsCircleManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & RNMapsCircleManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
|
21
|
+
public RNMapsCircleManagerDelegate(U viewManager) {
|
|
22
|
+
super(viewManager);
|
|
23
|
+
}
|
|
24
|
+
@Override
|
|
25
|
+
public void setProperty(T view, String propName, @Nullable Object value) {
|
|
26
|
+
switch (propName) {
|
|
27
|
+
case "center":
|
|
28
|
+
mViewManager.setCenter(view, (ReadableMap) value);
|
|
29
|
+
break;
|
|
30
|
+
case "fillColor":
|
|
31
|
+
mViewManager.setFillColor(view, ColorPropConverter.getColor(value, view.getContext()));
|
|
32
|
+
break;
|
|
33
|
+
case "radius":
|
|
34
|
+
mViewManager.setRadius(view, value == null ? Double.NaN : ((Double) value).doubleValue());
|
|
35
|
+
break;
|
|
36
|
+
case "strokeColor":
|
|
37
|
+
mViewManager.setStrokeColor(view, ColorPropConverter.getColor(value, view.getContext()));
|
|
38
|
+
break;
|
|
39
|
+
case "strokeWidth":
|
|
40
|
+
mViewManager.setStrokeWidth(view, value == null ? 0f : ((Double) value).floatValue());
|
|
41
|
+
break;
|
|
42
|
+
case "tappable":
|
|
43
|
+
mViewManager.setTappable(view, value == null ? false : (boolean) value);
|
|
44
|
+
break;
|
|
45
|
+
default:
|
|
46
|
+
super.setProperty(view, propName, value);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
package/android/generated/java/com/facebook/react/viewmanagers/RNMapsCircleManagerInterface.java
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GeneratePropsJavaInterface.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
package com.facebook.react.viewmanagers;
|
|
11
|
+
|
|
12
|
+
import android.view.View;
|
|
13
|
+
import androidx.annotation.Nullable;
|
|
14
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
15
|
+
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
|
|
16
|
+
|
|
17
|
+
public interface RNMapsCircleManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
|
|
18
|
+
void setCenter(T view, @Nullable ReadableMap value);
|
|
19
|
+
void setFillColor(T view, @Nullable Integer value);
|
|
20
|
+
void setRadius(T view, double value);
|
|
21
|
+
void setStrokeColor(T view, @Nullable Integer value);
|
|
22
|
+
void setStrokeWidth(T view, float value);
|
|
23
|
+
void setTappable(T view, boolean value);
|
|
24
|
+
}
|
package/android/generated/java/com/facebook/react/viewmanagers/RNMapsOverlayManagerDelegate.java
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GeneratePropsJavaDelegate.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
package com.facebook.react.viewmanagers;
|
|
11
|
+
|
|
12
|
+
import android.view.View;
|
|
13
|
+
import androidx.annotation.Nullable;
|
|
14
|
+
import com.facebook.react.bridge.ReadableArray;
|
|
15
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
16
|
+
import com.facebook.react.uimanager.BaseViewManager;
|
|
17
|
+
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
|
18
|
+
import com.facebook.react.uimanager.LayoutShadowNode;
|
|
19
|
+
|
|
20
|
+
public class RNMapsOverlayManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & RNMapsOverlayManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
|
21
|
+
public RNMapsOverlayManagerDelegate(U viewManager) {
|
|
22
|
+
super(viewManager);
|
|
23
|
+
}
|
|
24
|
+
@Override
|
|
25
|
+
public void setProperty(T view, String propName, @Nullable Object value) {
|
|
26
|
+
switch (propName) {
|
|
27
|
+
case "bearing":
|
|
28
|
+
mViewManager.setBearing(view, value == null ? 0f : ((Double) value).floatValue());
|
|
29
|
+
break;
|
|
30
|
+
case "bounds":
|
|
31
|
+
mViewManager.setBounds(view, (ReadableArray) value);
|
|
32
|
+
break;
|
|
33
|
+
case "image":
|
|
34
|
+
mViewManager.setImage(view, (ReadableMap) value);
|
|
35
|
+
break;
|
|
36
|
+
case "opacity":
|
|
37
|
+
mViewManager.setOpacity(view, value == null ? 1f : ((Double) value).floatValue());
|
|
38
|
+
break;
|
|
39
|
+
case "tappable":
|
|
40
|
+
mViewManager.setTappable(view, value == null ? false : (boolean) value);
|
|
41
|
+
break;
|
|
42
|
+
default:
|
|
43
|
+
super.setProperty(view, propName, value);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
package/android/generated/java/com/facebook/react/viewmanagers/RNMapsOverlayManagerInterface.java
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GeneratePropsJavaInterface.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
package com.facebook.react.viewmanagers;
|
|
11
|
+
|
|
12
|
+
import android.view.View;
|
|
13
|
+
import androidx.annotation.Nullable;
|
|
14
|
+
import com.facebook.react.bridge.ReadableArray;
|
|
15
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
16
|
+
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
|
|
17
|
+
|
|
18
|
+
public interface RNMapsOverlayManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
|
|
19
|
+
void setBearing(T view, float value);
|
|
20
|
+
void setBounds(T view, @Nullable ReadableArray value);
|
|
21
|
+
void setImage(T view, @Nullable ReadableMap value);
|
|
22
|
+
void setOpacity(T view, float value);
|
|
23
|
+
void setTappable(T view, boolean value);
|
|
24
|
+
}
|
package/android/generated/jni/react/renderer/components/RNMapsSpecs/ComponentDescriptors.cpp
CHANGED
|
@@ -22,6 +22,7 @@ registry->add(concreteComponentDescriptorProvider<RNMapsGoogleMapViewComponentDe
|
|
|
22
22
|
registry->add(concreteComponentDescriptorProvider<RNMapsGooglePolygonComponentDescriptor>());
|
|
23
23
|
registry->add(concreteComponentDescriptorProvider<RNMapsMapViewComponentDescriptor>());
|
|
24
24
|
registry->add(concreteComponentDescriptorProvider<RNMapsMarkerComponentDescriptor>());
|
|
25
|
+
registry->add(concreteComponentDescriptorProvider<RNMapsOverlayComponentDescriptor>());
|
|
25
26
|
registry->add(concreteComponentDescriptorProvider<RNMapsPolylineComponentDescriptor>());
|
|
26
27
|
}
|
|
27
28
|
|
|
@@ -22,6 +22,7 @@ using RNMapsGoogleMapViewComponentDescriptor = ConcreteComponentDescriptor<RNMap
|
|
|
22
22
|
using RNMapsGooglePolygonComponentDescriptor = ConcreteComponentDescriptor<RNMapsGooglePolygonShadowNode>;
|
|
23
23
|
using RNMapsMapViewComponentDescriptor = ConcreteComponentDescriptor<RNMapsMapViewShadowNode>;
|
|
24
24
|
using RNMapsMarkerComponentDescriptor = ConcreteComponentDescriptor<RNMapsMarkerShadowNode>;
|
|
25
|
+
using RNMapsOverlayComponentDescriptor = ConcreteComponentDescriptor<RNMapsOverlayShadowNode>;
|
|
25
26
|
using RNMapsPolylineComponentDescriptor = ConcreteComponentDescriptor<RNMapsPolylineShadowNode>;
|
|
26
27
|
|
|
27
28
|
void RNMapsSpecs_registerComponentDescriptorsFromCodegen(
|
|
@@ -938,6 +938,28 @@ $payload.setProperty(runtime, "id", $event.id);
|
|
|
938
938
|
}
|
|
939
939
|
|
|
940
940
|
|
|
941
|
+
void RNMapsOverlayEventEmitter::onPress(OnPress $event) const {
|
|
942
|
+
dispatchEvent("press", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
943
|
+
auto $payload = jsi::Object(runtime);
|
|
944
|
+
$payload.setProperty(runtime, "action", $event.action);
|
|
945
|
+
$payload.setProperty(runtime, "id", $event.id);
|
|
946
|
+
{
|
|
947
|
+
auto coordinate = jsi::Object(runtime);
|
|
948
|
+
coordinate.setProperty(runtime, "latitude", $event.coordinate.latitude);
|
|
949
|
+
coordinate.setProperty(runtime, "longitude", $event.coordinate.longitude);
|
|
950
|
+
$payload.setProperty(runtime, "coordinate", coordinate);
|
|
951
|
+
}
|
|
952
|
+
{
|
|
953
|
+
auto position = jsi::Object(runtime);
|
|
954
|
+
position.setProperty(runtime, "x", $event.position.x);
|
|
955
|
+
position.setProperty(runtime, "y", $event.position.y);
|
|
956
|
+
$payload.setProperty(runtime, "position", position);
|
|
957
|
+
}
|
|
958
|
+
return $payload;
|
|
959
|
+
});
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
|
|
941
963
|
void RNMapsPolylineEventEmitter::onPress(OnPress $event) const {
|
|
942
964
|
dispatchEvent("press", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
943
965
|
auto $payload = jsi::Object(runtime);
|
|
@@ -806,6 +806,28 @@ class RNMapsMarkerEventEmitter : public ViewEventEmitter {
|
|
|
806
806
|
|
|
807
807
|
void onSelect(OnSelect value) const;
|
|
808
808
|
};
|
|
809
|
+
class RNMapsOverlayEventEmitter : public ViewEventEmitter {
|
|
810
|
+
public:
|
|
811
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
812
|
+
|
|
813
|
+
struct OnPressCoordinate {
|
|
814
|
+
double latitude;
|
|
815
|
+
double longitude;
|
|
816
|
+
};
|
|
817
|
+
|
|
818
|
+
struct OnPressPosition {
|
|
819
|
+
double x;
|
|
820
|
+
double y;
|
|
821
|
+
};
|
|
822
|
+
|
|
823
|
+
struct OnPress {
|
|
824
|
+
std::string action;
|
|
825
|
+
std::string id;
|
|
826
|
+
OnPressCoordinate coordinate;
|
|
827
|
+
OnPressPosition position;
|
|
828
|
+
};
|
|
829
|
+
void onPress(OnPress value) const;
|
|
830
|
+
};
|
|
809
831
|
class RNMapsPolylineEventEmitter : public ViewEventEmitter {
|
|
810
832
|
public:
|
|
811
833
|
using ViewEventEmitter::ViewEventEmitter;
|
|
@@ -163,6 +163,17 @@ RNMapsMarkerProps::RNMapsMarkerProps(
|
|
|
163
163
|
subtitleVisibility(convertRawProp(context, rawProps, "subtitleVisibility", sourceProps.subtitleVisibility, {RNMapsMarkerSubtitleVisibility::Adaptive})),
|
|
164
164
|
useLegacyPinView(convertRawProp(context, rawProps, "useLegacyPinView", sourceProps.useLegacyPinView, {false}))
|
|
165
165
|
{}
|
|
166
|
+
RNMapsOverlayProps::RNMapsOverlayProps(
|
|
167
|
+
const PropsParserContext &context,
|
|
168
|
+
const RNMapsOverlayProps &sourceProps,
|
|
169
|
+
const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),
|
|
170
|
+
|
|
171
|
+
bearing(convertRawProp(context, rawProps, "bearing", sourceProps.bearing, {0.0})),
|
|
172
|
+
bounds(convertRawProp(context, rawProps, "bounds", sourceProps.bounds, {})),
|
|
173
|
+
image(convertRawProp(context, rawProps, "image", sourceProps.image, {})),
|
|
174
|
+
opacity(convertRawProp(context, rawProps, "opacity", sourceProps.opacity, {1.0})),
|
|
175
|
+
tappable(convertRawProp(context, rawProps, "tappable", sourceProps.tappable, {false}))
|
|
176
|
+
{}
|
|
166
177
|
RNMapsPolylineProps::RNMapsPolylineProps(
|
|
167
178
|
const PropsParserContext &context,
|
|
168
179
|
const RNMapsPolylineProps &sourceProps,
|
|
@@ -1092,6 +1092,51 @@ class RNMapsMarkerProps final : public ViewProps {
|
|
|
1092
1092
|
bool useLegacyPinView{false};
|
|
1093
1093
|
};
|
|
1094
1094
|
|
|
1095
|
+
struct RNMapsOverlayBoundsStruct {
|
|
1096
|
+
double latitude{0.0};
|
|
1097
|
+
double longitude{0.0};
|
|
1098
|
+
};
|
|
1099
|
+
|
|
1100
|
+
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, RNMapsOverlayBoundsStruct &result) {
|
|
1101
|
+
auto map = (std::unordered_map<std::string, RawValue>)value;
|
|
1102
|
+
|
|
1103
|
+
auto tmp_latitude = map.find("latitude");
|
|
1104
|
+
if (tmp_latitude != map.end()) {
|
|
1105
|
+
fromRawValue(context, tmp_latitude->second, result.latitude);
|
|
1106
|
+
}
|
|
1107
|
+
auto tmp_longitude = map.find("longitude");
|
|
1108
|
+
if (tmp_longitude != map.end()) {
|
|
1109
|
+
fromRawValue(context, tmp_longitude->second, result.longitude);
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
static inline std::string toString(const RNMapsOverlayBoundsStruct &value) {
|
|
1114
|
+
return "[Object RNMapsOverlayBoundsStruct]";
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, std::vector<RNMapsOverlayBoundsStruct> &result) {
|
|
1118
|
+
auto items = (std::vector<RawValue>)value;
|
|
1119
|
+
for (const auto &item : items) {
|
|
1120
|
+
RNMapsOverlayBoundsStruct newItem;
|
|
1121
|
+
fromRawValue(context, item, newItem);
|
|
1122
|
+
result.emplace_back(newItem);
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
class RNMapsOverlayProps final : public ViewProps {
|
|
1127
|
+
public:
|
|
1128
|
+
RNMapsOverlayProps() = default;
|
|
1129
|
+
RNMapsOverlayProps(const PropsParserContext& context, const RNMapsOverlayProps &sourceProps, const RawProps &rawProps);
|
|
1130
|
+
|
|
1131
|
+
#pragma mark - Props
|
|
1132
|
+
|
|
1133
|
+
Float bearing{0.0};
|
|
1134
|
+
std::vector<RNMapsOverlayBoundsStruct> bounds{};
|
|
1135
|
+
ImageSource image{};
|
|
1136
|
+
Float opacity{1.0};
|
|
1137
|
+
bool tappable{false};
|
|
1138
|
+
};
|
|
1139
|
+
|
|
1095
1140
|
enum class RNMapsPolylineLineCap { Butt, Round, Square };
|
|
1096
1141
|
|
|
1097
1142
|
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, RNMapsPolylineLineCap &result) {
|
|
@@ -18,6 +18,7 @@ extern const char RNMapsGoogleMapViewComponentName[] = "RNMapsGoogleMapView";
|
|
|
18
18
|
extern const char RNMapsGooglePolygonComponentName[] = "RNMapsGooglePolygon";
|
|
19
19
|
extern const char RNMapsMapViewComponentName[] = "RNMapsMapView";
|
|
20
20
|
extern const char RNMapsMarkerComponentName[] = "RNMapsMarker";
|
|
21
|
+
extern const char RNMapsOverlayComponentName[] = "RNMapsOverlay";
|
|
21
22
|
extern const char RNMapsPolylineComponentName[] = "RNMapsPolyline";
|
|
22
23
|
|
|
23
24
|
} // namespace facebook::react
|
|
@@ -84,6 +84,17 @@ using RNMapsMarkerShadowNode = ConcreteViewShadowNode<
|
|
|
84
84
|
RNMapsMarkerEventEmitter,
|
|
85
85
|
RNMapsMarkerState>;
|
|
86
86
|
|
|
87
|
+
JSI_EXPORT extern const char RNMapsOverlayComponentName[];
|
|
88
|
+
|
|
89
|
+
/*
|
|
90
|
+
* `ShadowNode` for <RNMapsOverlay> component.
|
|
91
|
+
*/
|
|
92
|
+
using RNMapsOverlayShadowNode = ConcreteViewShadowNode<
|
|
93
|
+
RNMapsOverlayComponentName,
|
|
94
|
+
RNMapsOverlayProps,
|
|
95
|
+
RNMapsOverlayEventEmitter,
|
|
96
|
+
RNMapsOverlayState>;
|
|
97
|
+
|
|
87
98
|
JSI_EXPORT extern const char RNMapsPolylineComponentName[];
|
|
88
99
|
|
|
89
100
|
/*
|
|
@@ -86,6 +86,18 @@ public:
|
|
|
86
86
|
#endif
|
|
87
87
|
};
|
|
88
88
|
|
|
89
|
+
class RNMapsOverlayState {
|
|
90
|
+
public:
|
|
91
|
+
RNMapsOverlayState() = default;
|
|
92
|
+
|
|
93
|
+
#ifdef ANDROID
|
|
94
|
+
RNMapsOverlayState(RNMapsOverlayState const &previousState, folly::dynamic data){};
|
|
95
|
+
folly::dynamic getDynamic() const {
|
|
96
|
+
return {};
|
|
97
|
+
};
|
|
98
|
+
#endif
|
|
99
|
+
};
|
|
100
|
+
|
|
89
101
|
class RNMapsPolylineState {
|
|
90
102
|
public:
|
|
91
103
|
RNMapsPolylineState() = default;
|
|
@@ -34,6 +34,7 @@ import com.google.android.gms.maps.model.LatLng;
|
|
|
34
34
|
import com.google.android.gms.maps.model.LatLngBounds;
|
|
35
35
|
import com.google.android.gms.maps.model.MapColorScheme;
|
|
36
36
|
import com.rnmaps.maps.MapMarker;
|
|
37
|
+
import com.rnmaps.maps.MapOverlay;
|
|
37
38
|
import com.rnmaps.maps.MapView;
|
|
38
39
|
import com.rnmaps.maps.SizeReportingShadowNode;
|
|
39
40
|
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
package com.rnmaps.fabric;
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import androidx.annotation.Nullable;
|
|
5
|
+
|
|
6
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
7
|
+
import com.facebook.react.bridge.ReadableArray;
|
|
8
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
9
|
+
import com.facebook.react.module.annotations.ReactModule;
|
|
10
|
+
import com.facebook.react.uimanager.ThemedReactContext;
|
|
11
|
+
import com.facebook.react.uimanager.ViewGroupManager;
|
|
12
|
+
import com.facebook.react.uimanager.ViewManagerDelegate;
|
|
13
|
+
import com.facebook.react.viewmanagers.RNMapsOverlayManagerDelegate;
|
|
14
|
+
import com.facebook.react.viewmanagers.RNMapsOverlayManagerInterface;
|
|
15
|
+
import com.rnmaps.maps.MapOverlay;
|
|
16
|
+
|
|
17
|
+
import java.util.HashMap;
|
|
18
|
+
import java.util.Map;
|
|
19
|
+
|
|
20
|
+
@ReactModule(name = OverlayManager.REACT_CLASS)
|
|
21
|
+
public class OverlayManager extends ViewGroupManager<MapOverlay> implements RNMapsOverlayManagerInterface<MapOverlay> {
|
|
22
|
+
public OverlayManager(ReactApplicationContext context) {
|
|
23
|
+
super(context);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
private final RNMapsOverlayManagerDelegate<MapOverlay, OverlayManager> delegate =
|
|
27
|
+
new RNMapsOverlayManagerDelegate<>(this);
|
|
28
|
+
|
|
29
|
+
@Override
|
|
30
|
+
public ViewManagerDelegate<MapOverlay> getDelegate() {
|
|
31
|
+
return delegate;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@Override
|
|
35
|
+
public String getName() {
|
|
36
|
+
return REACT_CLASS;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@Override
|
|
40
|
+
public MapOverlay createViewInstance(ThemedReactContext context) {
|
|
41
|
+
return new MapOverlay(context);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
public static final String REACT_CLASS = "RNMapsOverlay";
|
|
46
|
+
|
|
47
|
+
@Nullable
|
|
48
|
+
@Override
|
|
49
|
+
public Map<String, Object> getExportedCustomBubblingEventTypeConstants() {
|
|
50
|
+
return MapOverlay.getExportedCustomBubblingEventTypeConstants();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@Nullable
|
|
54
|
+
@Override
|
|
55
|
+
public Map<String, Object> getExportedCustomDirectEventTypeConstants() {
|
|
56
|
+
return new HashMap<>();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
@Override
|
|
62
|
+
public void setZIndex(MapOverlay view, float value) {
|
|
63
|
+
view.setZIndex(value);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
@Override
|
|
68
|
+
public void setBearing(MapOverlay view, float value) {
|
|
69
|
+
view.setBearing(value);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@Override
|
|
73
|
+
public void setBounds(MapOverlay view, @Nullable ReadableArray value) {
|
|
74
|
+
view.setBounds(value);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@Override
|
|
78
|
+
public void setImage(MapOverlay view, @Nullable ReadableMap value) {
|
|
79
|
+
if (value != null) {
|
|
80
|
+
view.setImage(value.getString("uri"));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
@Override
|
|
86
|
+
public void setOpacity(MapOverlay view, float value) {
|
|
87
|
+
// todo report to google that it's not working / fix it
|
|
88
|
+
// view.setTransparency(value);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@Override
|
|
92
|
+
public void setTappable(MapOverlay view, boolean value) {
|
|
93
|
+
view.setTappable(value);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -14,6 +14,7 @@ import com.rnmaps.fabric.MapViewManager;
|
|
|
14
14
|
import com.rnmaps.fabric.MarkerManager;
|
|
15
15
|
import com.rnmaps.fabric.NativeAirMapsModule;
|
|
16
16
|
import com.facebook.fbreact.specs.NativeAirMapsModuleSpec;
|
|
17
|
+
import com.rnmaps.fabric.OverlayManager;
|
|
17
18
|
import com.rnmaps.fabric.PolygonManager;
|
|
18
19
|
import com.rnmaps.fabric.PolylineManager;
|
|
19
20
|
|
|
@@ -25,12 +26,15 @@ public class MapAirModulePackage extends TurboReactPackage {
|
|
|
25
26
|
|
|
26
27
|
@Override
|
|
27
28
|
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
|
|
28
|
-
return List.of(new MapViewManager(reactContext), new MarkerManager(reactContext), new CalloutManager(reactContext), new PolygonManager(reactContext), new PolylineManager(reactContext), new CircleManager(reactContext));
|
|
29
|
+
return List.of(new MapViewManager(reactContext), new MarkerManager(reactContext), new CalloutManager(reactContext), new PolygonManager(reactContext), new PolylineManager(reactContext), new CircleManager(reactContext), new OverlayManager(reactContext));
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
|
|
32
33
|
@Override
|
|
33
34
|
public NativeModule getModule(String name, ReactApplicationContext reactContext) {
|
|
35
|
+
if (OverlayManager.REACT_CLASS.equals(name)) {
|
|
36
|
+
return new OverlayManager(reactContext);
|
|
37
|
+
}
|
|
34
38
|
if (CircleManager.REACT_CLASS.equals(name)) {
|
|
35
39
|
return new CircleManager(reactContext);
|
|
36
40
|
}
|