teovillanueva / react-native-web-maps

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

How to set initial zoom level #26

Open sreuter opened 1 year ago

sreuter commented 1 year ago

It seems like the current implementation ignores latitudeDelta and longitudeDelta as part of the initialRegion. Is there any other way to set the initial zoom level?

sreuter commented 1 year ago

I could work around this by setting the minZoomLevel & maxZoomLevel for now. I also tried setting zoom on camera but that also didn't work. Will need to dig more into the source of this library later.

teovillanueva commented 1 year ago

Hey! I would look into initialCamera.

https://teovillanueva.github.io/react-native-web-maps/support/map-view

austingayler commented 1 month ago

https://github.com/teovillanueva/react-native-web-maps/blob/4c3ff7c6025e27d30920f6aa9380da4e5bc4ced5/packages/react-native-web-maps/src/components/map-view.tsx#L292

So:

    <MapViewWeb
      initialCamera={{
        zoom: 14,
        center: {
          latitude: 40.683334,
          longitude: 7.85,
        },
      }}