ソースを参照

路径规划,红绿灯去除

huyuguo 5 年 前
コミット
ad6c848c3a

+ 1 - 1
app/build.gradle

212
    compile 'com.github.PhilJay:MPAndroidChart:v3.0.3'
212
    compile 'com.github.PhilJay:MPAndroidChart:v3.0.3'
213
    compile 'com.github.promeg:tinypinyin:1.0.0'
213
    compile 'com.github.promeg:tinypinyin:1.0.0'
214
    compile 'org.greenrobot:eventbus:3.0.0'
214
    compile 'org.greenrobot:eventbus:3.0.0'
215
    compile files('libs/AMap3DMap_6.5.0_AMapNavi_6.4.0_AMapSearch_6.5.0_AMapLocation_4.2.0_20181009.jar')
215
    compile files('libs/AMap3DMap_6.9.2_AMapNavi_6.9.0_AMapSearch_6.9.2_AMapLocation_4.7.0_20190710.jar')
216
    compile 'com.qmuiteam:qmui:1.2.0'
216
    compile 'com.qmuiteam:qmui:1.2.0'
217
    compile 'org.zackratos:ultimatebar:1.1.1'
217
    compile 'org.zackratos:ultimatebar:1.1.1'
218
    compile project(':XRefreshView')
218
    compile project(':XRefreshView')

BIN
app/libs/AMap3DMap_6.5.0_AMapNavi_6.4.0_AMapSearch_6.5.0_AMapLocation_4.2.0_20181009.jar


BIN
app/src/main/assets/amap_custom_style_2019080601.data


BIN
app/src/main/assets/amap_custom_style_2019082001.data


BIN
app/src/main/assets/amap_custom_style_extra_2019082001.data


+ 7 - 1
app/src/main/java/com/electric/chargingpile/activity/RoutePlanMapActivity.java

834
            routeOverLay.setStartPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_newstarr)));
834
            routeOverLay.setStartPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_newstarr)));
835
            routeOverLay.setEndPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_newstopr)));
835
            routeOverLay.setEndPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_newstopr)));
836
            routeOverLay.setWayPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_zhanwei)));
836
            routeOverLay.setWayPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_zhanwei)));
837
            routeOverLay.setTrafficLightsVisible(false);
837
            routeOverLay.addToMap();
838
            routeOverLay.addToMap();
838
            routeOverLay.setTrafficLine(true);
839
            routeOverlays.put(routeIds[i], routeOverLay);
839
            routeOverlays.put(routeIds[i], routeOverLay);
840
            routeOverLay.getAMapNaviPath().getSteps();
840
            routeOverLay.getAMapNaviPath().getSteps();
841
841
            routePlanInfo.setNo(routeOverlays.get(routeIds[i]).getAMapNaviPath().getStrategy() + "");
842
            routePlanInfo.setNo(routeOverlays.get(routeIds[i]).getAMapNaviPath().getStrategy() + "");
842
            routePlanInfo.setTime(routeOverlays.get(routeIds[i]).getAMapNaviPath().getAllTime() + "");
843
            routePlanInfo.setTime(routeOverlays.get(routeIds[i]).getAMapNaviPath().getAllTime() + "");
843
            routePlanInfo.setDistance(routeOverlays.get(routeIds[i]).getAMapNaviPath().getAllLength() + "");
844
            routePlanInfo.setDistance(routeOverlays.get(routeIds[i]).getAMapNaviPath().getAllLength() + "");
2100
                        routeOverLay.setStartPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_route_start)));
2101
                        routeOverLay.setStartPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_route_start)));
2101
                        routeOverLay.setEndPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_route_end)));
2102
                        routeOverLay.setEndPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_route_end)));
2102
                        routeOverLay.setWayPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_zhanwei)));
2103
                        routeOverLay.setWayPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_zhanwei)));
2104
                        routeOverLay.setTrafficLightsVisible(false);
