开发者

Android: myLocationOverlay.runOnFirstFix Too Slow

Does anybody have any ideas in speeding up the process for setting the initial point for Google Maps, centering on your current l开发者_运维百科ocation. 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());
}


As far as I know, the native Maps service and application is loading on system startup and prepares itself in the background wchich makes it load maps faster. You could check it in running processes in the settings. You cloud do the same or make dirty workaround wchich I did once: display progress dialog before everything load (after setContentView in onLoad) and close it after you done everything on the map you need ;)


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