| | |
| | | } |
| | | } |
| | | |
| | | for (int i = 0, j = 0; i < map[k].length && j < map_other.length; i++, j++) { |
| | | path.moveTo((float) (base_x + (map[k][i][0] - min_x) * scale_x), (float) (base_y + (map[k][i][1] - min_y) * scale_y)); |
| | | path.lineTo((float) (base_x + (map_other[j][0] - min_x) * scale_x), (float) (base_y + (map_other[j][1] - min_y) * scale_y)); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | // 4 - 曲线行驶 |
| | | // 5 - 直角转弯 |
| | | StringBuffer buffer=null; |
| | | List<ExamMap> examMaps; |
| | | ExamMap examMaps; |
| | | String newmap = null; |
| | | String mapPath = ExamPlatformData.getInstance().getMapPath(); |
| | | if (!TextUtils.isEmpty(mapPath)){ |
| | |
| | | buffer = FileUtil.readAssetTxtFile(_mActivity,Constant.MAP); |
| | | } |
| | | |
| | | Type type = new TypeToken<List<ExamMap>>(){}.getType(); |
| | | Type type = new TypeToken<ExamMap>(){}.getType(); |
| | | if (buffer != null){ |
| | | examMaps= gson.fromJson(buffer.toString().trim(), type); |
| | | }else{ |
| | |
| | | } |
| | | map_id = -1; |
| | | if (map_id == -1){ |
| | | allMap =new double[examMaps.size()][][]; |
| | | for (int i = 0; i < examMaps.size(); i++) { |
| | | ExamMap examMap = examMaps.get(i); |
| | | allMap =new double[examMaps.getItems().size()][][]; |
| | | for (int i = 0; i < examMaps.getItems().size(); i++) { |
| | | ExamMap.ItemsBean examMap = examMaps.getItems().get(i); |
| | | |
| | | List<ExamMap.PointBean> pointBeanList = examMap.getPoint(); |
| | | List<ExamMap.ItemsBean.PointBean> pointBeanList = examMap.getPoint(); |
| | | |
| | | for(int j=0; j<pointBeanList.size();j++){ |
| | | List<Double> xys = pointBeanList.get(j).getXy(); |
| | |
| | | |
| | | DrawMapAll(yaw, mainAnt,allMap, mapOther, car,body,tire); |
| | | }else{ |
| | | for (int i = 0; i < examMaps.size(); i++) { |
| | | ExamMap examMap = examMaps.get(i); |
| | | for (int i = 0; i < examMaps.getItems().size(); i++) { |
| | | ExamMap.ItemsBean examMap = examMaps.getItems().get(i); |
| | | if (map_id == examMap.getId()){ |
| | | List<ExamMap.PointBean> pointBeanList = examMap.getPoint(); |
| | | List<ExamMap.ItemsBean.PointBean> pointBeanList = examMap.getPoint(); |
| | | |
| | | for(int j=0; j<pointBeanList.size();j++){ |
| | | List<Double> xys = pointBeanList.get(j).getXy(); |