2103
                        routeOverLay.addToMap();
2105
                        routeOverLay.addToMap();
2104
                        routeOverlays.put(routeIds[i], routeOverLay);
2106
                        routeOverlays.put(routeIds[i], routeOverLay);
2105
                    }
2107
                    }
2166
                        routeOverLay.setStartPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_route_start)));
2168
                        routeOverLay.setStartPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_route_start)));
2167
                        routeOverLay.setEndPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_route_end)));
2169
                        routeOverLay.setEndPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_route_end)));
2168
                        routeOverLay.setWayPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_zhanwei)));
2170
                        routeOverLay.setWayPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_zhanwei)));
2171
                        routeOverLay.setTrafficLightsVisible(false);
2169
                        routeOverLay.addToMap();
2172
                        routeOverLay.addToMap();
2170
                        routeOverlays.put(routeIds[i], routeOverLay);
2173
                        routeOverlays.put(routeIds[i], routeOverLay);
2171
                    }
2174
                    }
2225
                        routeOverLay.setStartPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_newstarr)));
2228
                        routeOverLay.setStartPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_newstarr)));
2226
                        routeOverLay.setEndPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_newstopr)));
2229
                        routeOverLay.setEndPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_newstopr)));
2227
                        routeOverLay.setWayPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_zhanwei)));
2230
                        routeOverLay.setWayPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_zhanwei)));
2231
                        routeOverLay.setTrafficLightsVisible(false);
2228
                        routeOverLay.addToMap();
2232
                        routeOverLay.addToMap();
2229
                        routeOverlays.put(routeIds[i], routeOverLay);
2233
                        routeOverlays.put(routeIds[i], routeOverLay);
2230
                    }
2234
                    }
2322
                            routeOverLay.setStartPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_newstarr)));
2326
                            routeOverLay.setStartPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_newstarr)));
2323
                            routeOverLay.setEndPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_newstopr)));
2327
                            routeOverLay.setEndPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_newstopr)));
2324
                            routeOverLay.setWayPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_zhanwei)));
2328
                            routeOverLay.setWayPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_zhanwei)));
2329
                            routeOverLay.setTrafficLightsVisible(false);
2325
                            routeOverLay.addToMap();
2330
                            routeOverLay.addToMap();
2326
                            routeOverlays.put(routeIds[i], routeOverLay);
2331
                            routeOverlays.put(routeIds[i], routeOverLay);
2327
                        }
2332
                        }
3229
                routeOverLay.setStartPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_newstarr)));
3234
                routeOverLay.setStartPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_newstarr)));
3230
                routeOverLay.setEndPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_newstopr)));
3235
                routeOverLay.setEndPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_newstopr)));
3231
                routeOverLay.setWayPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_zhanwei)));
3236
                routeOverLay.setWayPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_zhanwei)));
3237
                routeOverLay.setTrafficLightsVisible(false);
3232
                routeOverLay.addToMap();
3238
                routeOverLay.addToMap();
3233
                routeOverlays.put(routeIds[i], routeOverLay);
3239
                routeOverlays.put(routeIds[i], routeOverLay);
3234
            }
3240
            }

+ 27 - 29
app/src/main/java/com/electric/chargingpile/util/Util.java

12
import android.view.WindowManager;
12
import android.view.WindowManager;
13

13

14
import com.amap.api.maps.AMap;
14
import com.amap.api.maps.AMap;
15
import com.amap.api.maps.model.CustomMapStyleOptions;
15
import com.blankj.utilcode.util.StringUtils;
16
import com.blankj.utilcode.util.StringUtils;
16
import com.electric.chargingpile.activity.MainMapActivity;
17
import com.electric.chargingpile.activity.MainMapActivity;
17
import com.electric.chargingpile.data.Zhan;
18
import com.electric.chargingpile.data.Zhan;
58

59

59
    }
60
    }
60

61

