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

onRegionChangeComplete value of isGesture is undefined in version 0.28.0 #3818

Closed
dazulu opened this issue May 10, 2021 · 8 comments
Closed
Labels
bug Something isn't working

Comments

@dazulu
Copy link

dazulu commented May 10, 2021

Bug report

Summary

Environment info

  react-native: https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz
  react: 16.13.1
  react-native-maps: 0.28.0

Steps to reproduce

  1. Look at the returned values for onRegionChangeComplete

Describe what you expected to happen:

  1. The value for isGesture should be a boolean value

Describe what actually happens:

  1. The value for isGesture, returned by onRegionChangeComplete is undefined.

Screenshot 2021-05-10 at 11 53 35

@dazulu dazulu added the bug Something isn't working label May 10, 2021
@RyanTG
Copy link

RyanTG commented Jun 15, 2021

I am seeing this issue, too.

Anxiously looking forward to this functionality in order to address "map flickering" issues due to onRegionChangeComplete firing over and over without any input from the user.

RyanTG referenced this issue Jun 17, 2021
* pass camera move's reason to js (android)

* IOS implementation

* renamed value to isGesture

* pretiffied

* doc updated

Co-authored-by: machou <uzanmacho@gmail.com>
@christopherdro
Copy link
Collaborator

Looking through the source it appears the isGesture property is only available on google maps. If you are using Apple Maps then the value will be undefined.

@RyanTG
Copy link

RyanTG commented Jun 18, 2021

It is undefined with Google Maps in v 0.28.0

@christopherdro
Copy link
Collaborator

Something might be wrong with your implementation. I see the value but only when the provider prop set to google on <Mapview />.

Screen Shot 2021-06-17 at 14 13 16

@RyanTG
Copy link

RyanTG commented Jun 18, 2021

Ah ok, thanks. Given that some of us are having problems implementing this, a little code snippet can go a long way.

We're essentially doing this: https://stackoverflow.com/questions/47832224/onregionchangecomplete-function-calling-multiple-times-using-react-native-maps/67191495#67191495

    onRegionChange = (region, gesture) => {
        if (gesture.isGesture) {
            this.setState({
                ...region,
                showUpdateSearch: this.state.mapCoordinatesUpdated ? false : true,
                mapCoordinatesUpdated: false
            })
        }
    }

I am not sure if this is relevant, but we're using Expo (which currently supports 0.27.0). We manually updated to 0.28.0 in package.json, so we assume it's using that version.

@christopherdro
Copy link
Collaborator

That will only work if you’re on a bare workflow.

@RyanTG
Copy link

RyanTG commented Jun 18, 2021

Ah, I thought it was still possible to adjust package versions in managed workflow - as we are currently using a different react-native-screens version due to a regression in 3.0.0. But I guess that's only possible with some packages...

It looks like 0.28.0 is not included (yet!) in the upcoming SDK 42 :(

@christopherdro
Copy link
Collaborator

If the changes are JS only, then there shouldn't be any issue. However, the changes for this feature included native changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants