react-native-maps 1.19.1 → 1.20.0
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.
|
@@ -288,6 +288,11 @@ public class MapManager extends ViewGroupManager<MapView> {
|
|
|
288
288
|
view.setCacheEnabled(cacheEnabled);
|
|
289
289
|
}
|
|
290
290
|
|
|
291
|
+
@ReactProp(name = "poiClickEnabled", defaultBoolean = true)
|
|
292
|
+
public void setPoiClickEnabled(MapView view, boolean poiClickEnabled) {
|
|
293
|
+
view.setPoiClickEnabled(poiClickEnabled);
|
|
294
|
+
}
|
|
295
|
+
|
|
291
296
|
@ReactProp(name = "loadingEnabled", defaultBoolean = false)
|
|
292
297
|
public void setLoadingEnabled(MapView view, boolean loadingEnabled) {
|
|
293
298
|
view.enableMapLoading(loadingEnabled);
|
|
@@ -104,6 +104,8 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
|
|
|
104
104
|
private boolean handlePanDrag = false;
|
|
105
105
|
private boolean moveOnMarkerPress = true;
|
|
106
106
|
private boolean cacheEnabled = false;
|
|
107
|
+
private boolean poiClickEnabled = true;
|
|
108
|
+
|
|
107
109
|
private ReadableMap initialRegion;
|
|
108
110
|
private ReadableMap region;
|
|
109
111
|
private ReadableMap initialCamera;
|
|
@@ -252,7 +254,6 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
|
|
|
252
254
|
|
|
253
255
|
markerCollection.setInfoWindowAdapter(this);
|
|
254
256
|
markerCollection.setOnMarkerDragListener(this);
|
|
255
|
-
this.map.setOnPoiClickListener(this);
|
|
256
257
|
this.map.setOnIndoorStateChangeListener(this);
|
|
257
258
|
|
|
258
259
|
applyBridgedProps();
|
|
@@ -565,6 +566,7 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
|
|
|
565
566
|
if(customMapStyleString != null) {
|
|
566
567
|
map.setMapStyle(new MapStyleOptions(customMapStyleString));
|
|
567
568
|
}
|
|
569
|
+
this.setPoiClickEnabled(poiClickEnabled);
|
|
568
570
|
}
|
|
569
571
|
|
|
570
572
|
private void moveToRegion(ReadableMap region) {
|
|
@@ -683,6 +685,11 @@ public static CameraPosition cameraPositionFromMap(ReadableMap camera){
|
|
|
683
685
|
this.cacheView();
|
|
684
686
|
}
|
|
685
687
|
|
|
688
|
+
public void setPoiClickEnabled(boolean poiClickEnabled) {
|
|
689
|
+
this.poiClickEnabled = poiClickEnabled;
|
|
690
|
+
map.setOnPoiClickListener(poiClickEnabled ? this : null);
|
|
691
|
+
}
|
|
692
|
+
|
|
686
693
|
public void enableMapLoading(boolean loadingEnabled) {
|
|
687
694
|
if (loadingEnabled && !this.isMapLoaded) {
|
|
688
695
|
this.getMapLoadingLayoutView().setVisibility(View.VISIBLE);
|
|
@@ -1508,4 +1515,5 @@ public static CameraPosition cameraPositionFromMap(ReadableMap camera){
|
|
|
1508
1515
|
layout(getLeft(), getTop(), getRight(), getBottom());
|
|
1509
1516
|
}
|
|
1510
1517
|
};
|
|
1518
|
+
|
|
1511
1519
|
}
|
package/lib/MapView.d.ts
CHANGED
|
@@ -48,6 +48,15 @@ export type MapViewProps = ViewProps & {
|
|
|
48
48
|
* @platform Android: Not supported
|
|
49
49
|
*/
|
|
50
50
|
followsUserLocation?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* If `false` the map will not capture PoI clicks
|
|
53
|
+
* This can improve click handling on the map for android
|
|
54
|
+
*
|
|
55
|
+
* @default true
|
|
56
|
+
* @platform iOS: Not supported
|
|
57
|
+
* @platform Android: supported
|
|
58
|
+
*/
|
|
59
|
+
poiClickEnabled?: boolean;
|
|
51
60
|
/**
|
|
52
61
|
* The initial camera view the map should use. Use this prop instead of `camera`
|
|
53
62
|
* only if you don't want to control the camera of the map besides the initial view.
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"author": "Leland Richardson <leland.m.richardson@gmail.com>",
|
|
7
7
|
"homepage": "https://github.com/react-native-maps/react-native-maps#readme",
|
|
8
|
-
"version": "1.
|
|
8
|
+
"version": "1.20.0",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"lint": "eslint . --max-warnings 0",
|