[]gps定位获取当前城市名字

if(Geolocation.supported)
{
Geolocation.enableHighAccuracy = true;
Geolocation.getCurrentPosition(Handler.create(this,function(pos):void
{
alert("pos:"+pos.coords.longitude+","+pos.coords.latitude);
}),Handler.create(this,function(error):void
{
switch (error.code)
{
case Geolocation.PERMISSION_DENIED:
alert("位置服务被拒绝,请检查您的GPS和定位设置");
break;
case Geolocation.POSITION_UNAVAILABLE:
alert("暂时获取不到位置信息");
break;
case Geolocation.TIMEOUT:
alert("获取位置信息超时");
break;
default:
alert("加载地图时出现未知错误");
break;
}
}));
}else
alert("不支持");



为毛获取不到
已邀请:

Laya_XS

赞同来自: 130*****113

参考下官方的例子,如果解决不了,可以排查下代码:http://layaair.ldc.layabox.com/demo/?InputDevice_Map
提交问题请别就带“为毛”这样的关键字,别让自己的人品改变了,谢谢!

要回复问题请先

商务合作
商务合作