| | |
| | | |
| | | Log.d(TAG, String.format("DrawMapAll scale_x = %d 车头据 = %f", scale_x, Math.sqrt(Math.pow(car[0][0], 2) + Math.pow(car[0][1], 2)))); |
| | | |
| | | canvas2.drawColor(Color.WHITE); |
| | | canvas2.drawColor(Color.BLACK); |
| | | |
| | | // 画车轮 |
| | | paint.setStyle(Paint.Style.FILL_AND_STROKE); |
| | |
| | | canvas2.drawCircle((float) (base_x + (car[tire.get(3)][0] - min_x) * scale_x), (float) (base_y + (car[tire.get(3)][1] - min_y) * scale_y), 2.5f, paint); |
| | | |
| | | paint.setStyle(Paint.Style.STROKE); |
| | | paint.setColor(Color.BLACK); |
| | | paint.setStrokeWidth(1.5f); |
| | | paint.setColor(Color.GREEN); |
| | | paint.setStrokeWidth(2.0f); |
| | | |
| | | Path path = new Path(); |
| | | Path carpath = new Path(); |
| | | // 画车体 |
| | | path.moveTo((float) (base_x + (car[body.get(0)][0] - min_x) * scale_x), (float) (base_y + (car[body.get(0)][1] - min_y) * scale_y)); |
| | | carpath.moveTo((float) (base_x + (car[body.get(0)][0] - min_x) * scale_x), (float) (base_y + (car[body.get(0)][1] - min_y) * scale_y)); |
| | | for (int i = 1; i < body.size(); i++){ |
| | | // Log.d(TAG, "for 循环 DrawMap to X = " + (float) (base_x + (car[body.get(i)][0] - min_x) * scale_x)+ " Y = " + (float) (base_y + (car[body.get(i)][1] - min_y) * scale_y)); |
| | | path.lineTo((float) (base_x + (car[body.get(i)][0] - min_x) * scale_x), (float) (base_y + (car[body.get(i)][1] - min_y) * scale_y)); |
| | | carpath.lineTo((float) (base_x + (car[body.get(i)][0] - min_x) * scale_x), (float) (base_y + (car[body.get(i)][1] - min_y) * scale_y)); |
| | | } |
| | | |
| | | path.close(); |
| | | carpath.close(); |
| | | |
| | | canvas2.drawPath(path, paint); |
| | | canvas2.drawPath(carpath, paint); |
| | | |
| | | Path path = new Path(); |
| | | |
| | | // 画地图 |
| | | if (roadBeanList != null) { |
| | |
| | | if (leftEdge != null) { |
| | | Log.d(TAG, "绘制左路沿"); |
| | | |
| | | paint.setStrokeWidth(2.0f); |
| | | paint.setColor(Color.BLUE); |
| | | paint.setStrokeWidth(3.0f); |
| | | paint.setColor(Color.YELLOW); |
| | | |
| | | for (int y = 0; y < leftEdge.size(); y++) { |
| | | RoadExamMap2.RoadBean.EdgeBean edgeBean = leftEdge.get(y); |
| | |
| | | if (rightEdge != null) { |
| | | Log.d(TAG, "绘制右路沿"); |
| | | |
| | | paint.setStrokeWidth(2.0f); |
| | | paint.setStrokeWidth(3.0f); |
| | | paint.setColor(Color.YELLOW); |
| | | |
| | | for (int y = 0; y < rightEdge.size(); y++) { |
| | |
| | | } |
| | | |
| | | List<List<List<RoadExamMap2.RoadBean.SeparateBean>>> separate = road.getSeparate(); |
| | | paint.setStrokeWidth(1.0f); |
| | | paint.setColor(Color.BLACK); |
| | | paint.setStrokeWidth(2.0f); |
| | | paint.setColor(Color.WHITE); |
| | | |
| | | if (separate != null) { |
| | | Log.d(TAG, "绘制道路分割线 段数量 = " + separate.size()); |
| | |
| | | Paint mPaint = new Paint(); |
| | | mPaint.setTextSize(20); |
| | | mPaint.setStyle(Paint.Style.FILL_AND_STROKE); |
| | | |
| | | mPaint.setColor(Color.WHITE); |
| | | for (x = 0; x < specialAreaBeanList.size(); x++) { |
| | | RoadExamMap2.SpecialAreaBean specialArea = specialAreaBeanList.get(x); |
| | | |