html - 如何在Javascript中将纬度和经度作为全局变量访问
问题描述
我在 react-native 中使用地理定位 API。如何从承诺中获取纬度和经度值?
import Geolocation from '@react-native-community/geolocation';
Geolocation.getCurrentPosition((info) => console.log(info));
var latitude, longitude
谢谢,拉贾K
解决方案
推荐阅读
- javascript - 获取请求后重定向需要两次点击?
- objective-c - TVOS 上的 contentOverlayView 未显示
- assembly - 如何在 x86 程序集中将 16 位寄存器移动到 8 位寄存器?
- regex - Delphi中用于StringList中所有匹配行的正则表达式
- c++ - 我是否正确推理缓存性能?
- java - 是否可以拦截 java jar 的传出 tcp 请求?
- python - 如何比较来自多个csv的数据
- javascript - Javascript/jQuery 缓存实际上是如何促进 DOM 的修改的?
- vba - Excel 工作表 - 报告创建建议
- macos - Xamarin.MacOS SignalR:无法解析参考 System.Readonly Memory System.Byte Microsoft.Aspnetcore.SignalR.Protocol.Handshakeprotocol