| | |
| | | // double map[][] = {{1, 1}, {10, 1}, {10, 10}, {1, 10}}; |
| | | 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}}; |
| | |
| | | } |
| | | } |
| | | } |
| | | 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); |
| | | |
| | |
| | | for (int i = 1; i < map.length; i++) { |
| | | path.lineTo((float) (base_x + (map[i][0] - min_x) * scale_x), (float) (base_y + (map[i][1] - min_y) * scale_y)); |
| | | } |
| | | |
| | | if (map_other.length>9){ |
| | | path.moveTo((float) (base_x + (map_other[0][0] - min_x) * scale_x), (float) (base_y + (map_other[0][1] - min_y) * scale_y)); |
| | | for (int i = 1; i < map.length; i++) { |
| | | path.lineTo((float) (base_x + (map_other[i][0] - min_x) * scale_x), (float) (base_y + (map_other[i][1] - min_y) * scale_y)); |
| | | } |
| | | } |
| | | |
| | | } |
| | | canvas2.drawPath(path, paint); |
| | | |
| | |
| | | |
| | | int line = 0; |
| | | int map_line = 0; |
| | | int map_line_other = 0; |
| | | private StringBuffer stringBuffer = new StringBuffer(); |
| | | class MessageRemoteService{ |
| | | public int msgCode; |
| | |
| | | |
| | | line = 0; |
| | | map_line = 0; |
| | | map_line_other = 0; |
| | | |
| | | car = new double[points.size()/2][2]; |
| | | |
| | |
| | | List<Double> xys = pointBeanList.get(j).getXy(); |
| | | if(j==0){ |
| | | map = new double[xys.size()/2][2]; |
| | | }else{ |
| | | MyLog.i(TAG,"暂时还不支持曲线"); |
| | | break; |
| | | } |
| | | |
| | | for (int k=0; k<xys.size();k++){ |
| | | if ((k % 2) == 0) { |
| | | map[map_line][0] = xys.get(k); |
| | | } else { |
| | | double value = 0 - xys.get(k); |
| | | Log.i(TAG, "onCEvent: map新值=" + value + " 位置:" + i); |
| | | Log.i(TAG, "onCEvent: map新值=" + value + " 位置:" + k); |
| | | map[map_line][1] = value; |
| | | map_line++; |
| | | } |
| | | } |
| | | }else{ |
| | | MyLog.i(TAG,"暂时还不支持曲线"); |
| | | map_other = new double[xys.size()/2][2]; |
| | | for (int k=0; k<xys.size();k++){ |
| | | if ((k % 2) == 0) { |
| | | map_other[map_line_other][0] = xys.get(k); |
| | | } else { |
| | | double value = 0 - xys.get(k); |
| | | map_other[map_line_other][1] = value; |
| | | map_line_other++; |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | break; |