- public void showAddress()
- String address="";
- int cLat = (int)(112.938247*1e6) ;
- int cLon = (int)(28.229519*1e6) ;
- GeoPoint <b>point</b>=new GeoPoint(cLon, cLat) ;//得到个已知经纬度的点的地址
- System.out.println(app.mBMapManager);
- if(mKSearch.init(app.mBMapManager, new SearchListener())){//系统老是报该处空指针异常
- mKSearch.reverseGeocode(point);
- }
-
-
-
- }
- class SearchListener implements MKSearchListener{
- @Override
- public void onGetWalkingRouteResult(MKWalkingRouteResult arg0, int arg1) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void onGetTransitRouteResult(MKTransitRouteResult arg0, int arg1) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void onGetSuggestionResult(MKSuggestionResult arg0, int arg1) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void onGetShareUrlResult(MKShareUrlResult arg0, int arg1, int arg2) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void onGetPoiResult(MKPoiResult arg0, int arg1, int arg2) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void onGetPoiDetailSearchResult(int arg0, int arg1) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void onGetDrivingRouteResult(MKDrivingRouteResult arg0, int arg1) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void onGetBusDetailResult(MKBusLineResult arg0, int arg1) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void onGetAddrResult(MKAddrInfo arg0, int arg1) {//这个方法得到
- <b>point</b> 的地址
- // TODO Auto-generated method stub
- System.out.println("onGetAddrResult....."+arg1);
- System.out.println(arg0.strAddr);
- }
- }
复制代码
|