Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ios-google): zoomTapEnabled works on map load #5026

Closed
wants to merge 1 commit into from

Conversation

lucaslt89
Copy link

See the issue for a test example and the issue details

Closes issue #5024

Does any other open PR do the same thing?

No

What issue is this PR fixing?

#5024

How did you test this PR?

The issue #5024 contains a simple example to reproduce it.

This is a simple app to test it:

import React, {useEffect, useState} from 'react';
import MapView from 'react-native-maps';

const App = () => {
  const [zoomEnabled, setZoomEnabled] = useState(false);

  useEffect(() => {
    setTimeout(() => {
      setZoomEnabled(true);
    }, 1000);
  }, []);

  return (
    <MapView provider="google" style={{flex: 1}} zoomTapEnabled={zoomEnabled} />
  );
};

export default App;

See the issue for a test example and the issue details

Closes issue react-native-maps#5024
Copy link
Collaborator

@salah-ghanim salah-ghanim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lucaslt89 thank you very much for your contribution, after reviewing the code I realised that it depends on undocumented behaviour, instead of depending on google's official APIs, I would avoid such customisations as much as I can

please look into: https://developers.google.com/maps/documentation/ios-sdk/controls#maps_ios_controls_and_gestures_map-objective-c

and recently I introduced the ability to load initialProps on the native side for both android and iOS to solve this "the proper way"

see: AIRGoogleMapManager view method where initialProps are loaded.

you can load zoomGesturesEnabled from there and pass it on to google maps settings to enable / disable correctly on launch

@salah-ghanim
Copy link
Collaborator

@lucaslt89 should be fixed in v1.15.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants