简体   繁体   English

React Native 地图中的初始缩放级别

[英]Initial zoom level in React Native Maps

I'm using react-native-maps library.我正在使用react-native-maps库。

This is my initial lat and long ,这是我最初long lat

<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,图片,

在此处输入图像描述

You can use minZoomLevel prop to give the initial zoom value.您可以使用minZoomLevel来提供初始缩放值。 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,
  }}>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM