react-native-maps如何判断用户位置是否在可见地图之外

问题描述 投票:0回答:1

有没有办法告诉反应原生地图的当前可见边界。我想知道用户何时不再在地图上可见。

react-native react-native-maps
1个回答
0
投票

我认为你应该使用权限包。 React-native-maps不提供权限。我多次使用https://github.com/yonahforst/react-native-permissions。它运作良好。

Permissions.request('location').then(response => {
    // Returns once the user has chosen to 'allow' or to 'not allow' access      
    // Response is one of: 'authorized', 'denied', 'restricted', or 'undetermined'      
    this.setState({ locationPermission: response })      
})
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.