我已经创建了sencha touch应用程序,我想尝试使用下面的代码获取android设备的当前位置。如何使用sencha touch仅获得gps位置?
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 possition更新当前位置。 像Android的谷歌地图应用程序的GPS图标总是稳定的,我想在我的应用程序中喜欢。
感谢您帮助我解决问题。 –