react-native-maps 1.21.0-alpha.142 → 1.21.0-alpha.143

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.
@@ -313,7 +313,6 @@ public class MapViewManager extends ViewGroupManager<MapView> implements RNMapsM
313
313
  }
314
314
 
315
315
  view.applyBaseMapPadding(left, top, right, bottom);
316
- view.map.setPadding(left, top, right, bottom);
317
316
  }
318
317
 
319
318
  @Override
@@ -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
- super.onCreate(null);
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
- ((LifecycleOwner) activity).getLifecycle().addObserver(this);
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
- LatLngBounds bounds = builder.build();
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 = makeClickEventData(groundOverlay.getPosition());
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
- if (features.size() > 0) {
1267
- for (MapFeature feature : features) {
1268
- if (feature instanceof MapMarker) {
1269
- Marker marker = (Marker) feature.getFeature();
1270
- builder.include(marker.getPosition());
1271
- addedPosition = true;
1272
- }
1273
- // TODO(lmr): may want to include shapes / etc.
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
- this.kmlSrc = kmlSrc;
1743
+ this.kmlSrc = kmlSrc;
1732
1744
  }
1733
1745
  }
1734
1746
 
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.142",
8
+ "version": "1.21.0-alpha.143",
9
9
  "license": "MIT",
10
10
  "scripts": {
11
11
  "lint": "eslint . --max-warnings 0",