react-native-maps 1.10.3 → 1.11.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.
@@ -19,6 +19,10 @@ buildscript {
19
19
 
20
20
  apply plugin: 'com.android.library'
21
21
 
22
+ def isNewArchitectureEnabled() {
23
+ return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
24
+ }
25
+
22
26
  android {
23
27
  def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
24
28
  if (agpVersion.tokenize('.')[0].toInteger() >= 7) {
@@ -30,6 +34,8 @@ android {
30
34
  defaultConfig {
31
35
  minSdkVersion safeExtGet('minSdkVersion', 21)
32
36
  targetSdkVersion safeExtGet('targetSdkVersion', 34)
37
+
38
+ buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
33
39
  }
34
40
  }
35
41
 
@@ -450,8 +450,10 @@ public class MapManager extends ViewGroupManager<MapView> {
450
450
  }
451
451
 
452
452
  void pushEvent(ThemedReactContext context, View view, String name, WritableMap data) {
453
- context.getJSModule(RCTEventEmitter.class)
454
- .receiveEvent(view.getId(), name, data);
453
+ context
454
+ .getReactApplicationContext()
455
+ .getJSModule(RCTEventEmitter.class)
456
+ .receiveEvent(view.getId(), name, data);
455
457
  }
456
458
 
457
459
  @Override
@@ -30,7 +30,9 @@ import com.facebook.react.bridge.WritableNativeArray;
30
30
  import com.facebook.react.bridge.WritableNativeMap;
31
31
  import com.facebook.react.bridge.Arguments;
32
32
  import com.facebook.react.uimanager.ThemedReactContext;
33
+ import com.facebook.react.uimanager.UIManagerHelper;
33
34
  import com.facebook.react.uimanager.UIManagerModule;
35
+ import com.facebook.react.uimanager.common.UIManagerType;
34
36
  import com.facebook.react.uimanager.events.EventDispatcher;
35
37
  import com.google.android.gms.maps.CameraUpdate;
36
38
  import com.google.android.gms.maps.CameraUpdateFactory;
@@ -208,7 +210,14 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
208
210
  }
209
211
  });
210
212
 
211
- eventDispatcher = reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher();
213
+ int uiManagerType = UIManagerType.DEFAULT;
214
+ if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
215
+ uiManagerType = UIManagerType.FABRIC;
216
+ }
217
+
218
+ eventDispatcher = UIManagerHelper
219
+ .getUIManager(reactContext, uiManagerType)
220
+ .getEventDispatcher();
212
221
 
213
222
  // Set up a parent view for triggering visibility in subviews that depend on it.
214
223
  // Mainly ReactImageView depends on Fresco which depends on onVisibilityChanged() event
@@ -771,6 +780,7 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
771
780
  if (feature instanceof MapMarker) {
772
781
  markerMap.remove(feature.getFeature());
773
782
  feature.removeFromMap(markerCollection);
783
+ attacherGroup.removeView(feature);
774
784
  } else if (feature instanceof MapHeatmap) {
775
785
  heatmapMap.remove(feature.getFeature());
776
786
  feature.removeFromMap(map);
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.10.3",
8
+ "version": "1.11.0",
9
9
  "license": "MIT",
10
10
  "scripts": {
11
11
  "lint": "eslint . --max-warnings 0",