如何从反应本机的地图中获取经度和纬度?
How to get the Longitude and Latitude from a map in react-native?
我需要从 Google 地图或打开的街道地图中获取用户的经度和纬度。谁能告诉我在 react-native 中可以做到吗?
据我所知,您无法从地图本身获取用户位置。可以使用react-native的Geolocation API。
navigator.geolocation.getCurrentPosition(geo_success, geo_error?, geo_options?)
// 或
navigator.geolocation.watchPosition(geo_success, geo_error?, geo_options?)
我需要从 Google 地图或打开的街道地图中获取用户的经度和纬度。谁能告诉我在 react-native 中可以做到吗?
据我所知,您无法从地图本身获取用户位置。可以使用react-native的Geolocation API。
navigator.geolocation.getCurrentPosition(geo_success, geo_error?, geo_options?)
// 或
navigator.geolocation.watchPosition(geo_success, geo_error?, geo_options?)