react-native-maps 1.21.0-alpha.81 → 1.21.0-alpha.83
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 +2 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/ComponentDescriptors.h +2 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/EventEmitters.cpp +44 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/EventEmitters.h +44 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/Props.cpp +23 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/Props.h +81 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/ShadowNodes.cpp +2 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/ShadowNodes.h +22 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/States.h +24 -0
- package/android/src/main/java/com/rnmaps/fabric/CircleManager.java +94 -0
- package/android/src/main/java/com/rnmaps/fabric/MapViewManager.java +5 -0
- package/android/src/main/java/com/rnmaps/fabric/MarkerManager.java +0 -1
- package/android/src/main/java/com/rnmaps/fabric/OverlayManager.java +94 -0
- package/android/src/main/java/com/rnmaps/maps/MapAirModulePackage.java +9 -1
- package/android/src/main/java/com/rnmaps/maps/MapCircle.java +24 -0
- package/android/src/main/java/com/rnmaps/maps/MapOverlay.java +175 -3
- package/ios/generated/RNMapsSpecs/ComponentDescriptors.cpp +2 -0
- package/ios/generated/RNMapsSpecs/ComponentDescriptors.h +2 -0
- package/ios/generated/RNMapsSpecs/EventEmitters.cpp +44 -0
- package/ios/generated/RNMapsSpecs/EventEmitters.h +44 -0
- package/ios/generated/RNMapsSpecs/Props.cpp +23 -0
- package/ios/generated/RNMapsSpecs/Props.h +81 -0
- package/ios/generated/RNMapsSpecs/RCTComponentViewHelpers.h +8 -0
- package/ios/generated/RNMapsSpecs/ShadowNodes.cpp +2 -0
- package/ios/generated/RNMapsSpecs/ShadowNodes.h +22 -0
- package/ios/generated/RNMapsSpecs/States.h +24 -0
- package/lib/MapMarker.js +6 -1
- package/lib/MapOverlay.d.ts +1 -0
- package/lib/MapOverlay.js +23 -4
- package/lib/decorateMapComponent.js +10 -0
- package/lib/specs/NativeComponentCircle.d.ts +74 -0
- package/lib/specs/NativeComponentCircle.js +7 -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
|
@@ -17,10 +17,12 @@ namespace facebook::react {
|
|
|
17
17
|
void RNMapsSpecs_registerComponentDescriptorsFromCodegen(
|
|
18
18
|
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
|
19
19
|
registry->add(concreteComponentDescriptorProvider<RNMapsCalloutComponentDescriptor>());
|
|
20
|
+
registry->add(concreteComponentDescriptorProvider<RNMapsCircleComponentDescriptor>());
|
|
20
21
|
registry->add(concreteComponentDescriptorProvider<RNMapsGoogleMapViewComponentDescriptor>());
|
|
21
22
|
registry->add(concreteComponentDescriptorProvider<RNMapsGooglePolygonComponentDescriptor>());
|
|
22
23
|
registry->add(concreteComponentDescriptorProvider<RNMapsMapViewComponentDescriptor>());
|
|
23
24
|
registry->add(concreteComponentDescriptorProvider<RNMapsMarkerComponentDescriptor>());
|
|
25
|
+
registry->add(concreteComponentDescriptorProvider<RNMapsOverlayComponentDescriptor>());
|
|
24
26
|
registry->add(concreteComponentDescriptorProvider<RNMapsPolylineComponentDescriptor>());
|
|
25
27
|
}
|
|
26
28
|
|
|
@@ -17,10 +17,12 @@
|
|
|
17
17
|
namespace facebook::react {
|
|
18
18
|
|
|
19
19
|
using RNMapsCalloutComponentDescriptor = ConcreteComponentDescriptor<RNMapsCalloutShadowNode>;
|
|
20
|
+
using RNMapsCircleComponentDescriptor = ConcreteComponentDescriptor<RNMapsCircleShadowNode>;
|
|
20
21
|
using RNMapsGoogleMapViewComponentDescriptor = ConcreteComponentDescriptor<RNMapsGoogleMapViewShadowNode>;
|
|
21
22
|
using RNMapsGooglePolygonComponentDescriptor = ConcreteComponentDescriptor<RNMapsGooglePolygonShadowNode>;
|
|
22
23
|
using RNMapsMapViewComponentDescriptor = ConcreteComponentDescriptor<RNMapsMapViewShadowNode>;
|
|
23
24
|
using RNMapsMarkerComponentDescriptor = ConcreteComponentDescriptor<RNMapsMarkerShadowNode>;
|
|
25
|
+
using RNMapsOverlayComponentDescriptor = ConcreteComponentDescriptor<RNMapsOverlayShadowNode>;
|
|
24
26
|
using RNMapsPolylineComponentDescriptor = ConcreteComponentDescriptor<RNMapsPolylineShadowNode>;
|
|
25
27
|
|
|
26
28
|
void RNMapsSpecs_registerComponentDescriptorsFromCodegen(
|
|
@@ -35,6 +35,28 @@ $payload.setProperty(runtime, "id", $event.id);
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
|
|
38
|
+
void RNMapsCircleEventEmitter::onPress(OnPress $event) const {
|
|
39
|
+
dispatchEvent("press", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
40
|
+
auto $payload = jsi::Object(runtime);
|
|
41
|
+
$payload.setProperty(runtime, "action", $event.action);
|
|
42
|
+
$payload.setProperty(runtime, "id", $event.id);
|
|
43
|
+
{
|
|
44
|
+
auto coordinate = jsi::Object(runtime);
|
|
45
|
+
coordinate.setProperty(runtime, "latitude", $event.coordinate.latitude);
|
|
46
|
+
coordinate.setProperty(runtime, "longitude", $event.coordinate.longitude);
|
|
47
|
+
$payload.setProperty(runtime, "coordinate", coordinate);
|
|
48
|
+
}
|
|
49
|
+
{
|
|
50
|
+
auto position = jsi::Object(runtime);
|
|
51
|
+
position.setProperty(runtime, "x", $event.position.x);
|
|
52
|
+
position.setProperty(runtime, "y", $event.position.y);
|
|
53
|
+
$payload.setProperty(runtime, "position", position);
|
|
54
|
+
}
|
|
55
|
+
return $payload;
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
38
60
|
void RNMapsGoogleMapViewEventEmitter::onIndoorBuildingFocused(OnIndoorBuildingFocused $event) const {
|
|
39
61
|
dispatchEvent("indoorBuildingFocused", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
40
62
|
auto $payload = jsi::Object(runtime);
|
|
@@ -916,6 +938,28 @@ $payload.setProperty(runtime, "id", $event.id);
|
|
|
916
938
|
}
|
|
917
939
|
|
|
918
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
|
+
|
|
919
963
|
void RNMapsPolylineEventEmitter::onPress(OnPress $event) const {
|
|
920
964
|
dispatchEvent("press", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
921
965
|
auto $payload = jsi::Object(runtime);
|
|
@@ -35,6 +35,28 @@ class RNMapsCalloutEventEmitter : public ViewEventEmitter {
|
|
|
35
35
|
};
|
|
36
36
|
void onPress(OnPress value) const;
|
|
37
37
|
};
|
|
38
|
+
class RNMapsCircleEventEmitter : public ViewEventEmitter {
|
|
39
|
+
public:
|
|
40
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
41
|
+
|
|
42
|
+
struct OnPressCoordinate {
|
|
43
|
+
double latitude;
|
|
44
|
+
double longitude;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
struct OnPressPosition {
|
|
48
|
+
double x;
|
|
49
|
+
double y;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
struct OnPress {
|
|
53
|
+
std::string action;
|
|
54
|
+
std::string id;
|
|
55
|
+
OnPressCoordinate coordinate;
|
|
56
|
+
OnPressPosition position;
|
|
57
|
+
};
|
|
58
|
+
void onPress(OnPress value) const;
|
|
59
|
+
};
|
|
38
60
|
class RNMapsGoogleMapViewEventEmitter : public ViewEventEmitter {
|
|
39
61
|
public:
|
|
40
62
|
using ViewEventEmitter::ViewEventEmitter;
|
|
@@ -784,6 +806,28 @@ class RNMapsMarkerEventEmitter : public ViewEventEmitter {
|
|
|
784
806
|
|
|
785
807
|
void onSelect(OnSelect value) const;
|
|
786
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
|
+
};
|
|
787
831
|
class RNMapsPolylineEventEmitter : public ViewEventEmitter {
|
|
788
832
|
public:
|
|
789
833
|
using ViewEventEmitter::ViewEventEmitter;
|
|
@@ -23,6 +23,18 @@ RNMapsCalloutProps::RNMapsCalloutProps(
|
|
|
23
23
|
alphaHitTest(convertRawProp(context, rawProps, "alphaHitTest", sourceProps.alphaHitTest, {false})),
|
|
24
24
|
tooltip(convertRawProp(context, rawProps, "tooltip", sourceProps.tooltip, {false}))
|
|
25
25
|
{}
|
|
26
|
+
RNMapsCircleProps::RNMapsCircleProps(
|
|
27
|
+
const PropsParserContext &context,
|
|
28
|
+
const RNMapsCircleProps &sourceProps,
|
|
29
|
+
const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),
|
|
30
|
+
|
|
31
|
+
center(convertRawProp(context, rawProps, "center", sourceProps.center, {})),
|
|
32
|
+
fillColor(convertRawProp(context, rawProps, "fillColor", sourceProps.fillColor, {})),
|
|
33
|
+
radius(convertRawProp(context, rawProps, "radius", sourceProps.radius, {0.0})),
|
|
34
|
+
strokeColor(convertRawProp(context, rawProps, "strokeColor", sourceProps.strokeColor, {})),
|
|
35
|
+
strokeWidth(convertRawProp(context, rawProps, "strokeWidth", sourceProps.strokeWidth, {0.0})),
|
|
36
|
+
tappable(convertRawProp(context, rawProps, "tappable", sourceProps.tappable, {false}))
|
|
37
|
+
{}
|
|
26
38
|
RNMapsGoogleMapViewProps::RNMapsGoogleMapViewProps(
|
|
27
39
|
const PropsParserContext &context,
|
|
28
40
|
const RNMapsGoogleMapViewProps &sourceProps,
|
|
@@ -151,6 +163,17 @@ RNMapsMarkerProps::RNMapsMarkerProps(
|
|
|
151
163
|
subtitleVisibility(convertRawProp(context, rawProps, "subtitleVisibility", sourceProps.subtitleVisibility, {RNMapsMarkerSubtitleVisibility::Adaptive})),
|
|
152
164
|
useLegacyPinView(convertRawProp(context, rawProps, "useLegacyPinView", sourceProps.useLegacyPinView, {false}))
|
|
153
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
|
+
{}
|
|
154
177
|
RNMapsPolylineProps::RNMapsPolylineProps(
|
|
155
178
|
const PropsParserContext &context,
|
|
156
179
|
const RNMapsPolylineProps &sourceProps,
|
|
@@ -29,6 +29,42 @@ class RNMapsCalloutProps final : public ViewProps {
|
|
|
29
29
|
bool tooltip{false};
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
+
struct RNMapsCircleCenterStruct {
|
|
33
|
+
double latitude{0.0};
|
|
34
|
+
double longitude{0.0};
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, RNMapsCircleCenterStruct &result) {
|
|
38
|
+
auto map = (std::unordered_map<std::string, RawValue>)value;
|
|
39
|
+
|
|
40
|
+
auto tmp_latitude = map.find("latitude");
|
|
41
|
+
if (tmp_latitude != map.end()) {
|
|
42
|
+
fromRawValue(context, tmp_latitude->second, result.latitude);
|
|
43
|
+
}
|
|
44
|
+
auto tmp_longitude = map.find("longitude");
|
|
45
|
+
if (tmp_longitude != map.end()) {
|
|
46
|
+
fromRawValue(context, tmp_longitude->second, result.longitude);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
static inline std::string toString(const RNMapsCircleCenterStruct &value) {
|
|
51
|
+
return "[Object RNMapsCircleCenterStruct]";
|
|
52
|
+
}
|
|
53
|
+
class RNMapsCircleProps final : public ViewProps {
|
|
54
|
+
public:
|
|
55
|
+
RNMapsCircleProps() = default;
|
|
56
|
+
RNMapsCircleProps(const PropsParserContext& context, const RNMapsCircleProps &sourceProps, const RawProps &rawProps);
|
|
57
|
+
|
|
58
|
+
#pragma mark - Props
|
|
59
|
+
|
|
60
|
+
RNMapsCircleCenterStruct center{};
|
|
61
|
+
SharedColor fillColor{};
|
|
62
|
+
double radius{0.0};
|
|
63
|
+
SharedColor strokeColor{};
|
|
64
|
+
Float strokeWidth{0.0};
|
|
65
|
+
bool tappable{false};
|
|
66
|
+
};
|
|
67
|
+
|
|
32
68
|
enum class RNMapsGoogleMapViewMapType { Hybrid, MutedStandard, None, Satellite, Standard, Terrain, SatelliteFlyover, HybridFlyover };
|
|
33
69
|
|
|
34
70
|
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, RNMapsGoogleMapViewMapType &result) {
|
|
@@ -1056,6 +1092,51 @@ class RNMapsMarkerProps final : public ViewProps {
|
|
|
1056
1092
|
bool useLegacyPinView{false};
|
|
1057
1093
|
};
|
|
1058
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
|
+
|
|
1059
1140
|
enum class RNMapsPolylineLineCap { Butt, Round, Square };
|
|
1060
1141
|
|
|
1061
1142
|
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, RNMapsPolylineLineCap &result) {
|
|
@@ -13,10 +13,12 @@
|
|
|
13
13
|
namespace facebook::react {
|
|
14
14
|
|
|
15
15
|
extern const char RNMapsCalloutComponentName[] = "RNMapsCallout";
|
|
16
|
+
extern const char RNMapsCircleComponentName[] = "RNMapsCircle";
|
|
16
17
|
extern const char RNMapsGoogleMapViewComponentName[] = "RNMapsGoogleMapView";
|
|
17
18
|
extern const char RNMapsGooglePolygonComponentName[] = "RNMapsGooglePolygon";
|
|
18
19
|
extern const char RNMapsMapViewComponentName[] = "RNMapsMapView";
|
|
19
20
|
extern const char RNMapsMarkerComponentName[] = "RNMapsMarker";
|
|
21
|
+
extern const char RNMapsOverlayComponentName[] = "RNMapsOverlay";
|
|
20
22
|
extern const char RNMapsPolylineComponentName[] = "RNMapsPolyline";
|
|
21
23
|
|
|
22
24
|
} // namespace facebook::react
|
|
@@ -29,6 +29,17 @@ using RNMapsCalloutShadowNode = ConcreteViewShadowNode<
|
|
|
29
29
|
RNMapsCalloutEventEmitter,
|
|
30
30
|
RNMapsCalloutState>;
|
|
31
31
|
|
|
32
|
+
JSI_EXPORT extern const char RNMapsCircleComponentName[];
|
|
33
|
+
|
|
34
|
+
/*
|
|
35
|
+
* `ShadowNode` for <RNMapsCircle> component.
|
|
36
|
+
*/
|
|
37
|
+
using RNMapsCircleShadowNode = ConcreteViewShadowNode<
|
|
38
|
+
RNMapsCircleComponentName,
|
|
39
|
+
RNMapsCircleProps,
|
|
40
|
+
RNMapsCircleEventEmitter,
|
|
41
|
+
RNMapsCircleState>;
|
|
42
|
+
|
|
32
43
|
JSI_EXPORT extern const char RNMapsGoogleMapViewComponentName[];
|
|
33
44
|
|
|
34
45
|
/*
|
|
@@ -73,6 +84,17 @@ using RNMapsMarkerShadowNode = ConcreteViewShadowNode<
|
|
|
73
84
|
RNMapsMarkerEventEmitter,
|
|
74
85
|
RNMapsMarkerState>;
|
|
75
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
|
+
|
|
76
98
|
JSI_EXPORT extern const char RNMapsPolylineComponentName[];
|
|
77
99
|
|
|
78
100
|
/*
|
|
@@ -26,6 +26,18 @@ public:
|
|
|
26
26
|
#endif
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
+
class RNMapsCircleState {
|
|
30
|
+
public:
|
|
31
|
+
RNMapsCircleState() = default;
|
|
32
|
+
|
|
33
|
+
#ifdef ANDROID
|
|
34
|
+
RNMapsCircleState(RNMapsCircleState const &previousState, folly::dynamic data){};
|
|
35
|
+
folly::dynamic getDynamic() const {
|
|
36
|
+
return {};
|
|
37
|
+
};
|
|
38
|
+
#endif
|
|
39
|
+
};
|
|
40
|
+
|
|
29
41
|
class RNMapsGoogleMapViewState {
|
|
30
42
|
public:
|
|
31
43
|
RNMapsGoogleMapViewState() = default;
|
|
@@ -74,6 +86,18 @@ public:
|
|
|
74
86
|
#endif
|
|
75
87
|
};
|
|
76
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
|
+
|
|
77
101
|
class RNMapsPolylineState {
|
|
78
102
|
public:
|
|
79
103
|
RNMapsPolylineState() = default;
|
|
@@ -0,0 +1,94 @@
|
|
|
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.ReadableMap;
|
|
8
|
+
import com.facebook.react.module.annotations.ReactModule;
|
|
9
|
+
import com.facebook.react.uimanager.ThemedReactContext;
|
|
10
|
+
import com.facebook.react.uimanager.ViewGroupManager;
|
|
11
|
+
import com.facebook.react.uimanager.ViewManagerDelegate;
|
|
12
|
+
import com.facebook.react.viewmanagers.RNMapsCircleManagerDelegate;
|
|
13
|
+
import com.facebook.react.viewmanagers.RNMapsCircleManagerInterface;
|
|
14
|
+
import com.rnmaps.maps.MapCircle;
|
|
15
|
+
|
|
16
|
+
import java.util.HashMap;
|
|
17
|
+
import java.util.Map;
|
|
18
|
+
|
|
19
|
+
@ReactModule(name = CircleManager.REACT_CLASS)
|
|
20
|
+
public class CircleManager extends ViewGroupManager<MapCircle> implements RNMapsCircleManagerInterface<MapCircle> {
|
|
21
|
+
public CircleManager(ReactApplicationContext context) {
|
|
22
|
+
super(context);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
private final RNMapsCircleManagerDelegate<MapCircle, CircleManager> delegate =
|
|
26
|
+
new RNMapsCircleManagerDelegate<>(this);
|
|
27
|
+
|
|
28
|
+
@Override
|
|
29
|
+
public ViewManagerDelegate<MapCircle> getDelegate() {
|
|
30
|
+
return delegate;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@Override
|
|
34
|
+
public String getName() {
|
|
35
|
+
return REACT_CLASS;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@Override
|
|
39
|
+
public MapCircle createViewInstance(ThemedReactContext context) {
|
|
40
|
+
return new MapCircle(context);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
public static final String REACT_CLASS = "RNMapsCircle";
|
|
45
|
+
|
|
46
|
+
@Nullable
|
|
47
|
+
@Override
|
|
48
|
+
public Map<String, Object> getExportedCustomBubblingEventTypeConstants() {
|
|
49
|
+
return MapCircle.getExportedCustomBubblingEventTypeConstants();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@Nullable
|
|
53
|
+
@Override
|
|
54
|
+
public Map<String, Object> getExportedCustomDirectEventTypeConstants() {
|
|
55
|
+
return new HashMap<>();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
@Override
|
|
61
|
+
public void setZIndex(MapCircle view, float value) {
|
|
62
|
+
view.setZIndex(value);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@Override
|
|
66
|
+
public void setCenter(MapCircle view, @Nullable ReadableMap value) {
|
|
67
|
+
view.setCenter(value);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@Override
|
|
71
|
+
public void setFillColor(MapCircle view, @Nullable Integer value) {
|
|
72
|
+
view.setFillColor(value);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@Override
|
|
76
|
+
public void setRadius(MapCircle view, double value) {
|
|
77
|
+
view.setRadius(value);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@Override
|
|
81
|
+
public void setStrokeColor(MapCircle view, @Nullable Integer value) {
|
|
82
|
+
view.setStrokeColor(value);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@Override
|
|
86
|
+
public void setStrokeWidth(MapCircle view, float value) {
|
|
87
|
+
view.setStrokeWidth(value);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@Override
|
|
91
|
+
public void setTappable(MapCircle view, boolean value) {
|
|
92
|
+
view.setTappable(value);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -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
|
|
|
@@ -321,6 +322,10 @@ public class MapViewManager extends ViewGroupManager<MapView> implements RNMapsM
|
|
|
321
322
|
((MapMarker) child).setImageLoadedListener((uri, drawable, b) -> {
|
|
322
323
|
parent.addFeature(child, parent.getFeatureCount());
|
|
323
324
|
});
|
|
325
|
+
// } else if (child instanceof MapOverlay && ((MapOverlay) child).isLoadingImage()){
|
|
326
|
+
// ((MapOverlay) child).setImageLoadedListener((uri, drawable, b) -> {
|
|
327
|
+
// parent.addFeature(child, parent.getFeatureCount());
|
|
328
|
+
// });
|
|
324
329
|
} else {
|
|
325
330
|
parent.addFeature(child, index);
|
|
326
331
|
}
|