Ejemplo n.º 1
0
  private void showMapViewRoutes(List<GPSInfo> lstWgs84HashMap) {
    ArrayList<GeoPoint> lstWgs84GeoPoint = RoutesHelper.getWgs84GeoPoint(lstWgs84HashMap);

    // mRoutesOverlay
    if (mMapView != null) {
      try {
        if (mRoutesOverlay != null) {
          if (mMapView.getOverlays().contains(mRoutesOverlay)) {
            mMapView.getOverlays().remove(mRoutesOverlay);
            mRoutesOverlay = null;
          }
        }
        mRoutesOverlay = new RoutesOverlay(mPathActivity, mMapView);
        {
          mRoutesOverlay.setOnOverlayEventListener(this);

          mRoutesOverlay.setData(lstWgs84GeoPoint);
        }
        mMapView.getOverlays().add(0, mRoutesOverlay);
        mMapView.invalidate();
        mMapView.getController().animateTo(lstWgs84GeoPoint.get(0));
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
  }
Ejemplo n.º 2
0
 public void onGetAddrResult(MKAddrInfo arg0, int arg1) {
   // arg0.geoPt
   if (arg1 != 0 || arg0 == null) {
     // 异常了
     ToastShow.show(mPathActivity, "地址翻译出错");
     return;
   }
   synchronized (mReqCodeQueue) {
     Integer reqCode = mReqCodeQueue.poll();
     if (reqCode != null) {
       switch (reqCode.intValue()) {
         case RoutesOverlay.REVERSE_GEOCODE:
           if (mRoutesOverlay != null) mRoutesOverlay.onGetAddrResult(arg0);
           break;
         case MxLocationOverlay.REVERSE_GEOCODE:
           if (mMxLocationOverlay != null) mMxLocationOverlay.onGetAddrResult(arg0);
           break;
       }
     }
   }
 }