teovillanueva / react-native-web-maps

Cross platform maps for react & react-native 🗺
https://teovillanueva.github.io/react-native-web-maps/
MIT License
54 stars 14 forks source link

onRegionChangeComplete is not triggered when user zooms in/out #9

Open efibe opened 1 year ago

efibe commented 1 year ago

When the user zooms the map using the scroll wheel or the +/- buttons, onRegionChangeComplete is not being triggered.

When user pans the map by dragging, onRegionChangeComplete is being called correctly.

Current version: "@teovilla/react-native-web-maps": "^0.6.1",

I'm using the component like this:

<MapView
  style={{ flex: 1 }}
  provider="google"
  region={region}  
  onRegionChangeComplete={(reg, details) => {
    console.log({ reg, details });
    setRegion(reg);
}}>

I fixed this locally by adding one line to src/components/map-view.tsx:

image

teovillanueva commented 1 year ago

Hey! Sorry for the late reply. Would you mind forking the project and creating a PR with the fix?