android百度地图api 怎么知道该搜索哪个城市

2025-05-15 06:56:09
推荐回答(3个)
回答1:

在onLocationChanged方法里获得自己当前的坐标
然后方法里写 mSearch.reverseGeocode(new GeoPoint((int)(location.getLatitude()*1e6),(int)(location.getLongitude()*1e6)));
然后再通过代码实行这个方法功能
public class MySearchListener implements MKSearchListener {
public void onGetAddrResult(MKAddrInfo result, int error){
MKGeocoderAddressComponent kk=result.addressComponents;
String city=kk.city;


回答2:

根据经纬度可以定位当前的地方属于哪个城市,你看看有没有相关的API!

回答3:

地图减小可见