react-native-maps 0.31.0-beta.1 → 0.31.0-beta.2

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/index.d.ts CHANGED
@@ -629,6 +629,8 @@ declare module 'react-native-maps' {
629
629
  MUTEDSTANDARD: MapTypes;
630
630
  };
631
631
 
632
+ export const enableLatestRenderer: () => Promise<'LATEST' | 'LEGACY'> | void;
633
+
632
634
  export const PROVIDER_DEFAULT: null;
633
635
  export const PROVIDER_GOOGLE: 'google';
634
636
  }
package/index.js CHANGED
@@ -2,6 +2,7 @@ import MapView, {
2
2
  Animated,
3
3
  MAP_TYPES,
4
4
  ProviderPropType,
5
+ enableLatestRenderer,
5
6
  } from './lib/components/MapView';
6
7
  import Marker from './lib/components/MapMarker.js';
7
8
  import Overlay from './lib/components/MapOverlay.js';
@@ -19,7 +20,7 @@ export { default as AnimatedRegion } from './lib/components/AnimatedRegion.js';
19
20
  export { default as Geojson } from './lib/components/Geojson.js';
20
21
 
21
22
  export { Marker, Overlay };
22
- export { Animated, MAP_TYPES, ProviderPropType };
23
+ export { Animated, MAP_TYPES, ProviderPropType, enableLatestRenderer };
23
24
 
24
25
  export const PROVIDER_GOOGLE = MapView.PROVIDER_GOOGLE;
25
26
  export const PROVIDER_DEFAULT = MapView.PROVIDER_DEFAULT;
@@ -25,9 +25,9 @@ dependencies {
25
25
  implementation('com.facebook.react:react-native:+') {
26
26
  exclude group: 'com.android.support'
27
27
  }
28
- implementation "com.google.android.gms:play-services-base:${safeExtGet('playServicesVersion', '17.0.0')}"
29
- implementation "com.google.android.gms:play-services-maps:${safeExtGet('playServicesVersion', '17.0.0')}"
30
- implementation "com.google.android.gms:play-services-location:17.0.0"
28
+ implementation "com.google.android.gms:play-services-base:${safeExtGet('playServicesVersion', '18.0.1')}"
29
+ implementation "com.google.android.gms:play-services-maps:${safeExtGet('playServicesVersion', '18.0.2')}"
30
+ implementation "com.google.android.gms:play-services-location:19.0.1"
31
31
  implementation 'com.google.maps.android:android-maps-utils:0.5'
32
32
  implementation "androidx.work:work-runtime:$work_version"
33
33
  }
@@ -8,6 +8,7 @@ import android.location.Geocoder;
8
8
  import android.net.Uri;
9
9
  import android.util.Base64;
10
10
  import android.util.DisplayMetrics;
11
+ import android.util.Log;
11
12
 
12
13
  import com.facebook.react.bridge.Promise;
13
14
  import com.facebook.react.bridge.ReactApplicationContext;
@@ -21,6 +22,7 @@ import com.facebook.react.uimanager.NativeViewHierarchyManager;
21
22
  import com.facebook.react.uimanager.UIBlock;
22
23
  import com.facebook.react.uimanager.UIManagerModule;
23
24
  import com.google.android.gms.maps.GoogleMap;
25
+ import com.google.android.gms.maps.MapsInitializer;
24
26
  import com.google.android.gms.maps.model.CameraPosition;
25
27
  import com.google.android.gms.maps.model.LatLng;
26
28
 
@@ -352,4 +354,22 @@ public class AirMapModule extends ReactContextBaseJavaModule {
352
354
  }
353
355
  });
354
356
  }
357
+
358
+ @ReactMethod
359
+ public void enableLatestRenderer(final Promise promise) {
360
+ final ReactApplicationContext context = getReactApplicationContext();
361
+
362
+ UIManagerModule uiManager = context.getNativeModule(UIManagerModule.class);
363
+ uiManager.addUIBlock(new UIBlock()
364
+ {
365
+ @Override
366
+ public void execute(NativeViewHierarchyManager nvhm)
367
+ {
368
+ MapsInitializer.initialize(context, MapsInitializer.Renderer.LATEST, (MapsInitializer.Renderer renderer) -> {
369
+ Log.d("AirMapRenderer", renderer.toString());
370
+ promise.resolve(renderer.toString());
371
+ });
372
+ }
373
+ });
374
+ }
355
375
  }
@@ -1119,6 +1119,13 @@ if (!NativeModules.UIManager.getViewManagerConfig) {
1119
1119
 
1120
1120
  export const Animated = RNAnimated.createAnimatedComponent(MapView);
1121
1121
 
1122
+ export const enableLatestRenderer = () => {
1123
+ if (Platform.OS !== 'android') {
1124
+ return;
1125
+ }
1126
+ return NativeModules.AirMapModule.enableLatestRenderer();
1127
+ };
1128
+
1122
1129
  export const ProviderPropType = PropTypes.oneOf(
1123
1130
  Object.values(ProviderConstants)
1124
1131
  );
package/package.json CHANGED
@@ -3,10 +3,10 @@
3
3
  "description": "React Native Mapview component for iOS + Android",
4
4
  "main": "index.js",
5
5
  "author": "Leland Richardson <leland.m.richardson@gmail.com>",
6
- "version": "0.31.0-beta.1",
6
+ "version": "0.31.0-beta.2",
7
7
  "license": "MIT",
8
8
  "scripts": {
9
- "lint": "eslint .",
9
+ "lint": "eslint . --max-warnings 0",
10
10
  "test": "jest",
11
11
  "prepare": "husky install",
12
12
  "release": "semantic-release"