Skip to content

Commit

Permalink
fix(android): googleMapOptions / initialising multiple maps on androi…
Browse files Browse the repository at this point in the history
…d is buggy (react-native-maps#5034)

- reset googleOptions each time a view is initialised and pass initialProps correctly
Co-authored-by: salah ghanim <[email protected]>
  • Loading branch information
salah-ghanim committed Apr 13, 2024
1 parent 0a4d7ab commit be28937
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion android/src/main/java/com/rnmaps/maps/MapManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public class MapManager extends ViewGroupManager<MapView> {

public MapManager(ReactApplicationContext context) {
this.appContext = context;
this.googleMapOptions = new GoogleMapOptions();
}

public MapMarkerManager getMarkerManager() {
Expand All @@ -80,6 +79,7 @@ protected MapView createViewInstance(@NonNull ThemedReactContext context) {

@Override
protected MapView createViewInstance(int reactTag, @NonNull ThemedReactContext reactContext, @Nullable ReactStylesDiffMap initialProps, @Nullable StateWrapper stateWrapper) {
this.googleMapOptions = new GoogleMapOptions();
if (initialProps != null) {
if (initialProps.getString("googleMapId") != null) {
googleMapOptions.mapId(initialProps.getString("googleMapId"));
Expand Down

0 comments on commit be28937

Please sign in to comment.