react-native-maps 1.6.1-beta.1 → 1.7.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.
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/rnmaps/maps/MapCircle.java +7 -5
- package/android/src/main/java/com/rnmaps/maps/MapFeature.java +2 -3
- package/android/src/main/java/com/rnmaps/maps/MapGradientPolyline.java +4 -5
- package/android/src/main/java/com/rnmaps/maps/MapHeatmap.java +3 -4
- package/android/src/main/java/com/rnmaps/maps/MapLocalTile.java +3 -3
- package/android/src/main/java/com/rnmaps/maps/MapMarker.java +7 -5
- package/android/src/main/java/com/rnmaps/maps/MapOverlay.java +16 -14
- package/android/src/main/java/com/rnmaps/maps/MapPolygon.java +7 -5
- package/android/src/main/java/com/rnmaps/maps/MapPolyline.java +7 -5
- package/android/src/main/java/com/rnmaps/maps/MapUrlTile.java +3 -3
- package/android/src/main/java/com/rnmaps/maps/MapView.java +48 -25
- package/package.json +3 -3
package/android/build.gradle
CHANGED
|
@@ -47,6 +47,6 @@ dependencies {
|
|
|
47
47
|
implementation "com.google.android.gms:play-services-base:${safeExtGet('playServicesVersion', '18.1.0')}"
|
|
48
48
|
implementation "com.google.android.gms:play-services-maps:${safeExtGet('playServicesVersion', '18.0.2')}"
|
|
49
49
|
implementation "com.google.android.gms:play-services-location:20.0.0"
|
|
50
|
-
implementation 'com.google.maps.android:android-maps-utils:0
|
|
50
|
+
implementation 'com.google.maps.android:android-maps-utils:3.4.0'
|
|
51
51
|
implementation "androidx.work:work-runtime:2.7.1"
|
|
52
52
|
}
|
|
@@ -2,10 +2,10 @@ package com.rnmaps.maps;
|
|
|
2
2
|
|
|
3
3
|
import android.content.Context;
|
|
4
4
|
|
|
5
|
-
import com.google.android.gms.maps.GoogleMap;
|
|
6
5
|
import com.google.android.gms.maps.model.Circle;
|
|
7
6
|
import com.google.android.gms.maps.model.CircleOptions;
|
|
8
7
|
import com.google.android.gms.maps.model.LatLng;
|
|
8
|
+
import com.google.maps.android.collections.CircleManager;
|
|
9
9
|
|
|
10
10
|
public class MapCircle extends MapFeature {
|
|
11
11
|
|
|
@@ -89,12 +89,14 @@ public class MapCircle extends MapFeature {
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
@Override
|
|
92
|
-
public void addToMap(
|
|
93
|
-
|
|
92
|
+
public void addToMap(Object collection) {
|
|
93
|
+
CircleManager.Collection circleCollection = (CircleManager.Collection) collection;
|
|
94
|
+
circle = circleCollection.addCircle(getCircleOptions());
|
|
94
95
|
}
|
|
95
96
|
|
|
96
97
|
@Override
|
|
97
|
-
public void removeFromMap(
|
|
98
|
-
|
|
98
|
+
public void removeFromMap(Object collection) {
|
|
99
|
+
CircleManager.Collection circleCollection = (CircleManager.Collection) collection;
|
|
100
|
+
circleCollection.remove(circle);
|
|
99
101
|
}
|
|
100
102
|
}
|
|
@@ -3,16 +3,15 @@ package com.rnmaps.maps;
|
|
|
3
3
|
import android.content.Context;
|
|
4
4
|
|
|
5
5
|
import com.facebook.react.views.view.ReactViewGroup;
|
|
6
|
-
import com.google.android.gms.maps.GoogleMap;
|
|
7
6
|
|
|
8
7
|
public abstract class MapFeature extends ReactViewGroup {
|
|
9
8
|
public MapFeature(Context context) {
|
|
10
9
|
super(context);
|
|
11
10
|
}
|
|
12
11
|
|
|
13
|
-
public abstract void addToMap(
|
|
12
|
+
public abstract void addToMap(Object mapOrCollection);
|
|
14
13
|
|
|
15
|
-
public abstract void removeFromMap(
|
|
14
|
+
public abstract void removeFromMap(Object mapOrCollection);
|
|
16
15
|
|
|
17
16
|
public abstract Object getFeature();
|
|
18
17
|
}
|
|
@@ -321,14 +321,13 @@ public class MapGradientPolyline extends MapFeature {
|
|
|
321
321
|
}
|
|
322
322
|
|
|
323
323
|
@Override
|
|
324
|
-
public void addToMap(
|
|
325
|
-
|
|
326
|
-
this.
|
|
327
|
-
this.tileOverlay = map.addTileOverlay(createTileOverlayOptions());
|
|
324
|
+
public void addToMap(Object map) {
|
|
325
|
+
this.map = (GoogleMap) map;
|
|
326
|
+
this.tileOverlay = this.map.addTileOverlay(createTileOverlayOptions());
|
|
328
327
|
}
|
|
329
328
|
|
|
330
329
|
@Override
|
|
331
|
-
public void removeFromMap(
|
|
330
|
+
public void removeFromMap(Object map) {
|
|
332
331
|
tileOverlay.remove();
|
|
333
332
|
}
|
|
334
333
|
|
|
@@ -101,13 +101,12 @@ public class MapHeatmap extends MapFeature {
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
@Override
|
|
104
|
-
public void addToMap(
|
|
105
|
-
|
|
106
|
-
heatmap = map.addTileOverlay(getHeatmapOptions());
|
|
104
|
+
public void addToMap(Object map) {
|
|
105
|
+
heatmap = ((GoogleMap) map).addTileOverlay(getHeatmapOptions());
|
|
107
106
|
}
|
|
108
107
|
|
|
109
108
|
@Override
|
|
110
|
-
public void removeFromMap(
|
|
109
|
+
public void removeFromMap(Object map) {
|
|
111
110
|
heatmap.remove();
|
|
112
111
|
}
|
|
113
112
|
|
|
@@ -140,12 +140,12 @@ public class MapLocalTile extends MapFeature {
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
@Override
|
|
143
|
-
public void addToMap(
|
|
144
|
-
this.tileOverlay = map.addTileOverlay(getTileOverlayOptions());
|
|
143
|
+
public void addToMap(Object map) {
|
|
144
|
+
this.tileOverlay = ((GoogleMap) map).addTileOverlay(getTileOverlayOptions());
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
@Override
|
|
148
|
-
public void removeFromMap(
|
|
148
|
+
public void removeFromMap(Object map) {
|
|
149
149
|
tileOverlay.remove();
|
|
150
150
|
}
|
|
151
151
|
}
|
|
@@ -33,12 +33,12 @@ import com.facebook.imagepipeline.image.ImageInfo;
|
|
|
33
33
|
import com.facebook.imagepipeline.request.ImageRequest;
|
|
34
34
|
import com.facebook.imagepipeline.request.ImageRequestBuilder;
|
|
35
35
|
import com.facebook.react.bridge.ReadableMap;
|
|
36
|
-
import com.google.android.gms.maps.GoogleMap;
|
|
37
36
|
import com.google.android.gms.maps.model.BitmapDescriptor;
|
|
38
37
|
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
|
|
39
38
|
import com.google.android.gms.maps.model.LatLng;
|
|
40
39
|
import com.google.android.gms.maps.model.Marker;
|
|
41
40
|
import com.google.android.gms.maps.model.MarkerOptions;
|
|
41
|
+
import com.google.maps.android.collections.MarkerManager;
|
|
42
42
|
|
|
43
43
|
public class MapMarker extends MapFeature {
|
|
44
44
|
|
|
@@ -427,17 +427,19 @@ public class MapMarker extends MapFeature {
|
|
|
427
427
|
}
|
|
428
428
|
|
|
429
429
|
@Override
|
|
430
|
-
public void addToMap(
|
|
431
|
-
|
|
430
|
+
public void addToMap(Object collection) {
|
|
431
|
+
MarkerManager.Collection markerCollection = (MarkerManager.Collection) collection;
|
|
432
|
+
marker = markerCollection.addMarker(getMarkerOptions());
|
|
432
433
|
updateTracksViewChanges();
|
|
433
434
|
}
|
|
434
435
|
|
|
435
436
|
@Override
|
|
436
|
-
public void removeFromMap(
|
|
437
|
+
public void removeFromMap(Object collection) {
|
|
437
438
|
if (marker == null) {
|
|
438
439
|
return;
|
|
439
440
|
}
|
|
440
|
-
|
|
441
|
+
MarkerManager.Collection markerCollection = (MarkerManager.Collection) collection;
|
|
442
|
+
markerCollection.remove(marker);
|
|
441
443
|
marker = null;
|
|
442
444
|
updateTracksViewChanges();
|
|
443
445
|
}
|
|
@@ -4,13 +4,13 @@ import android.content.Context;
|
|
|
4
4
|
import android.graphics.Bitmap;
|
|
5
5
|
|
|
6
6
|
import com.facebook.react.bridge.ReadableArray;
|
|
7
|
-
import com.google.android.gms.maps.GoogleMap;
|
|
8
7
|
import com.google.android.gms.maps.model.BitmapDescriptor;
|
|
9
8
|
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
|
|
10
9
|
import com.google.android.gms.maps.model.GroundOverlay;
|
|
11
10
|
import com.google.android.gms.maps.model.GroundOverlayOptions;
|
|
12
11
|
import com.google.android.gms.maps.model.LatLng;
|
|
13
12
|
import com.google.android.gms.maps.model.LatLngBounds;
|
|
13
|
+
import com.google.maps.android.collections.GroundOverlayManager;
|
|
14
14
|
|
|
15
15
|
public class MapOverlay extends MapFeature implements ImageReadable {
|
|
16
16
|
|
|
@@ -24,7 +24,7 @@ public class MapOverlay extends MapFeature implements ImageReadable {
|
|
|
24
24
|
private float transparency;
|
|
25
25
|
|
|
26
26
|
private final ImageReader mImageReader;
|
|
27
|
-
private
|
|
27
|
+
private GroundOverlayManager.Collection groundOverlayCollection;
|
|
28
28
|
|
|
29
29
|
public MapOverlay(Context context) {
|
|
30
30
|
super(context);
|
|
@@ -107,24 +107,26 @@ public class MapOverlay extends MapFeature implements ImageReadable {
|
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
@Override
|
|
110
|
-
public void addToMap(
|
|
110
|
+
public void addToMap(Object collection) {
|
|
111
|
+
GroundOverlayManager.Collection groundOverlayCollection = (GroundOverlayManager.Collection) collection;
|
|
111
112
|
GroundOverlayOptions groundOverlayOptions = getGroundOverlayOptions();
|
|
112
113
|
if (groundOverlayOptions != null) {
|
|
113
|
-
|
|
114
|
-
|
|
114
|
+
groundOverlay = groundOverlayCollection.addGroundOverlay(groundOverlayOptions);
|
|
115
|
+
groundOverlay.setClickable(this.tappable);
|
|
115
116
|
} else {
|
|
116
|
-
this.
|
|
117
|
+
this.groundOverlayCollection = groundOverlayCollection;
|
|
117
118
|
}
|
|
118
119
|
}
|
|
119
120
|
|
|
120
121
|
@Override
|
|
121
|
-
public void removeFromMap(
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
122
|
+
public void removeFromMap(Object collection) {
|
|
123
|
+
if (groundOverlay != null) {
|
|
124
|
+
GroundOverlayManager.Collection groundOverlayCollection = (GroundOverlayManager.Collection) collection;
|
|
125
|
+
groundOverlayCollection.remove(groundOverlay);
|
|
126
|
+
groundOverlay = null;
|
|
127
|
+
groundOverlayOptions = null;
|
|
127
128
|
}
|
|
129
|
+
groundOverlayCollection = null;
|
|
128
130
|
}
|
|
129
131
|
|
|
130
132
|
@Override
|
|
@@ -152,12 +154,12 @@ public class MapOverlay extends MapFeature implements ImageReadable {
|
|
|
152
154
|
if (this.groundOverlay != null) {
|
|
153
155
|
return this.groundOverlay;
|
|
154
156
|
}
|
|
155
|
-
if (this.
|
|
157
|
+
if (this.groundOverlayCollection == null) {
|
|
156
158
|
return null;
|
|
157
159
|
}
|
|
158
160
|
GroundOverlayOptions groundOverlayOptions = getGroundOverlayOptions();
|
|
159
161
|
if (groundOverlayOptions != null) {
|
|
160
|
-
return this.
|
|
162
|
+
return this.groundOverlayCollection.addGroundOverlay(groundOverlayOptions);
|
|
161
163
|
}
|
|
162
164
|
return null;
|
|
163
165
|
}
|
|
@@ -4,10 +4,10 @@ import android.content.Context;
|
|
|
4
4
|
|
|
5
5
|
import com.facebook.react.bridge.ReadableArray;
|
|
6
6
|
import com.facebook.react.bridge.ReadableMap;
|
|
7
|
-
import com.google.android.gms.maps.GoogleMap;
|
|
8
7
|
import com.google.android.gms.maps.model.LatLng;
|
|
9
8
|
import com.google.android.gms.maps.model.Polygon;
|
|
10
9
|
import com.google.android.gms.maps.model.PolygonOptions;
|
|
10
|
+
import com.google.maps.android.collections.PolygonManager;
|
|
11
11
|
|
|
12
12
|
import java.util.ArrayList;
|
|
13
13
|
import java.util.List;
|
|
@@ -148,13 +148,15 @@ public class MapPolygon extends MapFeature {
|
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
@Override
|
|
151
|
-
public void addToMap(
|
|
152
|
-
|
|
151
|
+
public void addToMap(Object collection) {
|
|
152
|
+
PolygonManager.Collection polygonCollection = (PolygonManager.Collection) collection;
|
|
153
|
+
polygon = polygonCollection.addPolygon(getPolygonOptions());
|
|
153
154
|
polygon.setClickable(this.tappable);
|
|
154
155
|
}
|
|
155
156
|
|
|
156
157
|
@Override
|
|
157
|
-
public void removeFromMap(
|
|
158
|
-
|
|
158
|
+
public void removeFromMap(Object collection) {
|
|
159
|
+
PolygonManager.Collection polygonCollection = (PolygonManager.Collection) collection;
|
|
160
|
+
polygonCollection.remove(polygon);
|
|
159
161
|
}
|
|
160
162
|
}
|
|
@@ -4,7 +4,6 @@ import android.content.Context;
|
|
|
4
4
|
|
|
5
5
|
import com.facebook.react.bridge.ReadableArray;
|
|
6
6
|
import com.facebook.react.bridge.ReadableMap;
|
|
7
|
-
import com.google.android.gms.maps.GoogleMap;
|
|
8
7
|
import com.google.android.gms.maps.model.Cap;
|
|
9
8
|
import com.google.android.gms.maps.model.Dash;
|
|
10
9
|
import com.google.android.gms.maps.model.Dot;
|
|
@@ -14,6 +13,7 @@ import com.google.android.gms.maps.model.PatternItem;
|
|
|
14
13
|
import com.google.android.gms.maps.model.Polyline;
|
|
15
14
|
import com.google.android.gms.maps.model.PolylineOptions;
|
|
16
15
|
import com.google.android.gms.maps.model.RoundCap;
|
|
16
|
+
import com.google.maps.android.collections.PolylineManager;
|
|
17
17
|
|
|
18
18
|
import java.util.ArrayList;
|
|
19
19
|
import java.util.List;
|
|
@@ -150,13 +150,15 @@ public class MapPolyline extends MapFeature {
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
@Override
|
|
153
|
-
public void addToMap(
|
|
154
|
-
|
|
153
|
+
public void addToMap(Object collection) {
|
|
154
|
+
PolylineManager.Collection polylineCollection = (PolylineManager.Collection) collection;
|
|
155
|
+
polyline = polylineCollection.addPolyline(getPolylineOptions());
|
|
155
156
|
polyline.setClickable(this.tappable);
|
|
156
157
|
}
|
|
157
158
|
|
|
158
159
|
@Override
|
|
159
|
-
public void removeFromMap(
|
|
160
|
-
|
|
160
|
+
public void removeFromMap(Object collection) {
|
|
161
|
+
PolylineManager.Collection polylineCollection = (PolylineManager.Collection) collection;
|
|
162
|
+
polylineCollection.remove(polyline);
|
|
161
163
|
}
|
|
162
164
|
}
|
|
@@ -196,12 +196,12 @@ public class MapUrlTile extends MapFeature {
|
|
|
196
196
|
}
|
|
197
197
|
|
|
198
198
|
@Override
|
|
199
|
-
public void addToMap(
|
|
200
|
-
this.tileOverlay = map.addTileOverlay(getTileOverlayOptions());
|
|
199
|
+
public void addToMap(Object map) {
|
|
200
|
+
this.tileOverlay = ((GoogleMap) map).addTileOverlay(getTileOverlayOptions());
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
@Override
|
|
204
|
-
public void removeFromMap(
|
|
204
|
+
public void removeFromMap(Object map) {
|
|
205
205
|
tileOverlay.remove();
|
|
206
206
|
}
|
|
207
207
|
}
|
|
@@ -52,6 +52,11 @@ import com.google.android.gms.maps.model.Polyline;
|
|
|
52
52
|
import com.google.android.gms.maps.model.TileOverlay;
|
|
53
53
|
import com.google.android.gms.maps.model.IndoorBuilding;
|
|
54
54
|
import com.google.android.gms.maps.model.IndoorLevel;
|
|
55
|
+
import com.google.maps.android.collections.CircleManager;
|
|
56
|
+
import com.google.maps.android.collections.GroundOverlayManager;
|
|
57
|
+
import com.google.maps.android.collections.MarkerManager;
|
|
58
|
+
import com.google.maps.android.collections.PolygonManager;
|
|
59
|
+
import com.google.maps.android.collections.PolylineManager;
|
|
55
60
|
import com.google.maps.android.data.kml.KmlContainer;
|
|
56
61
|
import com.google.maps.android.data.kml.KmlLayer;
|
|
57
62
|
import com.google.maps.android.data.kml.KmlPlacemark;
|
|
@@ -73,6 +78,15 @@ import static androidx.core.content.PermissionChecker.checkSelfPermission;
|
|
|
73
78
|
public class MapView extends com.google.android.gms.maps.MapView implements GoogleMap.InfoWindowAdapter,
|
|
74
79
|
GoogleMap.OnMarkerDragListener, OnMapReadyCallback, GoogleMap.OnPoiClickListener, GoogleMap.OnIndoorStateChangeListener {
|
|
75
80
|
public GoogleMap map;
|
|
81
|
+
private MarkerManager markerManager;
|
|
82
|
+
private MarkerManager.Collection markerCollection;
|
|
83
|
+
private PolylineManager polylineManager;
|
|
84
|
+
private PolylineManager.Collection polylineCollection;
|
|
85
|
+
private PolygonManager polygonManager;
|
|
86
|
+
private PolygonManager.Collection polygonCollection;
|
|
87
|
+
private CircleManager.Collection circleCollection;
|
|
88
|
+
private GroundOverlayManager groundOverlayManager;
|
|
89
|
+
private GroundOverlayManager.Collection groundOverlayCollection;
|
|
76
90
|
private ProgressBar mapLoadingProgressBar;
|
|
77
91
|
private RelativeLayout mapLoadingLayout;
|
|
78
92
|
private ImageView cacheImageView;
|
|
@@ -214,8 +228,20 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
|
|
|
214
228
|
return;
|
|
215
229
|
}
|
|
216
230
|
this.map = map;
|
|
217
|
-
|
|
218
|
-
|
|
231
|
+
|
|
232
|
+
markerManager = new MarkerManager(map);
|
|
233
|
+
markerCollection = markerManager.newCollection();
|
|
234
|
+
polylineManager = new PolylineManager(map);
|
|
235
|
+
polylineCollection = polylineManager.newCollection();
|
|
236
|
+
polygonManager = new PolygonManager(map);
|
|
237
|
+
polygonCollection = polygonManager.newCollection();
|
|
238
|
+
CircleManager circleManager = new CircleManager(map);
|
|
239
|
+
circleCollection = circleManager.newCollection();
|
|
240
|
+
groundOverlayManager = new GroundOverlayManager(map);
|
|
241
|
+
groundOverlayCollection = groundOverlayManager.newCollection();
|
|
242
|
+
|
|
243
|
+
markerCollection.setInfoWindowAdapter(this);
|
|
244
|
+
markerCollection.setOnMarkerDragListener(this);
|
|
219
245
|
this.map.setOnPoiClickListener(this);
|
|
220
246
|
this.map.setOnIndoorStateChangeListener(this);
|
|
221
247
|
|
|
@@ -246,13 +272,12 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
|
|
|
246
272
|
}
|
|
247
273
|
});
|
|
248
274
|
|
|
249
|
-
|
|
275
|
+
markerCollection.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() {
|
|
250
276
|
@Override
|
|
251
|
-
public boolean onMarkerClick(Marker marker) {
|
|
252
|
-
WritableMap event;
|
|
277
|
+
public boolean onMarkerClick(@NonNull Marker marker) {
|
|
253
278
|
MapMarker airMapMarker = getMarkerMap(marker);
|
|
254
279
|
|
|
255
|
-
event = makeClickEventData(marker.getPosition());
|
|
280
|
+
WritableMap event = makeClickEventData(marker.getPosition());
|
|
256
281
|
event.putString("action", "marker-press");
|
|
257
282
|
event.putString("id", airMapMarker.getIdentifier());
|
|
258
283
|
manager.pushEvent(context, view, "onMarkerPress", event);
|
|
@@ -274,30 +299,28 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
|
|
|
274
299
|
}
|
|
275
300
|
});
|
|
276
301
|
|
|
277
|
-
|
|
302
|
+
polygonCollection.setOnPolygonClickListener(new GoogleMap.OnPolygonClickListener() {
|
|
278
303
|
@Override
|
|
279
|
-
public void onPolygonClick(Polygon polygon) {
|
|
304
|
+
public void onPolygonClick(@NonNull Polygon polygon) {
|
|
280
305
|
WritableMap event = makeClickEventData(tapLocation);
|
|
281
306
|
event.putString("action", "polygon-press");
|
|
282
307
|
manager.pushEvent(context, polygonMap.get(polygon), "onPress", event);
|
|
283
308
|
}
|
|
284
309
|
});
|
|
285
310
|
|
|
286
|
-
|
|
311
|
+
polylineCollection.setOnPolylineClickListener(new GoogleMap.OnPolylineClickListener() {
|
|
287
312
|
@Override
|
|
288
|
-
public void onPolylineClick(Polyline polyline) {
|
|
313
|
+
public void onPolylineClick(@NonNull Polyline polyline) {
|
|
289
314
|
WritableMap event = makeClickEventData(tapLocation);
|
|
290
315
|
event.putString("action", "polyline-press");
|
|
291
316
|
manager.pushEvent(context, polylineMap.get(polyline), "onPress", event);
|
|
292
317
|
}
|
|
293
318
|
});
|
|
294
319
|
|
|
295
|
-
|
|
320
|
+
markerCollection.setOnInfoWindowClickListener(new GoogleMap.OnInfoWindowClickListener() {
|
|
296
321
|
@Override
|
|
297
|
-
public void onInfoWindowClick(Marker marker) {
|
|
298
|
-
WritableMap event;
|
|
299
|
-
|
|
300
|
-
event = makeClickEventData(marker.getPosition());
|
|
322
|
+
public void onInfoWindowClick(@NonNull Marker marker) {
|
|
323
|
+
WritableMap event = makeClickEventData(marker.getPosition());
|
|
301
324
|
event.putString("action", "callout-press");
|
|
302
325
|
manager.pushEvent(context, view, "onCalloutPress", event);
|
|
303
326
|
|
|
@@ -315,7 +338,7 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
|
|
|
315
338
|
|
|
316
339
|
map.setOnMapClickListener(new GoogleMap.OnMapClickListener() {
|
|
317
340
|
@Override
|
|
318
|
-
public void onMapClick(LatLng point) {
|
|
341
|
+
public void onMapClick(@NonNull LatLng point) {
|
|
319
342
|
WritableMap event = makeClickEventData(point);
|
|
320
343
|
event.putString("action", "press");
|
|
321
344
|
manager.pushEvent(context, view, "onPress", event);
|
|
@@ -324,16 +347,16 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
|
|
|
324
347
|
|
|
325
348
|
map.setOnMapLongClickListener(new GoogleMap.OnMapLongClickListener() {
|
|
326
349
|
@Override
|
|
327
|
-
public void onMapLongClick(LatLng point) {
|
|
350
|
+
public void onMapLongClick(@NonNull LatLng point) {
|
|
328
351
|
WritableMap event = makeClickEventData(point);
|
|
329
352
|
event.putString("action", "long-press");
|
|
330
353
|
manager.pushEvent(context, view, "onLongPress", makeClickEventData(point));
|
|
331
354
|
}
|
|
332
355
|
});
|
|
333
356
|
|
|
334
|
-
|
|
357
|
+
groundOverlayCollection.setOnGroundOverlayClickListener(new GoogleMap.OnGroundOverlayClickListener() {
|
|
335
358
|
@Override
|
|
336
|
-
public void onGroundOverlayClick(GroundOverlay groundOverlay) {
|
|
359
|
+
public void onGroundOverlayClick(@NonNull GroundOverlay groundOverlay) {
|
|
337
360
|
WritableMap event = makeClickEventData(groundOverlay.getPosition());
|
|
338
361
|
event.putString("action", "overlay-press");
|
|
339
362
|
manager.pushEvent(context, overlayMap.get(groundOverlay), "onPress", event);
|
|
@@ -655,7 +678,7 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
|
|
|
655
678
|
// This is where we intercept them and do the appropriate underlying mapview action.
|
|
656
679
|
if (child instanceof MapMarker) {
|
|
657
680
|
MapMarker annotation = (MapMarker) child;
|
|
658
|
-
annotation.addToMap(
|
|
681
|
+
annotation.addToMap(markerCollection);
|
|
659
682
|
features.add(index, annotation);
|
|
660
683
|
|
|
661
684
|
// Allow visibility event to be triggered later
|
|
@@ -681,7 +704,7 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
|
|
|
681
704
|
markerMap.put(marker, annotation);
|
|
682
705
|
} else if (child instanceof MapPolyline) {
|
|
683
706
|
MapPolyline polylineView = (MapPolyline) child;
|
|
684
|
-
polylineView.addToMap(
|
|
707
|
+
polylineView.addToMap(polylineCollection);
|
|
685
708
|
features.add(index, polylineView);
|
|
686
709
|
Polyline polyline = (Polyline) polylineView.getFeature();
|
|
687
710
|
polylineMap.put(polyline, polylineView);
|
|
@@ -693,13 +716,13 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
|
|
|
693
716
|
gradientPolylineMap.put(tileOverlay, polylineView);
|
|
694
717
|
} else if (child instanceof MapPolygon) {
|
|
695
718
|
MapPolygon polygonView = (MapPolygon) child;
|
|
696
|
-
polygonView.addToMap(
|
|
719
|
+
polygonView.addToMap(polygonCollection);
|
|
697
720
|
features.add(index, polygonView);
|
|
698
721
|
Polygon polygon = (Polygon) polygonView.getFeature();
|
|
699
722
|
polygonMap.put(polygon, polygonView);
|
|
700
723
|
} else if (child instanceof MapCircle) {
|
|
701
724
|
MapCircle circleView = (MapCircle) child;
|
|
702
|
-
circleView.addToMap(
|
|
725
|
+
circleView.addToMap(circleCollection);
|
|
703
726
|
features.add(index, circleView);
|
|
704
727
|
} else if (child instanceof MapUrlTile) {
|
|
705
728
|
MapUrlTile urlTileView = (MapUrlTile) child;
|
|
@@ -715,7 +738,7 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
|
|
|
715
738
|
features.add(index, localTileView);
|
|
716
739
|
} else if (child instanceof MapOverlay) {
|
|
717
740
|
MapOverlay overlayView = (MapOverlay) child;
|
|
718
|
-
overlayView.addToMap(
|
|
741
|
+
overlayView.addToMap(groundOverlayCollection);
|
|
719
742
|
features.add(index, overlayView);
|
|
720
743
|
GroundOverlay overlay = (GroundOverlay) overlayView.getFeature();
|
|
721
744
|
overlayMap.put(overlay, overlayView);
|
|
@@ -1185,7 +1208,7 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
|
|
|
1185
1208
|
return;
|
|
1186
1209
|
}
|
|
1187
1210
|
|
|
1188
|
-
KmlLayer kmlLayer = new KmlLayer(map, kmlStream, context);
|
|
1211
|
+
KmlLayer kmlLayer = new KmlLayer(map, kmlStream, context, markerManager, polygonManager, polylineManager, groundOverlayManager, null);
|
|
1189
1212
|
kmlLayer.addLayerToMap();
|
|
1190
1213
|
|
|
1191
1214
|
WritableMap pointers = new WritableNativeMap();
|
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.7.0",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"lint": "eslint . --max-warnings 0",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@react-native-community/eslint-config": "3.2.0",
|
|
61
61
|
"@semantic-release/changelog": "6.0.3",
|
|
62
62
|
"@semantic-release/git": "10.0.1",
|
|
63
|
-
"@types/jest": "29.5.
|
|
63
|
+
"@types/jest": "29.5.1",
|
|
64
64
|
"@types/react-native": "0.70.13",
|
|
65
65
|
"babel-jest": "29.5.0",
|
|
66
66
|
"detox": "20.7.0",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"jest": "29.5.0",
|
|
70
70
|
"prettier": "2.8.7",
|
|
71
71
|
"react": "18.1.0",
|
|
72
|
-
"react-native": "0.70.
|
|
72
|
+
"react-native": "0.70.9",
|
|
73
73
|
"semantic-release": "21.0.1",
|
|
74
74
|
"typescript": "5.0.4"
|
|
75
75
|
},
|