さてさて、ここでは、私が思い付いた、それは私のためによく働く容易なソリューションです。私は最初にゼロに設定したグローバル変数 'timeStamp'を持っています。チェックリンク以下
Titanium.Geolocation.getCurrentPosition(function(e){
//only update fields if timer is still active
if(gpsTimer!=null)
{
//if the provider is not GPS or the timestamp is the same as the last, we do not want the results. We need to alert the user that they need to turn their GPS on.
if(e.provider['name']!="gps" || timeStamp==e.coords.timestamp)
{
//clear timeout
clearTimeout(gpsTimer);
gpsTimer = null;
//close window
get_gps_win.close();
//garbage collection
get_gps_win = null;
gpsLatField = null;
gpsLongField = null;
gpsAccuracyField = null;
timeStamp=0;
//alert user
alert("This feature is not available unless you have GPS turned on. Please turn GPS on and then try again.");
}
else
{
//update fields
gpsLatField.value=ConvertDDToDMSPlain(e.coords.latitude);
gpsLongField.value=ConvertDDToDMSPlain(e.coords.longitude);
gpsAccuracyField.value=e.coords.accuracy+" meters/"+(e.coords.accuracy*3.28084)+" feet";
gpsTimer=setTimeout(function() {
Titanium.Geolocation.fireEvent('location');
}, 1000);
}
timeStamp= e.coords.timestamp;
}
});
、それを試してみてください....ます。http://developer.appcelerator.com/question/120540/titaniumgeolocationlocationservicesenabled-is-always-true – JohnWhite