5 thoughts on “How can get Map zoom level?

  1. Would you mind going a little more in depth on how you were able to get the zoom level. I understand the delta values are just the difference from the coordinates and full view of the map. But I’m stumped when moving forward.

  2. @ararog we get the bounds using the center coordinate and the delta and the viewport from Dimensions.

    Considering you get the latitude, longitude and deltas from somewhere this snippet should work

    import geoViewport from 'geo-viewport'
    import { Dimensions } from 'react-native'
    
    const { height, width } = Dimensions.get('window')
    
    const bounds = [
        longitude - longitudeDelta,
        latitude - latitudeDelta,
        longitude + longitudeDelta,
        latitude + latitudeDelta,
    ]
    
    geoViewport.viewport(bounds, [height, width])

Comments are closed.

4 thoughts on “How can get Map zoom level?

  1. Would you mind going a little more in depth on how you were able to get the zoom level. I understand the delta values are just the difference from the coordinates and full view of the map. But I’m stumped when moving forward.

Comments are closed.