From 9859fc6b5e4f873400fb1e7ae143f79fe32010b8 Mon Sep 17 00:00:00 2001
From: lizhanwei <Dana_Lee1016@126.com>
Date: 星期六, 21 三月 2020 13:09:47 +0800
Subject: [PATCH] 提交路考地图增加触发线

---
 app/src/main/java/safeluck/drive/evaluation/fragment/RoadDriveMapFragmentaa.java |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/app/src/main/java/safeluck/drive/evaluation/fragment/RoadDriveMapFragmentaa.java b/app/src/main/java/safeluck/drive/evaluation/fragment/RoadDriveMapFragmentaa.java
index 8b719c1..9ae9d92 100644
--- a/app/src/main/java/safeluck/drive/evaluation/fragment/RoadDriveMapFragmentaa.java
+++ b/app/src/main/java/safeluck/drive/evaluation/fragment/RoadDriveMapFragmentaa.java
@@ -280,15 +280,33 @@
         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
                     ) {
@@ -326,6 +344,18 @@
                     }
                     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);
                 }
             }
 

--
Gitblit v1.8.0