无法在Internet Explorer 11中加载地理位置

时间:2019-02-12 06:43:42

标签: angular google-maps internet-explorer-11

我正在处理角度6,并且正在尝试使用Internet Explorer 11中的Google地图的地理位置获取当前位置的经度/纬度。但是无法获取坐标。请在下面找到我的代码,

if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(position => {
this.location = position.coords;
this.lat = +this.location["latitude"].toFixed(6);
this.lng = +this.location["longitude"].toFixed(6);
});
}

0 个答案:

没有答案