当前位置:   article > 正文

android自定义百度地图导航,Android百度地图开发定位和路线导航

com.baidu.mapapi.map.texturemapview

package com.ly.dawn;

import com.baidu.location.BDLocation;

import com.baidu.location.BDLocationListener;

import com.baidu.location.LocationClient;

import com.baidu.location.LocationClientOption;

import com.baidu.mapapi.SDKInitializer;

import com.baidu.mapapi.map.BaiduMap;

import com.baidu.mapapi.map.BitmapDescriptor;

import com.baidu.mapapi.map.BitmapDescriptorFactory;

import com.baidu.mapapi.map.InfoWindow;

import com.baidu.mapapi.map.MapPoi;

import com.baidu.mapapi.map.MapStatus;

import com.baidu.mapapi.map.MapStatusUpdateFactory;

import com.baidu.mapapi.map.MyLocationConfiguration;

import com.baidu.mapapi.map.MyLocationConfiguration.LocationMode;

import com.baidu.mapapi.map.MyLocationData;

import com.baidu.mapapi.map.TextureMapView;

import com.baidu.mapapi.model.LatLng;

import com.baidu.mapapi.search.core.RouteLine;

import com.baidu.mapapi.search.core.SearchResult;

import com.baidu.mapapi.search.route.BikingRouteLine;

import com.baidu.mapapi.search.route.BikingRoutePlanOption;

import com.baidu.mapapi.search.route.BikingRouteResult;

import com.baidu.mapapi.search.route.DrivingRouteLine;

import com.baidu.mapapi.search.route.DrivingRoutePlanOption;

import com.baidu.mapapi.search.route.DrivingRouteResult;

import com.baidu.mapapi.search.route.OnGetRoutePlanResultListener;

import com.baidu.mapapi.search.route.PlanNode;

import com.baidu.mapapi.search.route.RoutePlanSearch;

import com.baidu.mapapi.search.route.TransitRouteLine;

import com.baidu.mapapi.search.route.TransitRoutePlanOption;

import com.baidu.mapapi.search.route.TransitRouteResult;

import com.baidu.mapapi.search.route.WalkingRouteLine;

import com.baidu.mapapi.search.route.WalkingRoutePlanOption;

import com.baidu.mapapi.search.route.WalkingRouteResult;

import com.ly.overlayutil.BikingRouteOverlay;

import com.ly.overlayutil.DrivingRouteOverlay;

import com.ly.overlayutil.OverlayManager;

import com.ly.overlayutil.TransitRouteOverlay;

import com.ly.overlayutil.WalkingRouteOverlay;

import android.app.Activity;

import android.os.Bundle;

import android.view.View;

import android.view.Window;

import android.view.View.OnClickListener;

import android.widget.Button;

import android.widget.EditText;

import android.widget.ImageButton;

import android.widget.TextView;

import android.widget.Toast;

/**

* 此demo用来展示如何进行驾车、步行、公交路线搜索并在地图使用RouteOverlay、TransitOverlay绘制

* 同时展示如何进行节点浏览并弹出泡泡

*/

public class DriverMenu extends Activity implements BaiduMap.OnMapClickListener, OnGetRoutePlanResultListener {

// 浏览路线节点相关

Button mBtnPre = null; // 上一个节点

Button mBtnNext = null; // 下一个节点

int nodeIndex = -1; // 节点索引,供浏览节点时使用

RouteLine route = null;

private String loaclcity = null;

OverlayManager routeOverlay = null;

private Button requestLocButton, go;

private ImageButton driver_inf;

private LocationMode mCurrentMode;

BitmapDescriptor mCurrentMarker;

boolean useDefaultIcon = false;

private TextView popupText = null, driver_city; // 泡泡view

private EditText start_edit, end_edit;

boolean isFirstLoc = true; // 是否首次定位

// 地图相关,使用继承MapView的MyRouteMapView目的是重写touch事件实现泡泡处理

// 如果不处理touch事件,则无需继承,直接使用MapView即可

// 地图控件

private TextureMapView mMapView = null;

private BaiduMap mBaidumap;

// 搜索相关

RoutePlanSearch mSearch = null; // 搜索模块,也可去掉地图模块独立使用

// 定位相关

LocationClient mLocClient;

public MyLocationListenner myListener = new MyLocationListenner();

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/菜鸟追梦旅行/article/detail/297677
推荐阅读
相关标签
  

闽ICP备14008679号