react-native-maps 1.21.0-alpha.50 → 1.21.0-alpha.52
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/build.gradle +2 -2
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsMapViewManagerDelegate.java +199 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsMapViewManagerInterface.java +71 -0
- package/android/src/main/java/com/rnmaps/fabric/MapViewManager.java +345 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnLongPressEvent.java +25 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMapReadyEvent.java +26 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDeselectEvent.java +25 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDragEndEvent.java +25 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDragEvent.java +25 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDragStartEvent.java +25 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerPressEvent.java +25 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerSelectEvent.java +25 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnPoiClickEvent.java +24 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnPressEvent.java +24 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnRegionChangeEvent.java +43 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnUserLocationChangeEvent.java +25 -0
- package/android/src/main/java/com/rnmaps/maps/MapAirModulePackage.java +14 -1
- package/android/src/main/java/com/rnmaps/maps/MapView.java +155 -86
- package/lib/MapView.js +50 -77
- package/lib/specs/NativeComponentMapView.js +1 -3
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
package com.rnmaps.fabric.event;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.WritableMap;
|
|
4
|
+
import com.facebook.react.uimanager.events.Event;
|
|
5
|
+
|
|
6
|
+
public class OnMarkerDeselectEvent extends Event<OnMarkerDeselectEvent> {
|
|
7
|
+
public static final String EVENT_NAME = "topMarkerDeSelect";
|
|
8
|
+
|
|
9
|
+
private final WritableMap payload;
|
|
10
|
+
|
|
11
|
+
public OnMarkerDeselectEvent(int surfaceId, int viewId, WritableMap payload) {
|
|
12
|
+
super(surfaceId, viewId);
|
|
13
|
+
this.payload = payload;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@Override
|
|
17
|
+
public String getEventName() {
|
|
18
|
+
return EVENT_NAME;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@Override
|
|
22
|
+
public WritableMap getEventData() {
|
|
23
|
+
return payload;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
package com.rnmaps.fabric.event;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.WritableMap;
|
|
4
|
+
import com.facebook.react.uimanager.events.Event;
|
|
5
|
+
|
|
6
|
+
public class OnMarkerDragEndEvent extends Event<OnMarkerDragEndEvent> {
|
|
7
|
+
public static final String EVENT_NAME = "topMarkerDragEnd";
|
|
8
|
+
|
|
9
|
+
private final WritableMap payload;
|
|
10
|
+
|
|
11
|
+
public OnMarkerDragEndEvent(int surfaceId, int viewId, WritableMap payload) {
|
|
12
|
+
super(surfaceId, viewId);
|
|
13
|
+
this.payload = payload;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@Override
|
|
17
|
+
public String getEventName() {
|
|
18
|
+
return EVENT_NAME;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@Override
|
|
22
|
+
public WritableMap getEventData() {
|
|
23
|
+
return payload;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
package com.rnmaps.fabric.event;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.WritableMap;
|
|
4
|
+
import com.facebook.react.uimanager.events.Event;
|
|
5
|
+
|
|
6
|
+
public class OnMarkerDragEvent extends Event<OnMarkerDragEvent> {
|
|
7
|
+
public static final String EVENT_NAME = "topMarkerDrag";
|
|
8
|
+
|
|
9
|
+
private final WritableMap payload;
|
|
10
|
+
|
|
11
|
+
public OnMarkerDragEvent(int surfaceId, int viewId, WritableMap payload) {
|
|
12
|
+
super(surfaceId, viewId);
|
|
13
|
+
this.payload = payload;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@Override
|
|
17
|
+
public String getEventName() {
|
|
18
|
+
return EVENT_NAME;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@Override
|
|
22
|
+
public WritableMap getEventData() {
|
|
23
|
+
return payload;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
package com.rnmaps.fabric.event;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.WritableMap;
|
|
4
|
+
import com.facebook.react.uimanager.events.Event;
|
|
5
|
+
|
|
6
|
+
public class OnMarkerDragStartEvent extends Event<OnMarkerDragStartEvent> {
|
|
7
|
+
public static final String EVENT_NAME = "topMarkerDragStart";
|
|
8
|
+
|
|
9
|
+
private final WritableMap payload;
|
|
10
|
+
|
|
11
|
+
public OnMarkerDragStartEvent(int surfaceId, int viewId, WritableMap payload) {
|
|
12
|
+
super(surfaceId, viewId);
|
|
13
|
+
this.payload = payload;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@Override
|
|
17
|
+
public String getEventName() {
|
|
18
|
+
return EVENT_NAME;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@Override
|
|
22
|
+
public WritableMap getEventData() {
|
|
23
|
+
return payload;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
package com.rnmaps.fabric.event;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.WritableMap;
|
|
4
|
+
import com.facebook.react.uimanager.events.Event;
|
|
5
|
+
|
|
6
|
+
public class OnMarkerPressEvent extends Event<OnMarkerPressEvent> {
|
|
7
|
+
public static final String EVENT_NAME = "topMarkerPress";
|
|
8
|
+
|
|
9
|
+
private final WritableMap payload;
|
|
10
|
+
|
|
11
|
+
public OnMarkerPressEvent(int surfaceId, int viewId, WritableMap payload) {
|
|
12
|
+
super(surfaceId, viewId);
|
|
13
|
+
this.payload = payload;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@Override
|
|
17
|
+
public String getEventName() {
|
|
18
|
+
return EVENT_NAME;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@Override
|
|
22
|
+
public WritableMap getEventData() {
|
|
23
|
+
return payload;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
package com.rnmaps.fabric.event;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.WritableMap;
|
|
4
|
+
import com.facebook.react.uimanager.events.Event;
|
|
5
|
+
|
|
6
|
+
public class OnMarkerSelectEvent extends Event<OnMarkerSelectEvent> {
|
|
7
|
+
public static final String EVENT_NAME = "topMarkerSelect";
|
|
8
|
+
|
|
9
|
+
private final WritableMap payload;
|
|
10
|
+
|
|
11
|
+
public OnMarkerSelectEvent(int surfaceId, int viewId, WritableMap payload) {
|
|
12
|
+
super(surfaceId, viewId);
|
|
13
|
+
this.payload = payload;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@Override
|
|
17
|
+
public String getEventName() {
|
|
18
|
+
return EVENT_NAME;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@Override
|
|
22
|
+
public WritableMap getEventData() {
|
|
23
|
+
return payload;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
package com.rnmaps.fabric.event;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.WritableMap;
|
|
4
|
+
import com.facebook.react.uimanager.events.Event;
|
|
5
|
+
|
|
6
|
+
public class OnPoiClickEvent extends Event<OnPoiClickEvent> {
|
|
7
|
+
public static final String EVENT_NAME = "topPoiClick";
|
|
8
|
+
private final WritableMap payload;
|
|
9
|
+
|
|
10
|
+
public OnPoiClickEvent(int surfaceId, int viewId, WritableMap payload) {
|
|
11
|
+
super(surfaceId, viewId);
|
|
12
|
+
this.payload = payload;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@Override
|
|
16
|
+
public String getEventName() {
|
|
17
|
+
return EVENT_NAME;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@Override
|
|
21
|
+
public WritableMap getEventData() {
|
|
22
|
+
return payload;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
package com.rnmaps.fabric.event;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.WritableMap;
|
|
4
|
+
import com.facebook.react.uimanager.events.Event;
|
|
5
|
+
|
|
6
|
+
public class OnPressEvent extends Event<OnPressEvent> {
|
|
7
|
+
public static final String EVENT_NAME = "topPress";
|
|
8
|
+
private final WritableMap payload;
|
|
9
|
+
|
|
10
|
+
public OnPressEvent(int surfaceId, int viewId, WritableMap payload) {
|
|
11
|
+
super(surfaceId, viewId);
|
|
12
|
+
this.payload = payload;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@Override
|
|
16
|
+
public String getEventName() {
|
|
17
|
+
return EVENT_NAME;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@Override
|
|
21
|
+
public WritableMap getEventData() {
|
|
22
|
+
return payload;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
package com.rnmaps.fabric.event;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.WritableMap;
|
|
4
|
+
import com.facebook.react.bridge.WritableNativeMap;
|
|
5
|
+
import com.facebook.react.uimanager.events.Event;
|
|
6
|
+
import com.google.android.gms.maps.model.LatLng;
|
|
7
|
+
import com.google.android.gms.maps.model.LatLngBounds;
|
|
8
|
+
|
|
9
|
+
public class OnRegionChangeEvent extends Event<OnRegionChangeEvent> {
|
|
10
|
+
public static final String EVENT_NAME = "topChange";
|
|
11
|
+
|
|
12
|
+
private final WritableMap payload;
|
|
13
|
+
|
|
14
|
+
public OnRegionChangeEvent(int surfaceId, int viewId, WritableMap payload) {
|
|
15
|
+
super(surfaceId, viewId);
|
|
16
|
+
this.payload = payload;
|
|
17
|
+
}
|
|
18
|
+
public static WritableMap payLoadFor(LatLngBounds bounds, boolean continuous, boolean isGesture){
|
|
19
|
+
|
|
20
|
+
WritableMap event = new WritableNativeMap();
|
|
21
|
+
event.putBoolean("continuous", continuous);
|
|
22
|
+
WritableMap region = new WritableNativeMap();
|
|
23
|
+
LatLng center = bounds.getCenter();
|
|
24
|
+
region.putDouble("latitude", center.latitude);
|
|
25
|
+
region.putDouble("longitude", center.longitude);
|
|
26
|
+
region.putDouble("latitudeDelta", bounds.northeast.latitude - bounds.southwest.latitude);
|
|
27
|
+
region.putDouble("longitudeDelta", bounds.northeast.longitude - bounds.southwest.longitude);
|
|
28
|
+
event.putMap("region", region);
|
|
29
|
+
event.putBoolean("isGesture", isGesture);
|
|
30
|
+
return event;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@Override
|
|
34
|
+
public String getEventName() {
|
|
35
|
+
return EVENT_NAME;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@Override
|
|
39
|
+
public boolean canCoalesce() {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
package com.rnmaps.fabric.event;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.WritableMap;
|
|
4
|
+
import com.facebook.react.uimanager.events.Event;
|
|
5
|
+
|
|
6
|
+
public class OnUserLocationChangeEvent extends Event<OnUserLocationChangeEvent> {
|
|
7
|
+
public static final String EVENT_NAME = "topUserLocationChange";
|
|
8
|
+
|
|
9
|
+
private final WritableMap payload;
|
|
10
|
+
|
|
11
|
+
public OnUserLocationChangeEvent(int surfaceId, int viewId, WritableMap payload) {
|
|
12
|
+
super(surfaceId, viewId);
|
|
13
|
+
this.payload = payload;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@Override
|
|
17
|
+
public String getEventName() {
|
|
18
|
+
return EVENT_NAME;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@Override
|
|
22
|
+
public WritableMap getEventData() {
|
|
23
|
+
return payload;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -7,17 +7,30 @@ import com.facebook.react.bridge.NativeModule;
|
|
|
7
7
|
import com.facebook.react.bridge.ReactApplicationContext;
|
|
8
8
|
import com.facebook.react.module.model.ReactModuleInfo;
|
|
9
9
|
import com.facebook.react.module.model.ReactModuleInfoProvider;
|
|
10
|
+
import com.facebook.react.uimanager.ViewManager;
|
|
11
|
+
import com.rnmaps.fabric.MapViewManager;
|
|
10
12
|
import com.rnmaps.fabric.NativeAirMapsModule;
|
|
11
13
|
import com.facebook.fbreact.specs.NativeAirMapsModuleSpec;
|
|
12
14
|
|
|
15
|
+
import java.util.Collections;
|
|
13
16
|
import java.util.HashMap;
|
|
17
|
+
import java.util.List;
|
|
14
18
|
import java.util.Map;
|
|
15
19
|
|
|
16
20
|
public class MapAirModulePackage extends TurboReactPackage {
|
|
17
21
|
|
|
22
|
+
@Override
|
|
23
|
+
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
|
|
24
|
+
return Collections.singletonList(new MapViewManager(reactContext));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
18
28
|
@Override
|
|
19
29
|
public NativeModule getModule(String name, ReactApplicationContext reactContext) {
|
|
20
|
-
if (
|
|
30
|
+
if (MapViewManager.REACT_CLASS.equals(name)) {
|
|
31
|
+
return new MapViewManager(reactContext);
|
|
32
|
+
}
|
|
33
|
+
if (NativeAirMapsModuleSpec.NAME.equals(name)) {
|
|
21
34
|
return new NativeAirMapsModule(reactContext);
|
|
22
35
|
} else {
|
|
23
36
|
return null;
|