一、Geolocation使用: https://elemefe.github.io/vue-amap/#/zh-cn/plugins/geolocation
官网提示:由于 Chrome 、IOS10 等已不再支持非安全域的浏览器定位请求,为保证定位成功率和精度,请尽快升级您的站点到 HTTPS 。
记得在main.js中plugin中加入 ‘AMap.Geolocation’
没加报错内容:
二、 console发现Get IPlocation failed
module.exports = {
data () {
let self = this
return {
center: [121.59996, 31.197646],
lng: 0,
lat: 0,
loaded: false,
plugin: [{
pName: 'Geolocation',
events: {
init (o) {
// o 是高德地图定位插件实例
o.getCurrentPosition((status, result) => {
console.log(status, result)
i