【发布时间】:2014-01-02 09:58:31
【问题描述】:
我正在使用 flex 4.6 移动应用程序当我使用 gps 传感器获取当前位置时我的问题需要很长时间在 35 秒的限制内进行 2 次更新我的代码是
protected function GetGPSposition():void
{
//Initialize the location sensor.
geo = new Geolocation();
if(! geo.muted){ //gps is enabled
geo = new Geolocation();
geo.setRequestedUpdateInterval(10);
geo.addEventListener(GeolocationEvent.UPDATE, handleLocationRequest);
geo.addEventListener(StatusEvent.STATUS,handleErrorGPS);
}
else if(geo.muted){ //gps is disabled
(new GPS2()).open(this, false) ;
internetGpsEnable = false ;
}
}
protected function handleLocationRequest(event:GeolocationEvent):void
{
counter++ ;
if (counter > 1)
{
long = event.longitude;
lat = event.latitude;
internetGpsEnable =true ;
lblGPS.text = null;
}
}
注意:GetGPSposition() 在 creationComplete 中工作 如果有任何方法可以尽快获得经度和纬度,任何人都可以建议我。 提前感谢您的帮助。
【问题讨论】:
标签: android actionscript-3 apache-flex gps flexbuilder