react-native-maps 1.21.0-alpha.142 → 1.21.0-alpha.144
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.
|
@@ -9,6 +9,7 @@ import android.graphics.Bitmap;
|
|
|
9
9
|
import android.graphics.Color;
|
|
10
10
|
import android.graphics.Point;
|
|
11
11
|
import android.location.Location;
|
|
12
|
+
|
|
12
13
|
import androidx.lifecycle.DefaultLifecycleObserver;
|
|
13
14
|
import androidx.lifecycle.LifecycleOwner;
|
|
14
15
|
|
|
@@ -194,15 +195,16 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
|
|
|
194
195
|
}
|
|
195
196
|
|
|
196
197
|
|
|
197
|
-
@Override
|
|
198
|
-
public void onCreate(LifecycleOwner owner) {
|
|
199
|
-
|
|
200
|
-
}
|
|
198
|
+
@Override
|
|
199
|
+
public void onCreate(LifecycleOwner owner) {
|
|
200
|
+
super.onCreate(null);
|
|
201
|
+
}
|
|
201
202
|
|
|
202
203
|
@Override
|
|
203
204
|
public void onStart(LifecycleOwner owner) {
|
|
204
205
|
super.onStart();
|
|
205
206
|
}
|
|
207
|
+
|
|
206
208
|
@Override
|
|
207
209
|
public void onResume(LifecycleOwner owner) {
|
|
208
210
|
if (hasPermissions() && map != null) {
|
|
@@ -220,7 +222,7 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
220
222
|
|
|
221
223
|
|
|
222
224
|
@Override
|
|
223
|
-
public void onPause(LifecycleOwner owner){
|
|
225
|
+
public void onPause(LifecycleOwner owner) {
|
|
224
226
|
super.onPause();
|
|
225
227
|
if (hasPermissions() && map != null) {
|
|
226
228
|
//noinspection MissingPermission
|
|
@@ -240,7 +242,7 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
240
242
|
}
|
|
241
243
|
|
|
242
244
|
@Override
|
|
243
|
-
public void onDestroy(LifecycleOwner owner){
|
|
245
|
+
public void onDestroy(LifecycleOwner owner) {
|
|
244
246
|
MapView.this.doDestroy();
|
|
245
247
|
}
|
|
246
248
|
|
|
@@ -250,7 +252,7 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
250
252
|
this.context = context;
|
|
251
253
|
Activity activity = context.getCurrentActivity();
|
|
252
254
|
if (activity instanceof LifecycleOwner) {
|
|
253
|
-
|
|
255
|
+
((LifecycleOwner) activity).getLifecycle().addObserver(this);
|
|
254
256
|
}
|
|
255
257
|
super.getMapAsync(this);
|
|
256
258
|
|
|
@@ -324,7 +326,7 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
324
326
|
}
|
|
325
327
|
if (addedPosition) {
|
|
326
328
|
|
|
327
|
-
|
|
329
|
+
LatLngBounds bounds = builder.build();
|
|
328
330
|
LatLng northEast = bounds.northeast;
|
|
329
331
|
LatLng southWest = bounds.southwest;
|
|
330
332
|
|
|
@@ -338,7 +340,7 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
338
340
|
|
|
339
341
|
public void setShowsTraffic(boolean value) {
|
|
340
342
|
showsTraffic = value;
|
|
341
|
-
if (map != null){
|
|
343
|
+
if (map != null) {
|
|
342
344
|
map.setTrafficEnabled(value);
|
|
343
345
|
}
|
|
344
346
|
}
|
|
@@ -554,8 +556,8 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
554
556
|
event.putString("action", "overlay-press");
|
|
555
557
|
|
|
556
558
|
dispatchEvent(event, OnPressEvent::new);
|
|
557
|
-
event =
|
|
558
|
-
dispatchEvent(event, OnPressEvent::new,overlayMap.get(groundOverlay).getId(), context);
|
|
559
|
+
event = makeClickEventData(groundOverlay.getPosition());
|
|
560
|
+
dispatchEvent(event, OnPressEvent::new, overlayMap.get(groundOverlay).getId(), context);
|
|
559
561
|
}
|
|
560
562
|
});
|
|
561
563
|
|
|
@@ -599,7 +601,7 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
599
601
|
|
|
600
602
|
|
|
601
603
|
isMapReady = true;
|
|
602
|
-
if (kmlSrc != null){
|
|
604
|
+
if (kmlSrc != null) {
|
|
603
605
|
setKmlSrc(kmlSrc);
|
|
604
606
|
kmlSrc = null;
|
|
605
607
|
}
|
|
@@ -651,7 +653,8 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
651
653
|
builder.put(OnLongPressEvent.EVENT_NAME, MapBuilder.of("registrationName", OnLongPressEvent.EVENT_NAME));
|
|
652
654
|
return builder.build();
|
|
653
655
|
}
|
|
654
|
-
|
|
656
|
+
|
|
657
|
+
// , ,
|
|
655
658
|
public static Map<String, Object> getExportedCustomDirectEventTypeConstants() {
|
|
656
659
|
MapBuilder.Builder<String, Object> builder = MapBuilder.builder();
|
|
657
660
|
builder.put(OnMarkerPressEvent.EVENT_NAME, MapBuilder.of("registrationName", OnMarkerPressEvent.EVENT_NAME));
|
|
@@ -735,6 +738,13 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
735
738
|
map.setMapStyle(new MapStyleOptions(customMapStyleString));
|
|
736
739
|
}
|
|
737
740
|
this.setPoiClickEnabled(poiClickEnabled);
|
|
741
|
+
if (setPaddingDeferred &&
|
|
742
|
+
(baseLeftMapPadding != 0 ||
|
|
743
|
+
baseTopMapPadding != 0 ||
|
|
744
|
+
baseRightMapPadding != 0 ||
|
|
745
|
+
baseBottomMapPadding != 0)) {
|
|
746
|
+
applyBaseMapPadding(baseLeftMapPadding, baseTopMapPadding, baseRightMapPadding, baseBottomMapPadding);
|
|
747
|
+
}
|
|
738
748
|
}
|
|
739
749
|
|
|
740
750
|
public static LatLngBounds latLngBoundsFromRegion(ReadableMap region) {
|
|
@@ -1219,6 +1229,7 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
1219
1229
|
cameraToSet = null;
|
|
1220
1230
|
}
|
|
1221
1231
|
}
|
|
1232
|
+
|
|
1222
1233
|
public void animateToCamera(CameraPosition position, int duration) {
|
|
1223
1234
|
if (map == null) return;
|
|
1224
1235
|
CameraUpdate update = CameraUpdateFactory.newCameraPosition(position);
|
|
@@ -1263,16 +1274,16 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
1263
1274
|
LatLngBounds.Builder builder = new LatLngBounds.Builder();
|
|
1264
1275
|
|
|
1265
1276
|
boolean addedPosition = false;
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1277
|
+
if (features.size() > 0) {
|
|
1278
|
+
for (MapFeature feature : features) {
|
|
1279
|
+
if (feature instanceof MapMarker) {
|
|
1280
|
+
Marker marker = (Marker) feature.getFeature();
|
|
1281
|
+
builder.include(marker.getPosition());
|
|
1282
|
+
addedPosition = true;
|
|
1283
|
+
}
|
|
1284
|
+
// TODO(lmr): may want to include shapes / etc.
|
|
1285
|
+
}
|
|
1286
|
+
}
|
|
1276
1287
|
if (addedPosition) {
|
|
1277
1288
|
LatLngBounds bounds = builder.build();
|
|
1278
1289
|
CameraUpdate cu = CameraUpdateFactory.newLatLngBounds(bounds, 0);
|
|
@@ -1379,6 +1390,7 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
1379
1390
|
|
|
1380
1391
|
// Move the google logo to the default base padding value.
|
|
1381
1392
|
map.setPadding(left, top, right, bottom);
|
|
1393
|
+
setPaddingDeferred = false;
|
|
1382
1394
|
}
|
|
1383
1395
|
|
|
1384
1396
|
public void fitToCoordinates(ReadableArray coordinatesArray, ReadableMap edgePadding,
|
|
@@ -1728,7 +1740,7 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
1728
1740
|
e.printStackTrace();
|
|
1729
1741
|
}
|
|
1730
1742
|
} else {
|
|
1731
|
-
|
|
1743
|
+
this.kmlSrc = kmlSrc;
|
|
1732
1744
|
}
|
|
1733
1745
|
}
|
|
1734
1746
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
#import <React/UIView+React.h>
|
|
11
11
|
|
|
12
12
|
@implementation AIRMapWMSTile
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
- (void)createTileOverlayAndRendererIfPossible
|
|
15
15
|
{
|
|
16
16
|
if (!_urlTemplateSet) return;
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
|
|
53
53
|
@implementation AIRMapWMSTileOverlay
|
|
54
54
|
|
|
55
|
-
- (id)initWithURLTemplate:(NSString *)URLTemplate
|
|
55
|
+
- (id)initWithURLTemplate:(NSString *)URLTemplate
|
|
56
56
|
{
|
|
57
57
|
self = [super initWithURLTemplate:URLTemplate];
|
|
58
58
|
return self;
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
|
|
69
69
|
@implementation AIRMapWMSTileCachedOverlay
|
|
70
70
|
|
|
71
|
-
- (id)initWithURLTemplate:(NSString *)URLTemplate
|
|
71
|
+
- (id)initWithURLTemplate:(NSString *)URLTemplate
|
|
72
72
|
{
|
|
73
73
|
self = [super initWithURLTemplate:URLTemplate];
|
|
74
74
|
return self;
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
@end
|
|
83
83
|
|
|
84
84
|
|
|
85
|
-
@implementation AIRMapWMSTileHelper
|
|
85
|
+
@implementation AIRMapWMSTileHelper
|
|
86
86
|
+ (NSURL *)URLForTilePath:(MKTileOverlayPath)path withURLTemplate:(NSString *)URLTemplate withTileSize:(NSInteger)tileSize
|
|
87
87
|
{
|
|
88
88
|
NSArray *bb = [self getBoundBox:path.x yAxis:path.y zoom:path.z];
|
|
@@ -102,15 +102,15 @@
|
|
|
102
102
|
double MapY = 20037508.34789244;
|
|
103
103
|
double FULL = 20037508.34789244 * 2;
|
|
104
104
|
double tile = FULL / pow(2.0, (double)zoom);
|
|
105
|
-
|
|
105
|
+
|
|
106
106
|
NSArray *result =[[NSArray alloc] initWithObjects:
|
|
107
107
|
[NSNumber numberWithDouble:MapX + (double)x * tile],
|
|
108
108
|
[NSNumber numberWithDouble:MapY - (double)(y + 1) * tile],
|
|
109
109
|
[NSNumber numberWithDouble:MapX + (double)(x + 1) * tile],
|
|
110
110
|
[NSNumber numberWithDouble:MapY - (double)y * tile],
|
|
111
111
|
nil];
|
|
112
|
-
|
|
113
|
-
return result;
|
|
112
|
+
|
|
113
|
+
return result;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
@end
|
|
116
|
+
@end
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"main": "src/index.ts",
|
|
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.21.0-alpha.
|
|
8
|
+
"version": "1.21.0-alpha.144",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"lint": "eslint . --max-warnings 0",
|
|
@@ -23,7 +23,6 @@ Pod::Spec.new do |s|
|
|
|
23
23
|
s.module_name = 'ReactNativeMaps'
|
|
24
24
|
s.compiler_flags = folly_compiler_flags
|
|
25
25
|
s.dependency 'react-native-maps-generated'
|
|
26
|
-
s.dependency "React-Core"
|
|
27
26
|
install_modules_dependencies(s)
|
|
28
27
|
|
|
29
28
|
# Add script phase to detect Google Maps
|
|
@@ -61,11 +60,5 @@ Pod::Spec.new do |s|
|
|
|
61
60
|
}
|
|
62
61
|
]
|
|
63
62
|
|
|
64
|
-
s.pod_target_xcconfig = {
|
|
65
|
-
'HEADER_SEARCH_PATHS' => [
|
|
66
|
-
'$(PODS_ROOT)/Headers/Public/React-Core',
|
|
67
|
-
'$(PODS_TARGET_SRCROOT)/../../../node_modules/react-native/React'
|
|
68
|
-
]
|
|
69
|
-
}
|
|
70
63
|
|
|
71
64
|
end
|