コード例 #1
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;
       }
     }
   }
 }
コード例 #2
0
  private void checkInitRoutes() {
    Bundle bundle = getIntent().getExtras();
    if (bundle == null) {
      toPointCenter();
      ToastShow.show(this, "参数错误,没有轨迹的起始和结束时间!");
      return;
    }
    try {
      String topName = bundle.getString(PathActivity.ARGS_TOP_NAME);
      String begTime = bundle.getString(PathActivity.ARGS_BEG_DATE);
      String endTime = bundle.getString(PathActivity.ARGS_END_DATE);

      mActionBar.setTitle(topName);
      if (begTime != null && endTime != null) {
        mBegDateTime = DateTime.from(begTime);
        mBtnBegTime.setText(mBegDateTime.toString(mDateTimeFormat));
        mEndDateTime = DateTime.from(endTime);
        mBtnEndTime.setText(mEndDateTime.toString(mDateTimeFormat));
        sendRoutesRequest(begTime, endTime);
      } else {
        {
          mEndDateTime = DateTime.now();
          mBegDateTime = DateTime.from(mEndDateTime);
          // 默认当天6点开始
          mBegDateTime.setHours(6);
          mBegDateTime.setMinutes(0);
          // mEndDateTime.addDay(-3);// 默认查最近三天的记录
        }
        mBtnBegTime.setText(mBegDateTime.toString(mDateTimeFormat));
        mBtnEndTime.setText(mEndDateTime.toString(mDateTimeFormat));

        toCaricoCenter();
      }
    } catch (Exception ex) {
      ex.printStackTrace();
      // ToastShow.show(this, "Intent参数不正确!");
    }
  }
コード例 #3
0
  protected void onHandlerSuccess(Object obj) {
    mActionBar.setProgressBarVisibility(View.GONE);
    if (obj != null) {
      @SuppressWarnings("unchecked")
      List<GPSInfo> lstWgs84HashMap = (List<GPSInfo>) obj;
      if (lstWgs84HashMap.size() > 0) { // 至少得有一个点嘛(第一个,最后一个有没有可能一样呢?有的)
        showMapViewRoutes(lstWgs84HashMap);
      } else {
        ToastShow.show(mPathActivity, R.string.datetime_toast_nodata);

        if (mMapView.getOverlays().contains(mRoutesOverlay)) {
          mMapView.getOverlays().remove(mRoutesOverlay);
          // mRoutesOverlay.onDestroy();
          mRoutesOverlay = null;
        }
        // if (mMapView.getOverlays().contains(mMovingOverlay)) {
        // mMapView.getOverlays().remove(mMovingOverlay);
        // mMovingOverlay.onDestroy();
        // mMovingOverlay = null;
        // }
      }
    }
  }