如何计算Android Geocoder结果的缩放级别
|
我正在使用Android的Geocoder来允许在基于地图的应用程序中搜索位置。地理编码效果很好,并且该应用程序已成功将MapView更新到地理编码结果中。问题是我不知道移动到新位置时要使用什么缩放级别。
location_query
参数可以是街道,也可以是国家-我如何知道放大多远才能显示最终位置?也就是说,我用replace1代替什么?
public void goToPlace(String location_query) {
List<Address> addresses;
Geocoder gc = new Geocoder(_ctx);
addresses = gc.getFromLocationName(location_query, 1);
if (addresses != null) {
Address a = addresses.get(0);
int lat = (int) (a.getLatitude() * 1E6);
int lon = (int) (a.getLongitude() * 1E6);
mapController.animateTo(new GeoPoint(lat, lon));
mapController.setZoom(???);
}
}
没有找到相关结果
已邀请:
3 个回复
卧沫
揽芳僵迷仇
味芯憨