简体   繁体   English

如何缩放到特定标记 react-native-maps

[英]how to Zoom to specific markers react-native-maps

how to Zoom to specific markers react-native-maps如何缩放到特定标记 react-native-maps

like this image喜欢这张图片地图图像

First create a ref to the MapView component:首先创建一个 MapView 组件的引用:

        <MapView
          ref={ref => {
            this.map = ref;
          }}
          ...
        >
          ...
        </MapView>

Then use one of the following three methods:然后使用以下三种方法之一:

You can find more details on these methods and parameters in the MapView docs .您可以在MapView 文档中找到有关这些方法和参数的更多详细信息。

You can use onPress or onSelect props of marker which accepts a callback function where you can pass the zooom size of marker.您可以使用标记的 onPress 或 onSelect 道具,它接受回调 function ,您可以在其中传递标记的缩放大小。 I hope it is useful我希望它有用

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

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