break
case 3:
console.log('获取信息超时')
break
case 4:
console.log('未知错误')
break
}
}
const opt = {
// 高精确度: true / false
enableHighAccuracy: true,
// 等待响应的最长时间 单位:毫秒
timeout: 5 * 1000,
// 应用程序愿意接受的缓存位置的最大年限
maximumAge: 0
}
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(handleSuccess, handleError, opt)
} else {
alert('Geolocation is not supported in your browser')
}









