} else if (i == 1) {
t = "免费停车";
t = "免费停车";
case R.id.rl_route_tip:
case R.id.rl_route_tip:
ivListStatus.setImageResource(R.drawable.icon_route_list_open);
ivListStatus.setImageResource(R.drawable.icon_route_list_open);
tvOpen.setText("显示地图");
tvOpen.setText("显示地图");
// Animation animation1 = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.in_route);
// animation1.setDuration(2000);
lvRouteInfo.setVisibility(View.VISIBLE);
lvRouteInfo.setVisibility(View.VISIBLE);
AnimatorStart();
AnimatorStart();
// llOpenView.startAnimation(animation1);
break;
break;
case R.id.ll_open:
case R.id.ll_open:
if (canRoute == false) {
if (canRoute == false) {
showListData(routeOverlays, routeNum);
showListData(routeOverlays, routeNum);
ivListStatus.setImageResource(R.drawable.icon_route_list_open);
ivListStatus.setImageResource(R.drawable.icon_route_list_open);
tvOpen.setText("显示地图");
tvOpen.setText("显示地图");
// Animation animation1 = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.in_route);
// animation1.setDuration(2000);
lvRouteInfo.setVisibility(View.VISIBLE);
lvRouteInfo.setVisibility(View.VISIBLE);
AnimatorStart();
AnimatorStart();
dialog.show();
dialog.show();
new Handler().postDelayed(new Runnable() {
new Handler().postDelayed(new Runnable() {
public void run() {
public void run() {
// showSimpleBottomSheetGrid();
mapScreenShot();
mapScreenShot();
}
}
}, 1000);
}, 1000);
//必须告诉AMapNavi 你最后选择的哪条路
//必须告诉AMapNavi 你最后选择的哪条路
aMapNavi.selectRouteId(routeIds[0]);
aMapNavi.selectRouteId(routeIds[0]);
// Toast.makeText(this, "导航距离:" + (aMapNavi.getNaviPaths()).get(routeIds[0]).getAllLength() + "m" + "\n" + "导航时间:" + (aMapNavi.getNaviPaths()).get(routeIds[0]).getAllTime() + "s", Toast.LENGTH_SHORT).show();
// Toast.makeText(this, "导航时间:" + (aMapNavi.getNaviPaths()).get(routeIds[0]).getStrategy() + "z", Toast.LENGTH_SHORT).show();
final List<NaviLatLng> nl = (aMapNavi.getNaviPaths()).get(routeIds[0]).getCoordList();
final List<NaviLatLng> nl = (aMapNavi.getNaviPaths()).get(routeIds[0]).getCoordList();
// Toast.makeText(this, (aMapNavi.getNaviPaths()).get(routeIds[0]).getStrategy(), Toast.LENGTH_SHORT).show();
routeIndex++;
routeIndex++;
chooseRouteSuccess = true;
chooseRouteSuccess = true;
//必须告诉AMapNavi 你最后选择的哪条路
//必须告诉AMapNavi 你最后选择的哪条路
aMapNavi.selectRouteId(routeIds[2]);
aMapNavi.selectRouteId(routeIds[2]);
// Toast.makeText(this, "导航距离:" + (aMapNavi.getNaviPaths()).get(routeIds[0]).getAllLength() + "m" + "\n" + "导航时间:" + (aMapNavi.getNaviPaths()).get(routeIds[0]).getAllTime() + "s", Toast.LENGTH_SHORT).show();
// Toast.makeText(this, "导航时间:" + (aMapNavi.getNaviPaths()).get(routeIds[2]).getStrategy() + "z", Toast.LENGTH_SHORT).show();
final List<NaviLatLng> nlll = (aMapNavi.getNaviPaths()).get(routeIds[2]).getCoordList();
final List<NaviLatLng> nlll = (aMapNavi.getNaviPaths()).get(routeIds[2]).getCoordList();
// Toast.makeText(this, (aMapNavi.getNaviPaths()).get(routeIds[2]).getStrategy(), Toast.LENGTH_SHORT).show();
routeIndex++;
routeIndex++;
chooseRouteSuccess = true;
chooseRouteSuccess = true;
MobclickAgent.onEvent(getApplicationContext(), "0308");
MobclickAgent.onEvent(getApplicationContext(), "0308");
if ("0".equals(save_id)) {
if ("0".equals(save_id)) {
if (noNameCount == haveNameCount)
if (noNameCount == haveNameCount)
// LogUtils.e(noNameCount+"---"+haveNameCount);
creatSaveData();
creatSaveData();
} else {
} else {
AlertDialog.Builder builder = new AlertDialog.Builder(RoutePlanMapActivity.this);
AlertDialog.Builder builder = new AlertDialog.Builder(RoutePlanMapActivity.this);
@Override
@Override
public void onClick(DialogInterface dialog, int which) {
public void onClick(DialogInterface dialog, int which) {
if (noNameCount == haveNameCount)
if (noNameCount == haveNameCount)
// LogUtils.e(noNameCount+"---"+haveNameCount);
creatSaveData();
creatSaveData();
}
}
});
});
} else {
} else {
if (select == 0) {
if (select == 0) {
exchangeView(1);
exchangeView(1);
// amap.clear();
for (int i = 0; i < routeIds.length; i++) {
for (int i = 0; i < routeIds.length; i++) {
AMapNaviPath path = (aMapNavi.getNaviPaths()).get(routeIds[i]);
AMapNaviPath path = (aMapNavi.getNaviPaths()).get(routeIds[i]);
//你可以通过这个AMapNaviPath生成一个RouteOverLay用于加在地图上
//你可以通过这个AMapNaviPath生成一个RouteOverLay用于加在地图上
}
}
routeOverlays.get(routeIds[0]).setTransparency(0.8f);
routeOverlays.get(routeIds[0]).setTransparency(0.8f);
//必须告诉AMapNavi 你最后选择的哪条路
//必须告诉AMapNavi 你最后选择的哪条路
aMapNavi.selectRouteId(routeIds[0]);
aMapNavi.selectRouteId(routeIds[0]);
// Toast.makeText(this, "导航距离:" + (aMapNavi.getNaviPaths()).get(routeIds[0]).getAllLength() + "m" + "\n" + "导航时间:" + (aMapNavi.getNaviPaths()).get(routeIds[0]).getAllTime() + "s", Toast.LENGTH_SHORT).show();
// Toast.makeText(this, "导航时间:" + (aMapNavi.getNaviPaths()).get(routeIds[0]).getStrategy() + "z", Toast.LENGTH_SHORT).show();
List<NaviLatLng> nnll = (aMapNavi.getNaviPaths()).get(routeIds[0]).getCoordList();
List<NaviLatLng> nnll = (aMapNavi.getNaviPaths()).get(routeIds[0]).getCoordList();
// Toast.makeText(this, (aMapNavi.getNaviPaths()).get(routeIds[0]).getStrategy(), Toast.LENGTH_SHORT).show();
routeIndex++;
routeIndex++;
chooseRouteSuccess = true;
chooseRouteSuccess = true;
// if (nnll != null) {
// getRouteZhan(nnll);
// }
}
}
if (chooseRouteSuccess && calculateSuccess) {
if (chooseRouteSuccess && calculateSuccess) {
MobclickAgent.onEvent(getApplicationContext(), "0309");
MobclickAgent.onEvent(getApplicationContext(), "0309");
break;
break;
case R.id.iv_back:
case R.id.iv_back:
// tag = 0;
finish();
finish();
// amap.setLocationSource(this);// 设置定位监听
// amap.setMyLocationEnabled(true);// 是否可触发定位并显示定位层
//// ?aMap.moveCamera(CameraUpdateFactory.zoomTo(14));
// mlocationClient.startLocation();
break;
break;
default:
default:
break;
break;
}
}
if (strategyFlag >= 0) {
if (strategyFlag >= 0) {
aMapNavi.calculateDriveRoute(startList, endList, zhongList, strategyFlag);
aMapNavi.calculateDriveRoute(startList, endList, zhongList, strategyFlag);
// Toast.makeText(getApplicationContext(), "策略:" + strategyFlag, Toast.LENGTH_LONG).show();
}
}
rl_infowindow.setVisibility(View.GONE);
rl_infowindow.setVisibility(View.GONE);
} else {
} else {
}
}
private void getBaidu(Double jing, Double wei) {
double x_pi = 3.14159265358979324 * 3000.0 / 180.0;
double x = jing;
double y = wei;
double z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * x_pi);
double theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi);
bd_lon = z * Math.cos(theta) + 0.0065;
bd_lat = z * Math.sin(theta) + 0.006;
}
private boolean isAvilible(Context context, String packageName) {
//获取packagemanager
final PackageManager packageManager = context.getPackageManager();
//获取所有已安装程序的包信息
List<PackageInfo> packageInfos = packageManager.getInstalledPackages(0);
//用于存储所有已安装程序的包名
List<String> packageNames = new ArrayList<String>();
//从pinfo中将包名字逐一取出,压入pName list中
if (packageInfos != null) {
for (int i = 0; i < packageInfos.size(); i++) {
String packName = packageInfos.get(i).packageName;
packageNames.add(packName);
}
}
//判断packageNames中是否有目标程序的包名,有TRUE,没有FALSE
return packageNames.contains(packageName);
}
public static Bitmap getBitmapFromView(View view) {
public static Bitmap getBitmapFromView(View view) {
view.destroyDrawingCache();
view.destroyDrawingCache();
view.measure(View.MeasureSpec.makeMeasureSpec(0,
view.measure(View.MeasureSpec.makeMeasureSpec(0,