react-native - getMapBoundaries 方法未定义
问题描述
我在我的 React Native Expo 应用程序中使用“react-native-maps”:“^0.22.1”。
我试图在我的代码中使用 getMapBoundaries() 方法,但该方法未定义。请注意,例如,我可以使用 animateToRegion() 方法。
<MapView
style={styles.mapView}
ref={ref => {
this.map = ref;
}}
onRegionChangeComplete={this.handleRegionChange}
provider={MapView.PROVIDER_GOOGLE}
showsUserLocation={true}
showsCompass={true}
showsScale={true}
onMapReady={this.handleMapReady}
>
</MapView>
当我调用 getMapBoundaries() 方法时,我收到“不是函数”错误。
this.map.getMapBoundaries()
如果您需要更多信息,请告诉我。
对你的帮助表示感谢。
解决方案
请参考issue #2665,“npm 尚未发布有此方法的版本,请使用 git 版本。”
推荐阅读
- python - “TypeError:'pygame.Surface'对象不可迭代”尝试创建包时
- python - 如何从 Python 链接下载扩展名为 .torrent 的文件
- c# - 无法读取单元测试中的响应内容
- r - 制作具有 2 个因子的频率选项卡的最简单的 R 函数是什么?
- python-3.x - 如何使用 beautifulsoup 从中获取值?
- node.js - 选择所有对象的日期在 mongodb 的字段值的两个日期之间
- spring - Spring集成触发定时器事件
- powershell - PowerShell 内容替换和转义双引号
- ios - 项目无法在 XCode10.3 中构建,Apple match-o 链接器错误与 swift 库
- node.js - 有没有办法在仍然使用 mongoose 进行模式定义的同时访问 mongodb node.js 驱动程序功能?