1
我正在研究一个需要用户当前位置的应用程序。getCurrentPosition不更新位置
我面临的一个问题,即第一次设备获取用户当前位置的经纬度并缓存它,并且每次都返回相同的经纬度。有什么办法从设备中删除缓存的位置?任何帮助将不胜感激。
我的一些代码:
Titanium.Geolocation.purpose = "Recieve User Location";
Ti.Geolocation.accuracy = Ti.Geolocation.ACCURACY_BEST;
Ti.Geolocation.distanceFilter = 5;
Ti.Geolocation.activityType = Ti.Geolocation.ACTIVITYTYPE_FITNESS;
Titanium.Geolocation.getCurrentPosition(function(e)
{
if (!e.success || e.error)
{
alert('error ' + JSON.stringify(e.error));
return;
}
else
{
var longitudeFore;
var latitudeFore;
longitudeFore = e.coords.longitude;
latitudeFore = e.coords.latitude;
latitudeFore = parseFloat(latitudeFore);
longitudeFore = parseFloat(longitudeFore);
latitudeFore = latitudeFore.toFixed(6);
longitudeFore = longitudeFore.toFixed(6);
alert(latitudeFore + '\n' + longitudeFore);
}
});
请有人可以提出一个解决办法?