예제 #1
0
  private void handlePoiNearbySearch(String[] params, EBaiduMapBaseFragment eBaiduMapBaseFragment) {
    try {
      if (params == null || params.length == 0) {
        return;
      }
      JSONObject json = new JSONObject(params[0]);
      String lng = json.getString(EBaiduMapUtils.MAP_PARAMS_JSON_KEY_LNG);
      String lat = json.getString(EBaiduMapUtils.MAP_PARAMS_JSON_KEY_LAT);
      String radius = json.getString(EBaiduMapUtils.MAP_PARAMS_JSON_KEY_RADIUS);
      String searchKey = json.getString(EBaiduMapUtils.MAP_PARAMS_JSON_KEY_SEARCHKEY);
      String pageNum = json.getString(EBaiduMapUtils.MAP_PARAMS_JSON_KEY_PAGENUM);

      // change by waka
      if (eBaiduMapBaseFragment != null) {
        eBaiduMapBaseFragment.poiNearbySearch(
            Double.parseDouble(lng),
            Double.parseDouble(lat),
            (int) Float.parseFloat(radius),
            searchKey,
            Integer.parseInt(pageNum));
      } else {
        if (mMapBaseNoMapViewManager == null) {
          mMapBaseNoMapViewManager = new EBaiduMapBaseNoMapViewManager(mContext, this);
        }
        mMapBaseNoMapViewManager.poiNearbySearch(
            Double.parseDouble(lng),
            Double.parseDouble(lat),
            (int) Float.parseFloat(radius),
            searchKey,
            Integer.parseInt(pageNum));
      }

    } catch (Exception e) {
    }
  }
예제 #2
0
  private void handlePoiBoundSearch(String[] params, EBaiduMapBaseFragment eBaiduMapBaseFragment) {
    try {
      // 1
      JSONObject jsonObject = new JSONObject(params[0]);
      String northeastStr = jsonObject.getString(EBaiduMapUtils.MAP_PARAMS_JSON_KEY_NORTHEAST);
      // 2
      JSONObject jsonNortheastObj = new JSONObject(northeastStr);
      String lngNE = jsonNortheastObj.getString(EBaiduMapUtils.MAP_PARAMS_JSON_KEY_LNG);
      String latNE = jsonNortheastObj.getString(EBaiduMapUtils.MAP_PARAMS_JSON_KEY_LAT);
      // 3
      String southwestStr = jsonObject.getString(EBaiduMapUtils.MAP_PARAMS_JSON_KEY_SOUTHWEST);
      // 4
      JSONObject jsonSouthwestObj = new JSONObject(southwestStr);
      String lngSW = jsonSouthwestObj.getString(EBaiduMapUtils.MAP_PARAMS_JSON_KEY_LNG);
      String latSW = jsonSouthwestObj.getString(EBaiduMapUtils.MAP_PARAMS_JSON_KEY_LAT);
      // 5
      String searchKey = jsonObject.getString(EBaiduMapUtils.MAP_PARAMS_JSON_KEY_SEARCHKEY);
      String pageNum = jsonObject.getString(EBaiduMapUtils.MAP_PARAMS_JSON_KEY_PAGENUM);

      // change by waka
      if (eBaiduMapBaseFragment != null) {
        eBaiduMapBaseFragment.poiBoundSearch(
            Double.parseDouble(lngNE),
            Double.parseDouble(latNE),
            Double.parseDouble(lngSW),
            Double.parseDouble(latSW),
            searchKey,
            Integer.parseInt(pageNum));
      } else {
        if (mMapBaseNoMapViewManager == null) {
          mMapBaseNoMapViewManager = new EBaiduMapBaseNoMapViewManager(mContext, this);
        }
        mMapBaseNoMapViewManager.poiBoundSearch(
            Double.parseDouble(lngNE),
            Double.parseDouble(latNE),
            Double.parseDouble(lngSW),
            Double.parseDouble(latSW),
            searchKey,
            Integer.parseInt(pageNum));
      }

    } catch (Exception e) {
    }
  }
예제 #3
0
  private void handlePoiSearchInCity(String[] params, EBaiduMapBaseFragment eBaiduMapBaseFragment) {
    try {
      JSONObject json = new JSONObject(params[0]);
      String city = json.getString(EBaiduMapUtils.MAP_PARAMS_JSON_KEY_CITY);
      String searchKey = json.getString(EBaiduMapUtils.MAP_PARAMS_JSON_KEY_SEARCHKEY);
      int pageNum = Integer.parseInt(json.getString(EBaiduMapUtils.MAP_PARAMS_JSON_KEY_PAGENUM));

      // change by waka
      if (eBaiduMapBaseFragment != null) {
        eBaiduMapBaseFragment.poiSearchInCity(city, searchKey, pageNum);
      } else {
        if (mMapBaseNoMapViewManager == null) {
          mMapBaseNoMapViewManager = new EBaiduMapBaseNoMapViewManager(mContext, this);
        }
        mMapBaseNoMapViewManager.poiSearchInCity(city, searchKey, pageNum);
      }

    } catch (Exception e) {
      Log.e("waka", e.getMessage(), e);
    }
  }