From d2e846db8685fecddd2307a9d8be623de90ee53a Mon Sep 17 00:00:00 2001 From: lizhanwei <Dana_Lee1016@126.com> Date: 星期五, 20 三月 2020 17:44:20 +0800 Subject: [PATCH] 修改路考地图 --- app/src/main/java/safeluck/drive/evaluation/fragment/RoadDriveMapFragmentaa.java | 36 ++++++++---------------------------- 1 files changed, 8 insertions(+), 28 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 79f7915..8b719c1 100644 --- a/app/src/main/java/safeluck/drive/evaluation/fragment/RoadDriveMapFragmentaa.java +++ b/app/src/main/java/safeluck/drive/evaluation/fragment/RoadDriveMapFragmentaa.java @@ -112,17 +112,13 @@ private int map_id; private double gpsSpeed = 0; - double allMap[][][]; double map[][] = {{-2.4065, 30.7090}, {-3.0759, 30.3599}, { -2.6023, 29.2578}, {-3.3316,28.9383},{-3.8247,30.0293}, {-3.4503,30.1946}, {-2.9669,29.0981}, { -3.6962, 28.7786}, {-4.1991, 29.8640}}; - double map_other[][] = {{-2.4065, 30.7090}, {-3.0759, 30.3599}, { -2.6023, 29.2578}, {-3.3316,28.9383},{-3.8247,30.0293}, - {-3.4503,30.1946}, {-2.9669,29.0981}}; // double map[][] ; double car[][] = {{8.278, 1.467}, {7.2780000000000009, 1.467}, {7.2780000000000009, -1.533}, {8.278, -1.533} , {9.278, -1.5330000000000004}, {9.277999999999999, 1.467000000000001}}; Gson gson; - private LinearLayout linearLayout;//surfaceview鐨勭埗瀹瑰櫒锛屼负浜嗙Щ鍔╯urfaceview鑰屼娇鐢紝鍥犱负scrollto涓嶈兘绉诲姩view锛� private LinkedBlockingQueue queue = new LinkedBlockingQueue(100); private ExecutorService producer = Executors.newSingleThreadExecutor(); private ExecutorService consumer = Executors.newSingleThreadExecutor(); @@ -227,23 +223,7 @@ } } } - if (map_other.length>9){ - for (int i = 0; i < map_other.length; i++) { - if (max_x < map_other[i][0]) { - max_x = map_other[i][0]; - } - if (min_x > map_other[i][0]) { - min_x = map_other[i][0]; - } - if (max_y < map_other[i][1]) { - max_y = map_other[i][1]; - } - if (min_y > map_other[i][1]) { - min_y = map_other[i][1]; - } - } - } Log.d(TAG, "DrawMap max_x " + max_x + " max_y " + max_y + " min_x " + min_x + " min_y " + min_y); @@ -308,6 +288,7 @@ 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 ) { @@ -323,13 +304,13 @@ } } -// canvas2.drawPath(path,paint); + canvas2.drawPath(path,paint); //鐢昏櫄绾匡紙鍒嗛亾绾匡級 paint.reset(); paint.setStyle(Paint.Style.STROKE); paint.setStrokeWidth(1.5f); paint.setAntiAlias(true); - paint.setColor(Color.WHITE); +// paint.setColor(Color.WHITE); paint.setPathEffect(new DashPathEffect(new float[] {15, 15}, 0)); for (List<Integer> greenline: greenLines){ @@ -353,8 +334,7 @@ } - canvas2.drawPath(path, paint); - +// canvas2.drawPath(path, paint); 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)); 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)); @@ -366,7 +346,8 @@ canvas2.drawPath(path, paint); paint.setStyle(Paint.Style.FILL_AND_STROKE); - + paint.setPathEffect(null); + paint.setColor(Color.BLACK); if (osdHeading != null) { Path pathText = new Path(); pathText.moveTo(10, 170); @@ -446,8 +427,7 @@ boolean flag = true; class CalRunnable implements Runnable{ - private String json; - private int cmd; + @Override public void run() { @@ -490,7 +470,7 @@ car = new double[points.size() / 2][2]; - + line =0 ;map_line=0; for (int i = 0; i < points.size(); i++) { if ((i % 2) == 0) { car[line][0] = points.get(i); -- Gitblit v1.8.0