| | |
| | | import com.amap.api.navi.AMapNaviListener; |
| | | import com.amap.api.navi.AMapNaviView; |
| | | import com.amap.api.navi.AMapNaviViewListener; |
| | | import com.amap.api.navi.enums.BroadcastMode; |
| | | import com.amap.api.navi.model.AMapCalcRouteResult; |
| | | import com.amap.api.navi.model.AMapLaneInfo; |
| | | import com.amap.api.navi.model.AMapModelCross; |
| | |
| | | |
| | | |
| | | public class BaseGpsMapActivity extends Activity implements AMapNaviListener, AMapNaviViewListener { |
| | | |
| | | protected AMapNaviView mAMapNaviView; |
| | | protected AMapNavi mAMapNavi; |
| | | protected TTSController mTtsManager; |
| | |
| | | mStartLatlng = new NaviLatLng(mStart.latitude, mStart.longitude); |
| | | mEndLatlng = new NaviLatLng(mEnd.latitude, mEnd.longitude); |
| | | //设置模拟导航的行车速度 |
| | | mAMapNavi.setEmulatorNaviSpeed(75); |
| | | mAMapNavi.setEmulatorNaviSpeed(100); |
| | | mAMapNavi.setBroadcastMode(BroadcastMode.DETAIL); |
| | | |
| | | sList.add(mStartLatlng); |
| | | eList.add(mEndLatlng); |
| | | } |
| | |
| | | @Override |
| | | public void onStartNavi(int type) { |
| | | //开始导航回调 |
| | | // mTtsManager.setVideoText("准备出发"); |
| | | } |
| | | |
| | | @Override |
| | |
| | | @Override |
| | | public void onGetNavigationText(int type, String text) { |
| | | //播报类型和播报文字回调 |
| | | mTtsManager.setVideoText(text); |
| | | AMapNavi.setTtsPlaying(true); |
| | | } |
| | | |
| | | @Override |
| | |
| | | public void notifyParallelRoad(int i) { |
| | | if (i == 0) { |
| | | // Toast.makeText(this, "当前在主辅路过渡", Toast.LENGTH_SHORT).show(); |
| | | mTtsManager.setVideoText("当前在主辅路过渡"); |
| | | // mTtsManager.setVideoText("当前在主辅路过渡"); |
| | | Log.d("wlx", "当前在主辅路过渡"); |
| | | return; |
| | | } |
| | | if (i == 1) { |
| | | // Toast.makeText(this, "当前在主路", Toast.LENGTH_SHORT).show(); |
| | | mTtsManager.setVideoText("当前在主路"); |
| | | // mTtsManager.setVideoText("当前在主路"); |
| | | Log.d("wlx", "当前在主路"); |
| | | return; |
| | | } |
| | | if (i == 2) { |
| | | // Toast.makeText(this, "当前在辅路", Toast.LENGTH_SHORT).show(); |
| | | mTtsManager.setVideoText("当前在辅路"); |
| | | // mTtsManager.setVideoText("当前在辅路"); |
| | | Log.d("wlx", "当前在辅路"); |
| | | } |
| | | } |
| | |
| | | public boolean onNaviBackClick() { |
| | | return false; |
| | | } |
| | | |
| | | |
| | | } |