安卓:m​​yLocationOverlay.runOnFirstFix太慢 [英] Android: myLocationOverlay.runOnFirstFix Too Slow

查看:136
本文介绍了安卓:m​​yLocationOverlay.runOnFirstFix太慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有人在加速的过程中设置为谷歌地图的初始点,围绕你的当前位置的任何想法。这必须是可能的正常工作,在本地谷歌地图应用程序,但在这里我使用的是明显的延迟在我的自定义应用程序:

  myLocationOverlay.runOnFirstFix(新的Runnable(){
        公共无效的run(){
            找我();
        }
    });
 

在这里找到我,包括:

 如果(myLocationOverlay.getMyLocation()!= NULL){
    。mapView.getController()animateTo(myLocationOverlay.getMyLocation());
}
 

解决方案
您只使用GPS定位

?如果您要求基于网络位置的当前位置,并接受一个小的过时的值(一个小时也许?),你应该几乎立刻得到用户的位置。

Does anybody have any ideas in speeding up the process for setting the initial point for Google Maps, centering on your current location. This must be possible as it works fine in the native Google Maps app but has a noticeable delay in my custom application where I am using:

myLocationOverlay.runOnFirstFix(new Runnable() {
        public void run() {             
            findMe();
        }           
    });

where find me includes:

if(myLocationOverlay.getMyLocation() != null){
    mapView.getController().animateTo(myLocationOverlay.getMyLocation());
}

解决方案

Are you using only GPS location? If you request the current location based on the network location and accept a little stale values (up to an hour maybe?), you should get the user's location practically immediately.

这篇关于安卓:m​​yLocationOverlay.runOnFirstFix太慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