Android的; MapView类的,我怎么可以设置默认位置? [英] Android; MapView, how can I set default location?

查看:258
本文介绍了Android的; MapView类的,我怎么可以设置默认位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Android中的MapView,我怎么可以设置默认位置,这样每次我加载了这个应用程序,它会自动中心/缩放位置在伦敦?

Using the MapView in android, how can I set a default location, so that everytime I load up this application, it automatically centers/zooms location in on London?

推荐答案

首先,让控制器对于给定的图:

Firstly, get the controller for the given map:

MapController myMapController = myMapView.getController();

然后调用:

myMapController.setCenter(new GeoPoint())

这将设置在给定的GeoPoint地图的中心。

This will set the center of the map on the given GeoPoint.

请参阅文档的<一个href="http://$c$c.google.com/intl/en-EN/android/add-ons/google-apis/reference/com/google/android/maps/MapView.html">MapView和<一href="http://$c$c.google.com/intl/en-EN/android/add-ons/google-apis/reference/com/google/android/maps/MapController.html">MapController更多资讯

See docs for MapView and MapController for more info

这篇关于Android的; MapView类的,我怎么可以设置默认位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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