Ionic framework 如何在离子3中获得更精确的地理定位
我有一个已经开发的应用程序,需要在我请求时提供准确的地理位置信息 到目前为止,它只在大约40%的时间内提供正确的信息。有什么我遗漏的吗 下面是为获取它而编写的函数Ionic framework 如何在离子3中获得更精确的地理定位,ionic-framework,ionic3,Ionic Framework,Ionic3,我有一个已经开发的应用程序,需要在我请求时提供准确的地理位置信息 到目前为止,它只在大约40%的时间内提供正确的信息。有什么我遗漏的吗 下面是为获取它而编写的函数 initMap(){ let optionsGPS = {timeout: 20000, enableHighAccuracy: true}; this.geolocation.getCurrentPosition(optionsGPS).then((position) => { let latLng = new go
initMap(){
let optionsGPS = {timeout: 20000, enableHighAccuracy: true};
this.geolocation.getCurrentPosition(optionsGPS).then((position) => {
let latLng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
let mylat = position.coords.latitude;
let mylng = position.coords.longitude;
let mylatlng = {
'lat': mylat,
'lng': mylng
};
let mapOptions = {
center: latLng,
zoom: 16,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
this.map = new google.maps.Map(this.mapElement.nativeElement, mapOptions);
this.addMarker(mylatlng, 'You', 'you');
for (let provider of this.myProviders) {
this.addMarker(provider, provider['name'], provider['type']);
}
});
}
任何建议都将不胜感激。你们可以试一下,你们可以得到位置某物大约五倍,然后平均他们。你们可以试一下,你们可以得到位置某物大约五倍,然后平均他们。