Ejemplo n.º 1
0
  /**
   * 发起路线规划搜索示例
   *
   * @param v
   */
  void SearchButtonProcess(View v) {
    // 重置浏览节点的路线数据
    route = null;
    routeOverlay = null;
    transitOverlay = null;
    mBtnPre.setVisibility(View.INVISIBLE);
    mBtnNext.setVisibility(View.INVISIBLE);

    // 对起点终点的name进行赋值,也可以直接对坐标赋值,赋值坐标则将根据坐标进行搜索
    MKPlanNode stNode = new MKPlanNode();
    stNode.name = editSt.getText().toString();
    if (ptStart != null) {
      stNode.pt = ptStart;
    }

    MKPlanNode enNode = new MKPlanNode();
    enNode.name = editEn.getText().toString();
    if (ptEnd != null) {
      enNode.pt = ptEnd;
    }
    pb.show();
    // 实际使用中请对起点终点城市进行正确的设定
    if (mBtnDrive.equals(v)) {
      mSearch.drivingSearch("上海", stNode, "上海", enNode);
    } else if (mBtnTransit.equals(v)) {
      mSearch.transitSearch("上海", stNode, enNode);
    } else if (mBtnWalk.equals(v)) {
      mSearch.walkingSearch("上海", stNode, "上海", enNode);
    }
    ptEnd = null;
    ptStart = null;
  }
Ejemplo n.º 2
0
  @Override
  public void menuActiviated() {
    // TODO Auto-generated method stub
    /** 这里进行汽车的dialog回调 */
    final MKPlanNode startNode = new MKPlanNode();
    final MKPlanNode endNode = new MKPlanNode();

    startNode.pt =
        new GeoPoint(
            (int) (SEMapApplication.locationdata.latitude * 1000000),
            (int) (SEMapApplication.locationdata.longitude * 1000000));
    endNode.pt = pri.h.semap.myMap.currentpoint;
    pri.h.semap.myMap.mapsearch.drivingSearch(myMap.myCity, startNode, myMap.myCity, endNode);
    if (myMap.PieMenu != null) ((LinearLayout) myMap.PieMenu.getParent()).removeView(myMap.PieMenu);
    Toast.makeText(context, "正在查询...", Toast.LENGTH_SHORT).show();
  }