| | |
| | | } |
| | | |
| | | if (specialAreaBeanList != null) { |
| | | Paint mPaint = new Paint(); |
| | | mPaint.setTextSize(20); |
| | | mPaint.setStyle(Paint.Style.FILL_AND_STROKE); |
| | | |
| | | for (x = 0; x < specialAreaBeanList.size(); x++) { |
| | | RoadExamMap2.SpecialAreaBean specialArea = specialAreaBeanList.get(x); |
| | | |
| | | List<Integer> points = specialArea.getArea(); |
| | | |
| | | switch (specialArea.getType()) { |
| | | case 0: |
| | | paint.setColor(Color.GREEN); |
| | | break; |
| | | case 1: |
| | | paint.setColor(Color.RED); |
| | | break; |
| | | case 2: |
| | | paint.setColor(Color.BLUE); |
| | | break; |
| | | case 3: |
| | | paint.setColor(Color.YELLOW); |
| | | break; |
| | | } |
| | | |
| | | |
| | | |
| | | for (int y = 0; y < points.size(); y++) { |
| | | if (y == 0) { |
| | | Path pathText = new Path(); |
| | | pathText.moveTo((float) (base_x + (map[points.get(y)][0] - min_x) * scale_x), (float) (base_y + (map[points.get(y)][1] - min_x) * scale_y)); |
| | | pathText.lineTo((float) (base_x + (map[points.get(y)][0] - min_x) * scale_x) + 60.0f, (float) (base_y + (map[points.get(y)][1] - min_x) * scale_y)); |
| | | canvas2.drawTextOnPath(String.format("%d: %d - %d", specialArea.getRoad(), specialArea.getId(), specialArea.getType()), pathText, 0, 0, mPaint);//逆时针生成 |
| | | } |
| | | |
| | | canvas2.drawCircle((float) (base_x + (map[points.get(y)][0] - min_x) * scale_x), (float) (base_y + (map[points.get(y)][1] - min_x) * scale_y), 2.5f, paint); |
| | | } |
| | | } |