react-native-maps 1.21.0-alpha.74 → 1.21.0-alpha.76
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 +9 -3
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsMapViewManagerDelegate.java +6 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsMapViewManagerInterface.java +2 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/EventEmitters.cpp +9 -9
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/EventEmitters.h +2 -2
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/Props.cpp +1 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/Props.h +1 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/android/gradlew +1 -2
- package/android/src/main/java/com/rnmaps/fabric/MapViewManager.java +10 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnDoublePressEvent.java +27 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnIndoorBuildingFocusedEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnIndoorLevelActivatedEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/maps/MapView.java +25 -13
- package/ios/AirGoogleMaps/AIRGoogleMap.m +6 -6
- package/ios/AirGoogleMaps/RNMapsGoogleMapView.mm +44 -1
- package/ios/AirMaps/RNMapsMapView.mm +6 -1
- package/ios/AirMaps/RNMapsMarkerView.mm +27 -27
- package/ios/generated/RCTAppDependencyProvider.h +0 -25
- package/ios/generated/RCTAppDependencyProvider.mm +0 -55
- package/ios/generated/RCTModulesConformingToProtocolsProvider.h +0 -18
- package/ios/generated/RCTModulesConformingToProtocolsProvider.mm +0 -33
- package/ios/generated/RCTThirdPartyComponentsProvider.h +0 -16
- package/ios/generated/RCTThirdPartyComponentsProvider.mm +0 -26
- package/ios/generated/RNMapsSpecs/EventEmitters.cpp +9 -9
- package/ios/generated/RNMapsSpecs/EventEmitters.h +2 -2
- package/ios/generated/RNMapsSpecs/Props.cpp +1 -0
- package/ios/generated/RNMapsSpecs/Props.h +1 -0
- package/ios/generated/RNMapsSpecs/RCTComponentViewHelpers.h +42 -0
- package/lib/MapCircle.d.ts +1 -1
- package/lib/MapHeatmap.d.ts +2 -2
- package/lib/MapHeatmap.js +1 -1
- package/lib/MapMarker.d.ts +1 -1
- package/lib/MapPolygon.d.ts +1 -1
- package/lib/MapPolyline.d.ts +1 -1
- package/lib/MapView.d.ts +7 -5
- package/lib/MapView.js +16 -2
- package/lib/MapView.types.d.ts +1 -1
- package/lib/createFabricMap.d.ts +1 -0
- package/lib/createFabricMap.js +14 -1
- package/lib/specs/NativeComponentGoogleMapView.d.ts +3 -3
- package/lib/specs/NativeComponentGoogleMapView.js +1 -0
- package/lib/specs/NativeComponentMapView.d.ts +9 -0
- package/lib/specs/NativeComponentMapView.js +1 -0
- package/package.json +20 -20
package/android/build.gradle
CHANGED
|
@@ -3,6 +3,7 @@ def safeExtGet(prop, fallback) {
|
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
buildscript {
|
|
6
|
+
def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : '2.0.21'
|
|
6
7
|
// The Android Gradle plugin is only required when opening the android folder stand-alone.
|
|
7
8
|
// This avoids unnecessary downloads and potential conflicts when the library is included as a
|
|
8
9
|
// module dependency in an application project.
|
|
@@ -13,7 +14,7 @@ buildscript {
|
|
|
13
14
|
}
|
|
14
15
|
dependencies {
|
|
15
16
|
classpath("com.android.tools.build:gradle:8.7.2")
|
|
16
|
-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${
|
|
17
|
+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_version}")
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
20
|
}
|
|
@@ -57,7 +58,7 @@ android {
|
|
|
57
58
|
|
|
58
59
|
defaultConfig {
|
|
59
60
|
minSdkVersion safeExtGet('minSdkVersion', 21)
|
|
60
|
-
targetSdkVersion safeExtGet('targetSdkVersion',
|
|
61
|
+
targetSdkVersion safeExtGet('targetSdkVersion', 35)
|
|
61
62
|
|
|
62
63
|
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
|
|
63
64
|
|
|
@@ -83,6 +84,11 @@ android {
|
|
|
83
84
|
}
|
|
84
85
|
}
|
|
85
86
|
}
|
|
87
|
+
|
|
88
|
+
buildFeatures {
|
|
89
|
+
buildConfig = true
|
|
90
|
+
prefab = true
|
|
91
|
+
}
|
|
86
92
|
}
|
|
87
93
|
|
|
88
94
|
def reactNativeArchitectures() {
|
|
@@ -103,7 +109,7 @@ repositories {
|
|
|
103
109
|
dependencies {
|
|
104
110
|
implementation 'com.facebook.react:react-native:+'
|
|
105
111
|
implementation "com.google.android.gms:play-services-base:${safeExtGet('googlePlayServicesBaseVersion', '18.5.0')}"
|
|
106
|
-
implementation "com.google.android.gms:play-services-maps:${safeExtGet('googlePlayServicesMapsVersion', '19.
|
|
112
|
+
implementation "com.google.android.gms:play-services-maps:${safeExtGet('googlePlayServicesMapsVersion', '19.1.0')}"
|
|
107
113
|
implementation "com.google.android.gms:play-services-location:${safeExtGet('googlePlayServicesLocationVersion', '21.3.0')}"
|
|
108
114
|
implementation 'com.google.maps.android:android-maps-utils:3.10.0'
|
|
109
115
|
implementation "androidx.work:work-runtime:2.9.1"
|
package/android/generated/java/com/facebook/react/viewmanagers/RNMapsMapViewManagerDelegate.java
CHANGED
|
@@ -163,6 +163,9 @@ public class RNMapsMapViewManagerDelegate<T extends View, U extends BaseViewMana
|
|
|
163
163
|
case "zoomEnabled":
|
|
164
164
|
mViewManager.setZoomEnabled(view, value == null ? true : (boolean) value);
|
|
165
165
|
break;
|
|
166
|
+
case "showsTraffic":
|
|
167
|
+
mViewManager.setShowsTraffic(view, value == null ? false : (boolean) value);
|
|
168
|
+
break;
|
|
166
169
|
case "zoomTapEnabled":
|
|
167
170
|
mViewManager.setZoomTapEnabled(view, value == null ? true : (boolean) value);
|
|
168
171
|
break;
|
|
@@ -195,6 +198,9 @@ public class RNMapsMapViewManagerDelegate<T extends View, U extends BaseViewMana
|
|
|
195
198
|
case "fitToCoordinates":
|
|
196
199
|
mViewManager.fitToCoordinates(view, args.getString(0), args.getString(1), args.getBoolean(2));
|
|
197
200
|
break;
|
|
201
|
+
case "setIndoorActiveLevelIndex":
|
|
202
|
+
mViewManager.setIndoorActiveLevelIndex(view, args.getInt(0));
|
|
203
|
+
break;
|
|
198
204
|
}
|
|
199
205
|
}
|
|
200
206
|
}
|
package/android/generated/java/com/facebook/react/viewmanagers/RNMapsMapViewManagerInterface.java
CHANGED
|
@@ -60,6 +60,7 @@ public interface RNMapsMapViewManagerInterface<T extends View> {
|
|
|
60
60
|
void setUserLocationUpdateInterval(T view, int value);
|
|
61
61
|
void setZoomControlEnabled(T view, boolean value);
|
|
62
62
|
void setZoomEnabled(T view, boolean value);
|
|
63
|
+
void setShowsTraffic(T view, boolean value);
|
|
63
64
|
void setZoomTapEnabled(T view, boolean value);
|
|
64
65
|
void setCameraZoomRange(T view, @Nullable ReadableMap value);
|
|
65
66
|
void animateToRegion(T view, String regionJSON, int duration);
|
|
@@ -68,4 +69,5 @@ public interface RNMapsMapViewManagerInterface<T extends View> {
|
|
|
68
69
|
void fitToElements(T view, String edgePaddingJSON, boolean animated);
|
|
69
70
|
void fitToSuppliedMarkers(T view, String markersJSON, String edgePaddingJSON, boolean animated);
|
|
70
71
|
void fitToCoordinates(T view, String coordinatesJSON, String edgePaddingJSON, boolean animated);
|
|
72
|
+
void setIndoorActiveLevelIndex(T view, int activeLevelIndex);
|
|
71
73
|
}
|
|
@@ -39,10 +39,10 @@ void RNMapsGoogleMapViewEventEmitter::onIndoorBuildingFocused(OnIndoorBuildingFo
|
|
|
39
39
|
dispatchEvent("indoorBuildingFocused", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
40
40
|
auto $payload = jsi::Object(runtime);
|
|
41
41
|
{
|
|
42
|
-
auto
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
$payload.setProperty(runtime, "
|
|
42
|
+
auto indoorBuilding = jsi::Object(runtime);
|
|
43
|
+
indoorBuilding.setProperty(runtime, "underground", $event.indoorBuilding.underground);
|
|
44
|
+
indoorBuilding.setProperty(runtime, "activeLevelIndex", $event.indoorBuilding.activeLevelIndex);
|
|
45
|
+
$payload.setProperty(runtime, "indoorBuilding", indoorBuilding);
|
|
46
46
|
}
|
|
47
47
|
return $payload;
|
|
48
48
|
});
|
|
@@ -53,11 +53,11 @@ void RNMapsGoogleMapViewEventEmitter::onIndoorLevelActivated(OnIndoorLevelActiva
|
|
|
53
53
|
dispatchEvent("indoorLevelActivated", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
54
54
|
auto $payload = jsi::Object(runtime);
|
|
55
55
|
{
|
|
56
|
-
auto
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
$payload.setProperty(runtime, "
|
|
56
|
+
auto indoorLevel = jsi::Object(runtime);
|
|
57
|
+
indoorLevel.setProperty(runtime, "activeLevelIndex", $event.indoorLevel.activeLevelIndex);
|
|
58
|
+
indoorLevel.setProperty(runtime, "name", $event.indoorLevel.name);
|
|
59
|
+
indoorLevel.setProperty(runtime, "shortName", $event.indoorLevel.shortName);
|
|
60
|
+
$payload.setProperty(runtime, "indoorLevel", indoorLevel);
|
|
61
61
|
}
|
|
62
62
|
return $payload;
|
|
63
63
|
});
|
|
@@ -45,7 +45,7 @@ class RNMapsGoogleMapViewEventEmitter : public ViewEventEmitter {
|
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
struct OnIndoorBuildingFocused {
|
|
48
|
-
OnIndoorBuildingFocusedIndoorBuilding
|
|
48
|
+
OnIndoorBuildingFocusedIndoorBuilding indoorBuilding;
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
struct OnIndoorLevelActivatedIndoorLevel {
|
|
@@ -55,7 +55,7 @@ class RNMapsGoogleMapViewEventEmitter : public ViewEventEmitter {
|
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
struct OnIndoorLevelActivated {
|
|
58
|
-
OnIndoorLevelActivatedIndoorLevel
|
|
58
|
+
OnIndoorLevelActivatedIndoorLevel indoorLevel;
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
struct OnKmlReady {
|
|
@@ -125,6 +125,7 @@ RNMapsMapViewProps::RNMapsMapViewProps(
|
|
|
125
125
|
userLocationUpdateInterval(convertRawProp(context, rawProps, "userLocationUpdateInterval", sourceProps.userLocationUpdateInterval, {5000})),
|
|
126
126
|
zoomControlEnabled(convertRawProp(context, rawProps, "zoomControlEnabled", sourceProps.zoomControlEnabled, {true})),
|
|
127
127
|
zoomEnabled(convertRawProp(context, rawProps, "zoomEnabled", sourceProps.zoomEnabled, {true})),
|
|
128
|
+
showsTraffic(convertRawProp(context, rawProps, "showsTraffic", sourceProps.showsTraffic, {false})),
|
|
128
129
|
zoomTapEnabled(convertRawProp(context, rawProps, "zoomTapEnabled", sourceProps.zoomTapEnabled, {true})),
|
|
129
130
|
cameraZoomRange(convertRawProp(context, rawProps, "cameraZoomRange", sourceProps.cameraZoomRange, {}))
|
|
130
131
|
{}
|
|
@@ -888,6 +888,7 @@ class RNMapsMapViewProps final : public ViewProps {
|
|
|
888
888
|
int userLocationUpdateInterval{5000};
|
|
889
889
|
bool zoomControlEnabled{true};
|
|
890
890
|
bool zoomEnabled{true};
|
|
891
|
+
bool showsTraffic{false};
|
|
891
892
|
bool zoomTapEnabled{true};
|
|
892
893
|
RNMapsMapViewCameraZoomRangeStruct cameraZoomRange{};
|
|
893
894
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
distributionBase=GRADLE_USER_HOME
|
|
2
2
|
distributionPath=wrapper/dists
|
|
3
|
-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.
|
|
3
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip
|
|
4
4
|
zipStoreBase=GRADLE_USER_HOME
|
|
5
5
|
zipStorePath=wrapper/dists
|
package/android/gradlew
CHANGED
|
@@ -86,8 +86,7 @@ done
|
|
|
86
86
|
# shellcheck disable=SC2034
|
|
87
87
|
APP_BASE_NAME=${0##*/}
|
|
88
88
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
|
89
|
-
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
|
90
|
-
' "$PWD" ) || exit
|
|
89
|
+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
|
91
90
|
|
|
92
91
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
|
93
92
|
MAX_FD=maximum
|
|
@@ -480,6 +480,11 @@ public class MapViewManager extends ViewGroupManager<MapView> implements RNMapsM
|
|
|
480
480
|
view.setZoomEnabled(value);
|
|
481
481
|
}
|
|
482
482
|
|
|
483
|
+
@Override
|
|
484
|
+
public void setShowsTraffic(MapView view, boolean value) {
|
|
485
|
+
view.setShowsTraffic(value);
|
|
486
|
+
}
|
|
487
|
+
|
|
483
488
|
@Override
|
|
484
489
|
public void setZoomTapEnabled(MapView view, boolean value) {
|
|
485
490
|
// not supported
|
|
@@ -585,6 +590,11 @@ public class MapViewManager extends ViewGroupManager<MapView> implements RNMapsM
|
|
|
585
590
|
}
|
|
586
591
|
}
|
|
587
592
|
|
|
593
|
+
@Override
|
|
594
|
+
public void setIndoorActiveLevelIndex(MapView view, int activeLevelIndex) {
|
|
595
|
+
view.setIndoorActiveLevelIndex(activeLevelIndex);
|
|
596
|
+
}
|
|
597
|
+
|
|
588
598
|
@Override
|
|
589
599
|
public void onDropViewInstance(MapView view) {
|
|
590
600
|
super.onDropViewInstance(view);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
package com.rnmaps.fabric.event;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
|
|
5
|
+
import com.facebook.react.bridge.WritableMap;
|
|
6
|
+
import com.facebook.react.uimanager.events.Event;
|
|
7
|
+
|
|
8
|
+
public class OnDoublePressEvent extends Event<OnDoublePressEvent> {
|
|
9
|
+
public static final String EVENT_NAME = "topDoublePress";
|
|
10
|
+
private final WritableMap payload;
|
|
11
|
+
|
|
12
|
+
public OnDoublePressEvent(int surfaceId, int viewId, WritableMap payload) {
|
|
13
|
+
super(surfaceId, viewId);
|
|
14
|
+
this.payload = payload;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@NonNull
|
|
18
|
+
@Override
|
|
19
|
+
public String getEventName() {
|
|
20
|
+
return EVENT_NAME;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@Override
|
|
24
|
+
public WritableMap getEventData() {
|
|
25
|
+
return payload;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
package com.rnmaps.fabric.event;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
|
|
5
|
+
import com.facebook.react.bridge.WritableMap;
|
|
6
|
+
import com.facebook.react.uimanager.events.Event;
|
|
7
|
+
|
|
8
|
+
public class OnIndoorBuildingFocusedEvent extends Event<OnIndoorBuildingFocusedEvent> {
|
|
9
|
+
public static final String EVENT_NAME = "topIndoorBuildingFocused";
|
|
10
|
+
|
|
11
|
+
private final WritableMap payload;
|
|
12
|
+
|
|
13
|
+
public OnIndoorBuildingFocusedEvent(int surfaceId, int viewId, WritableMap payload) {
|
|
14
|
+
super(surfaceId, viewId);
|
|
15
|
+
this.payload = payload;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@NonNull
|
|
19
|
+
@Override
|
|
20
|
+
public String getEventName() {
|
|
21
|
+
return EVENT_NAME;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@Override
|
|
25
|
+
public WritableMap getEventData() {
|
|
26
|
+
return payload;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
package com.rnmaps.fabric.event;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
|
|
5
|
+
import com.facebook.react.bridge.WritableMap;
|
|
6
|
+
import com.facebook.react.uimanager.events.Event;
|
|
7
|
+
|
|
8
|
+
public class OnIndoorLevelActivatedEvent extends Event<OnIndoorLevelActivatedEvent> {
|
|
9
|
+
public static final String EVENT_NAME = "topIndoorLevelActivated";
|
|
10
|
+
|
|
11
|
+
private final WritableMap payload;
|
|
12
|
+
|
|
13
|
+
public OnIndoorLevelActivatedEvent(int surfaceId, int viewId, WritableMap payload) {
|
|
14
|
+
super(surfaceId, viewId);
|
|
15
|
+
this.payload = payload;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@NonNull
|
|
19
|
+
@Override
|
|
20
|
+
public String getEventName() {
|
|
21
|
+
return EVENT_NAME;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@Override
|
|
25
|
+
public WritableMap getEventData() {
|
|
26
|
+
return payload;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -111,6 +111,9 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
|
|
|
111
111
|
private CameraUpdate cameraToSet;
|
|
112
112
|
private boolean setPaddingDeferred = false;
|
|
113
113
|
private boolean showUserLocation = false;
|
|
114
|
+
|
|
115
|
+
private boolean showsTraffic = false;
|
|
116
|
+
|
|
114
117
|
private boolean handlePanDrag = false;
|
|
115
118
|
private boolean moveOnMarkerPress = true;
|
|
116
119
|
private boolean cacheEnabled = false;
|
|
@@ -332,6 +335,13 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
332
335
|
return null;
|
|
333
336
|
}
|
|
334
337
|
|
|
338
|
+
public void setShowsTraffic(boolean value) {
|
|
339
|
+
showsTraffic = value;
|
|
340
|
+
if (map != null){
|
|
341
|
+
map.setTrafficEnabled(value);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
335
345
|
|
|
336
346
|
@FunctionalInterface
|
|
337
347
|
public interface EventCreator<T extends Event> {
|
|
@@ -576,6 +586,8 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
576
586
|
});
|
|
577
587
|
|
|
578
588
|
|
|
589
|
+
map.setTrafficEnabled(showsTraffic);
|
|
590
|
+
|
|
579
591
|
|
|
580
592
|
isMapReady = true;
|
|
581
593
|
if (kmlSrc != null){
|
|
@@ -635,8 +647,8 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
635
647
|
builder.put(OnMarkerDragEndEvent.EVENT_NAME, MapBuilder.of("registrationName", OnMarkerDragEndEvent.EVENT_NAME));
|
|
636
648
|
builder.put(OnPoiClickEvent.EVENT_NAME, MapBuilder.of("registrationName", OnPoiClickEvent.EVENT_NAME));
|
|
637
649
|
builder.put(OnLongPressEvent.EVENT_NAME, MapBuilder.of("registrationName", OnLongPressEvent.EVENT_NAME));
|
|
638
|
-
builder.put(
|
|
639
|
-
builder.put(
|
|
650
|
+
builder.put(OnRegionChangeStartEvent.EVENT_NAME, MapBuilder.of("registrationName", OnRegionChangeStartEvent.EVENT_NAME));
|
|
651
|
+
builder.put(OnDoublePressEvent.EVENT_NAME, MapBuilder.of("registrationName", OnDoublePressEvent.EVENT_NAME));
|
|
640
652
|
return builder.build();
|
|
641
653
|
}
|
|
642
654
|
|
|
@@ -644,7 +656,9 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
644
656
|
return MapBuilder.of(
|
|
645
657
|
OnMapReadyEvent.EVENT_NAME, MapBuilder.of("registrationName", OnMapReadyEvent.EVENT_NAME),
|
|
646
658
|
OnUserLocationChangeEvent.EVENT_NAME, MapBuilder.of("registrationName", OnUserLocationChangeEvent.EVENT_NAME),
|
|
647
|
-
OnRegionChangeEvent.EVENT_NAME, MapBuilder.of("registrationName", OnRegionChangeEvent.EVENT_NAME)
|
|
659
|
+
OnRegionChangeEvent.EVENT_NAME, MapBuilder.of("registrationName", OnRegionChangeEvent.EVENT_NAME),
|
|
660
|
+
OnIndoorBuildingFocusedEvent.EVENT_NAME, MapBuilder.of("registrationName", OnIndoorBuildingFocusedEvent.EVENT_NAME),
|
|
661
|
+
OnIndoorLevelActivatedEvent.EVENT_NAME, MapBuilder.of("registrationName", OnIndoorLevelActivatedEvent.EVENT_NAME)
|
|
648
662
|
);
|
|
649
663
|
}
|
|
650
664
|
|
|
@@ -1603,7 +1617,8 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
1603
1617
|
LatLng coords = this.map.getProjection().fromScreenLocation(point);
|
|
1604
1618
|
WritableMap event = makeClickEventData(coords);
|
|
1605
1619
|
// todo: use Fabric events
|
|
1606
|
-
|
|
1620
|
+
dispatchEvent(event, OnDoublePressEvent::new);
|
|
1621
|
+
|
|
1607
1622
|
}
|
|
1608
1623
|
|
|
1609
1624
|
public void setKmlSrc(String kmlSrc) {
|
|
@@ -1728,9 +1743,8 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
1728
1743
|
indoorBuilding.putInt("activeLevelIndex", building.getActiveLevelIndex());
|
|
1729
1744
|
indoorBuilding.putBoolean("underground", building.isUnderground());
|
|
1730
1745
|
|
|
1731
|
-
event.putMap("
|
|
1732
|
-
|
|
1733
|
-
// manager.pushEvent(context, this, "onIndoorBuildingFocused", event);
|
|
1746
|
+
event.putMap("indoorBuilding", indoorBuilding);
|
|
1747
|
+
dispatchEvent(event, OnIndoorBuildingFocusedEvent::new);
|
|
1734
1748
|
} else {
|
|
1735
1749
|
WritableMap event = Arguments.createMap();
|
|
1736
1750
|
WritableArray levelsArray = Arguments.createArray();
|
|
@@ -1739,9 +1753,8 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
1739
1753
|
indoorBuilding.putInt("activeLevelIndex", 0);
|
|
1740
1754
|
indoorBuilding.putBoolean("underground", false);
|
|
1741
1755
|
|
|
1742
|
-
event.putMap("
|
|
1743
|
-
|
|
1744
|
-
// manager.pushEvent(context, this, "onIndoorBuildingFocused", event);
|
|
1756
|
+
event.putMap("indoorBuilding", indoorBuilding);
|
|
1757
|
+
dispatchEvent(event, OnIndoorBuildingFocusedEvent::new);
|
|
1745
1758
|
}
|
|
1746
1759
|
}
|
|
1747
1760
|
|
|
@@ -1763,9 +1776,8 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
1763
1776
|
indoorlevel.putString("name", level.getName());
|
|
1764
1777
|
indoorlevel.putString("shortName", level.getShortName());
|
|
1765
1778
|
|
|
1766
|
-
event.putMap("
|
|
1767
|
-
|
|
1768
|
-
// manager.pushEvent(context, this, "onIndoorLevelActivated", event);
|
|
1779
|
+
event.putMap("indoorLevel", indoorlevel);
|
|
1780
|
+
dispatchEvent(event, OnIndoorLevelActivatedEvent::new);
|
|
1769
1781
|
}
|
|
1770
1782
|
|
|
1771
1783
|
public void setIndoorActiveLevelIndex(int activeLevelIndex) {
|
|
@@ -246,7 +246,7 @@ id regionAsJSON(MKCoordinateRegion region) {
|
|
|
246
246
|
AIRGoogleMapPolygon *polygon = (AIRGoogleMapPolygon*)subview;
|
|
247
247
|
[polygon didInsertInMap:self];
|
|
248
248
|
[self.polygons addObject:polygon];
|
|
249
|
-
|
|
249
|
+
|
|
250
250
|
} else if ([NSStringFromClass([subview class]) isEqualToString:@"RNMapsGooglePolygonView"]){
|
|
251
251
|
// RNMapsGooglePolygonView *polygon = (RNMapsGooglePolygonView*)subview;
|
|
252
252
|
// [polygon didInsertInMap:self];
|
|
@@ -1144,7 +1144,7 @@ id regionAsJSON(MKCoordinateRegion region) {
|
|
|
1144
1144
|
[self setKMLData:[NSData dataWithContentsOfURL:url]];
|
|
1145
1145
|
} else {
|
|
1146
1146
|
__weak AIRGoogleMap *weakSelf = self;
|
|
1147
|
-
|
|
1147
|
+
|
|
1148
1148
|
NSURLSession *session = [NSURLSession sharedSession];
|
|
1149
1149
|
NSURLSessionDataTask *dataTask = [session dataTaskWithURL:url
|
|
1150
1150
|
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
|
|
@@ -1162,7 +1162,7 @@ id regionAsJSON(MKCoordinateRegion region) {
|
|
|
1162
1162
|
[dataTask resume];
|
|
1163
1163
|
}
|
|
1164
1164
|
|
|
1165
|
-
|
|
1165
|
+
|
|
1166
1166
|
}
|
|
1167
1167
|
|
|
1168
1168
|
|
|
@@ -1172,7 +1172,7 @@ id regionAsJSON(MKCoordinateRegion region) {
|
|
|
1172
1172
|
return;
|
|
1173
1173
|
}
|
|
1174
1174
|
self.onIndoorBuildingFocused(@{
|
|
1175
|
-
@"
|
|
1175
|
+
@"indoorBuilding": @{
|
|
1176
1176
|
@"activeLevelIndex": @0,
|
|
1177
1177
|
@"underground": @false,
|
|
1178
1178
|
@"levels": [[NSMutableArray alloc]init]
|
|
@@ -1193,7 +1193,7 @@ id regionAsJSON(MKCoordinateRegion region) {
|
|
|
1193
1193
|
return;
|
|
1194
1194
|
}
|
|
1195
1195
|
self.onIndoorBuildingFocused(@{
|
|
1196
|
-
@"
|
|
1196
|
+
@"indoorBuilding": @{
|
|
1197
1197
|
@"activeLevelIndex": @(building.defaultLevelIndex),
|
|
1198
1198
|
@"underground": @(building.underground),
|
|
1199
1199
|
@"levels": arrayLevels
|
|
@@ -1213,7 +1213,7 @@ id regionAsJSON(MKCoordinateRegion region) {
|
|
|
1213
1213
|
i++;
|
|
1214
1214
|
}
|
|
1215
1215
|
self.onIndoorLevelActivated(@{
|
|
1216
|
-
@"
|
|
1216
|
+
@"indoorLevel": @{
|
|
1217
1217
|
@"activeLevelIndex": @(i),
|
|
1218
1218
|
@"name": level.name,
|
|
1219
1219
|
@"shortName": level.shortName
|
|
@@ -86,6 +86,16 @@ using namespace facebook::react;
|
|
|
86
86
|
|
|
87
87
|
[_view fitToCoordinates:coordinatesArray withEdgePadding:edgePadding animated:animated];
|
|
88
88
|
}
|
|
89
|
+
- (void) setIndoorActiveLevelIndex:(NSInteger)activeLevelIndex
|
|
90
|
+
{
|
|
91
|
+
if (!_view.indoorDisplay) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if ( activeLevelIndex < [_view.indoorDisplay.activeBuilding.levels count]) {
|
|
95
|
+
_view.indoorDisplay.activeLevel = _view.indoorDisplay.activeBuilding.levels[activeLevelIndex];
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
}
|
|
89
99
|
|
|
90
100
|
#pragma mark - Native commands
|
|
91
101
|
|
|
@@ -185,6 +195,39 @@ using namespace facebook::react;
|
|
|
185
195
|
}
|
|
186
196
|
};
|
|
187
197
|
|
|
198
|
+
_view.onIndoorLevelActivated = [self](NSDictionary* dictionary) {
|
|
199
|
+
if (_eventEmitter) {
|
|
200
|
+
auto mapViewEventEmitter = std::static_pointer_cast<RNMapsGoogleMapViewEventEmitter const>(_eventEmitter);
|
|
201
|
+
|
|
202
|
+
facebook::react::RNMapsGoogleMapViewEventEmitter::OnIndoorLevelActivatedIndoorLevel level = {
|
|
203
|
+
.activeLevelIndex= (int) [dictionary[@"activeLevelIndex"] integerValue],
|
|
204
|
+
.name = [dictionary[@"name"] UTF8String],
|
|
205
|
+
.shortName = [dictionary[@"shortName"] UTF8String],
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
facebook::react::RNMapsGoogleMapViewEventEmitter::OnIndoorLevelActivated data = {
|
|
209
|
+
.indoorLevel = level,
|
|
210
|
+
};
|
|
211
|
+
mapViewEventEmitter->onIndoorLevelActivated(data);
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
_view.onIndoorBuildingFocused = [self](NSDictionary* dictionary) {
|
|
216
|
+
if (_eventEmitter) {
|
|
217
|
+
auto mapViewEventEmitter = std::static_pointer_cast<RNMapsGoogleMapViewEventEmitter const>(_eventEmitter);
|
|
218
|
+
|
|
219
|
+
facebook::react::RNMapsGoogleMapViewEventEmitter::OnIndoorBuildingFocusedIndoorBuilding indoorBuilding = {
|
|
220
|
+
.underground = [dictionary[@"underground"] boolValue],
|
|
221
|
+
.activeLevelIndex = (int) [dictionary[@"activeLevelIndex"] integerValue]
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
facebook::react::RNMapsGoogleMapViewEventEmitter::OnIndoorBuildingFocused data = {
|
|
225
|
+
.indoorBuilding = indoorBuilding
|
|
226
|
+
};
|
|
227
|
+
mapViewEventEmitter->onIndoorBuildingFocused(data);
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
|
|
188
231
|
_view.onMapLoaded = [self](NSDictionary* dictionary) {
|
|
189
232
|
if (_eventEmitter) {
|
|
190
233
|
auto mapViewEventEmitter = std::static_pointer_cast<RNMapsGoogleMapViewEventEmitter const>(_eventEmitter);
|
|
@@ -274,7 +317,7 @@ using namespace facebook::react;
|
|
|
274
317
|
mapViewEventEmitter->onUserLocationChange(data);
|
|
275
318
|
}
|
|
276
319
|
};
|
|
277
|
-
|
|
320
|
+
|
|
278
321
|
_view.onPoiClick = [self](NSDictionary* dictionary) {
|
|
279
322
|
if (_eventEmitter) {
|
|
280
323
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
//
|
|
8
8
|
|
|
9
9
|
#import "RNMapsMapView.h"
|
|
10
|
-
#import "
|
|
10
|
+
#import "AIRMap.h"
|
|
11
11
|
#import "AIRMapMarker.h"
|
|
12
12
|
#import "AIRMapManager.h"
|
|
13
13
|
#import "RNMapsMarkerView.h"
|
|
@@ -92,6 +92,11 @@ using namespace facebook::react;
|
|
|
92
92
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
+
- (void) setIndoorActiveLevelIndex:(NSInteger) activeLevelIndex
|
|
96
|
+
{
|
|
97
|
+
// do nothing (google only)
|
|
98
|
+
}
|
|
99
|
+
|
|
95
100
|
#pragma mark - Native commands
|
|
96
101
|
|
|
97
102
|
- (void)handleCommand:(const NSString *)commandName args:(const NSArray *)args
|