【发布时间】:2014-03-12 05:52:00
【问题描述】:
我已经创建了 sencha touch 应用程序,我想尝试使用以下代码获取 android 设备的当前位置。
Ext.create('Ext.util.Geolocation',
autoUpdate: true,
allowHighAccuracy: true,
listeners: {
locationupdate: function(geo) {
latitude=geo.position.coords.latitude;
longitude=geo.position.coords.longitude;
if(Global.currentUserPositionMarker)
{
latlng1=new google.maps.LatLng(latitude, longitude);
currentPosMarker.setPosition(latlng1);
}
}
}
});
在我的设备中,gps 图标会闪烁,但无法获取设备 gps 位置的当前位置。
它总是从我的网络提供商处获取当前位置。
我想经常从设备 gps 位置更新当前位置。
像 google map 应用程序一样,gps 图标总是稳定的,我想在我的应用程序中喜欢它。
【问题讨论】:
标签: android gps sencha-touch-2