61
    public static String convertMap2Query(Map<String, String>map) {
62
    public static String convertMap2Query(Map<String, String> map) {
62
        StringBuffer sb = new StringBuffer();
63
        StringBuffer sb = new StringBuffer();
63
        if (map.size() > 0) {
64
        if (map.size() > 0) {
64
            for (String key: map.keySet()) {
65
            for (String key : map.keySet()) {
65
                sb.append(key + "=");
66
                sb.append(key + "=");
66
                String value = map.get(key);
67
                String value = map.get(key);
67
                if (StringUtils.isEmpty(value)) {
68
                if (StringUtils.isEmpty(value)) {
350

351

351
    /**
352
    /**
352
     * 设定高德地图离线样式文件
353
     * 设定高德地图离线样式文件
354
     *
353
     * @param aMap
355
     * @param aMap
354
     * @param context
356
     * @param context
355
     */
357
     */
356
    public static void setMapCustomStyleFile(AMap aMap, Context context) {
358
    public static void setMapCustomStyleFile(AMap aMap, Context context) {
357
        String styleName = "amap_custom_style_2019080601.data";
358
        FileOutputStream outputStream = null;
359
        InputStream inputStream = null;
360
        String filePath = null;
359
        byte[] buffer1 = null;
360
        byte[] buffer2 = null;
361
        InputStream is1 = null;
362
        InputStream is2 = null;
361
        try {
363
        try {
362
            inputStream = context.getAssets().open(styleName);
363
            byte[] b = new byte[inputStream.available()];
364
            inputStream.read(b);
365

366
            filePath = context.getFilesDir().getAbsolutePath();
367
            File file = new File(filePath + "/" + styleName);
368
            if (file.exists()) {
369
                file.delete();
370
            }
371
            file.createNewFile();
372
            outputStream = new FileOutputStream(file);
373
            outputStream.write(b);
374

364
            is1 = context.getAssets().open("amap_custom_style_2019082001.data");
365
            int lenght1 = is1.available();
366
            buffer1 = new byte[lenght1];
367
            is1.read(buffer1);
368
            is2 = context.getAssets().open("amap_custom_style_extra_2019082001.data");
369
            int lenght2 = is2.available();
370
            buffer2 = new byte[lenght2];
371
            is2.read(buffer2);
375
        } catch (IOException e) {
372
        } catch (IOException e) {
376
            e.printStackTrace();
373
            e.printStackTrace();
377
        } finally {
374
        } finally {
378
            try {
375
            try {
379
                if (inputStream != null)
380
                    inputStream.close();
381

382
                if (outputStream != null)
383
                    outputStream.close();
384

376
                if (is1 != null)
377
                    is1.close();
378
                if (is2 != null)
379
                    is2.close();
385
            } catch (IOException e) {
380
            } catch (IOException e) {
386
                e.printStackTrace();
381
                e.printStackTrace();
387
            }
382
            }
388
        }
383
        }
389

384

390
        aMap.setCustomMapStylePath(filePath + "/" + styleName);
391

392
        aMap.setMapCustomEnable(true);
393
        aMap.showMapText(true);
385
        CustomMapStyleOptions customMapStyleOptions = new CustomMapStyleOptions();
386
        customMapStyleOptions.setStyleData(buffer1);
387
        customMapStyleOptions.setStyleExtraData(buffer2);
388
        aMap.setCustomMapStyle(customMapStyleOptions);
394
    }
389
    }
390

391

392

395
}
393
}

BIN
app/src/main/jniLibs/armeabi/libAMapSDK_MAP_v6_5_0.so


BIN
app/src/main/jniLibs/armeabi/libAMapSDK_MAP_v6_9_2.so


BIN
app/src/main/jniLibs/armeabi/libAMapSDK_NAVI_v6_4_0.so


BIN
app/src/main/jniLibs/armeabi/libAMapSDK_NAVI_v6_9_0.so


BIN
app/src/main/jniLibs/armeabi/libmp3decoder.so