Mishen Thakshana
Mishen Thakshana

Reputation: 1534

Initial zoom level in React Native Maps

I'm using react-native-maps library.

This is my initial lat and long,

<MapView
   style={{width: '100%', height: 250}}
   initialRegion={{
     latitude: 6.795218101812615,
     longitude: 79.9008869173333,
     latitudeDelta: 6.795218101812615,
     longitudeDelta: 79.9008869173333,
  }}>

But It is not zoomed. Is there any way to set the initial zoom value?

Image,

enter image description here

Upvotes: 2

Views: 4021

Answers (1)

Yakupguly Malikov
Yakupguly Malikov

Reputation: 715

You can use minZoomLevel prop to give the initial zoom value. You can find more information in This Link

<MapView
   style={{width: '100%', height: 250}}
   minZoomLevel={15}
   initialRegion={{
     latitude: 6.795218101812615,
     longitude: 79.9008869173333,
     latitudeDelta: 6.795218101812615,
     longitudeDelta: 79.9008869173333,
  }}>

Upvotes: 1

Related Questions