【发布时间】:2016-09-06 14:21:54
【问题描述】:
我有一些用于从浏览器获取 GPS 的 javascript 代码。 它可以在:Chrome (Window 7-PC)、Firefox (Window 7-PC)、Firefox (Android 5.0-Smartphone) 中获得精确的 GPS。 但是使用 Chrome (Android 5.0-Smartphone) 无法获取 GPS。 我的代码:
function getLocation() {
if (navigator && navigator.geolocation) {
navigator.geolocation.getCurrentPosition(successGPS, errorGPS, {enableHighAccuracy: true, timeout: 60000});
} else {
console.log('Geolocation is not supported');}}
function successGPS(position) {
latLng_taxi = new google.maps.LatLng(position.coords.latitude,
position.coords.longitude);
alert(latLng_taxi);}
function errorGPS() {
alert("Cant get GPS");}
请告诉我我的问题以及如何使用 Chrome (Android) 获取 GPS
【问题讨论】:
标签: google-maps google-chrome gps android-gps