| | |
| | | if (maps != null&& maps.size()>0){ |
| | | for (int i = 0; i < maps.size(); i++) { |
| | | RoadExamMap.MapsBean mapItem = maps.get(i); |
| | | |
| | | if (mapItem.getItem() == ALL_MAP){ |
| | | List<List<Integer>> redLines= mapItem.getRed_line(); |
| | | List<List<Integer>> greenLines = mapItem.getGreen_line(); |
| | | List<List<Integer>> allTringgerLines = mapItem.getAll_trigger_line(); |
| | | |
| | | |
| | | for (List<Integer> allTriggerLine: allTringgerLines |
| | | ) { |
| | | for (int kk = 1; kk < allTriggerLine.size(); kk++) { |
| | | int pos = allTriggerLine.get(kk); |
| | | if (kk ==1){ |
| | | path.moveTo((float) (base_x + (map[pos][0] - min_x) * scale_x), (float) (base_y + (map[pos][1] - min_y) * scale_y)); |
| | | } |
| | | path.lineTo((float) (base_x + (map[pos][0] - min_x) * scale_x), (float) (base_y + (map[pos][1] - min_y) * scale_y)); |
| | | Log.i(TAG,String.format("trigerline map[%d][0]=%f,map[%d][1]=%f,line to (%f,%f)",pos,map[pos][0],pos,map[pos][1], |
| | | (float) (base_x + (map[pos][0] - min_x) * scale_x),(float) (base_y + (map[pos][1] - min_y) * scale_y))); |
| | | } |
| | | } |
| | | |
| | | paint.reset(); |
| | | paint.setStyle(Paint.Style.STROKE); |
| | | paint.setStrokeWidth(1.5f); |
| | | paint.setAntiAlias(true); |
| | | paint.setColor(Color.RED); |
| | | paint.setPathEffect(null); |
| | | |
| | | Log.i(TAG,"redLinesSize"+redLines.size()); |
| | | for (List<Integer> redline: redLines |
| | | ) { |
| | |
| | | } |
| | | canvas2.drawPath(path,paint); |
| | | |
| | | }else{ |
| | | List<Integer> area = mapItem.getArea(); |
| | | for (int jj = 0; jj < area.size(); jj++) { |
| | | int pos = area.get(jj); |
| | | if (jj==0){ |
| | | path.moveTo((float) (base_x + (map[pos][0] - min_x) * scale_x), (float) (base_y + (map[pos][1] - min_y) * scale_y)); |
| | | }else{ |
| | | path.lineTo((float) (base_x + (map[pos][0] - min_x) * scale_x), (float) (base_y + (map[pos][1] - min_y) * scale_y)); |
| | | } |
| | | } |
| | | path.close(); |
| | | canvas2.drawPath(path,paint); |
| | | } |
| | | } |
| | | |