Sfoglia il codice sorgente

路径规划,红绿灯去除

huyuguo 5 anni fa
parent
commit
ad6c848c3a

+ 1 - 1
app/build.gradle

@ -212,7 +212,7 @@ dependencies {
212 212
    compile 'com.github.PhilJay:MPAndroidChart:v3.0.3'
213 213
    compile 'com.github.promeg:tinypinyin:1.0.0'
214 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 216
    compile 'com.qmuiteam:qmui:1.2.0'
217 217
    compile 'org.zackratos:ultimatebar:1.1.1'
218 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,10 +834,11 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
834 834
            routeOverLay.setStartPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_newstarr)));
835 835
            routeOverLay.setEndPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_newstopr)));
836 836
            routeOverLay.setWayPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_zhanwei)));
837
            routeOverLay.setTrafficLightsVisible(false);
837 838
            routeOverLay.addToMap();
838
            routeOverLay.setTrafficLine(true);
839 839
            routeOverlays.put(routeIds[i], routeOverLay);
840 840
            routeOverLay.getAMapNaviPath().getSteps();
841
841 842
            routePlanInfo.setNo(routeOverlays.get(routeIds[i]).getAMapNaviPath().getStrategy() + "");
842 843
            routePlanInfo.setTime(routeOverlays.get(routeIds[i]).getAMapNaviPath().getAllTime() + "");
843 844
            routePlanInfo.setDistance(routeOverlays.get(routeIds[i]).getAMapNaviPath().getAllLength() + "");
@ -2100,6 +2101,7 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
2100 2101
                        routeOverLay.setStartPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_route_start)));
2101 2102
                        routeOverLay.setEndPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_route_end)));
2102 2103
                        routeOverLay.setWayPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_zhanwei)));
2104
                        routeOverLay.setTrafficLightsVisible(false);
2103 2105
                        routeOverLay.addToMap();
2104 2106
                        routeOverlays.put(routeIds[i], routeOverLay);
2105 2107
                    }
@ -2166,6 +2168,7 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
2166 2168
                        routeOverLay.setStartPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_route_start)));
2167 2169
                        routeOverLay.setEndPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_route_end)));
2168 2170
                        routeOverLay.setWayPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_zhanwei)));
2171
                        routeOverLay.setTrafficLightsVisible(false);
2169 2172
                        routeOverLay.addToMap();
2170 2173
                        routeOverlays.put(routeIds[i], routeOverLay);
2171 2174
                    }
@ -2225,6 +2228,7 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
2225 2228
                        routeOverLay.setStartPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_newstarr)));
2226 2229
                        routeOverLay.setEndPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_newstopr)));
2227 2230
                        routeOverLay.setWayPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_zhanwei)));
2231
                        routeOverLay.setTrafficLightsVisible(false);
2228 2232
                        routeOverLay.addToMap();
2229 2233
                        routeOverlays.put(routeIds[i], routeOverLay);
2230 2234
                    }
@ -2322,6 +2326,7 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
2322 2326
                            routeOverLay.setStartPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_newstarr)));
2323 2327
                            routeOverLay.setEndPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_newstopr)));
2324 2328
                            routeOverLay.setWayPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_zhanwei)));
2329
                            routeOverLay.setTrafficLightsVisible(false);
2325 2330
                            routeOverLay.addToMap();
2326 2331
                            routeOverlays.put(routeIds[i], routeOverLay);
2327 2332
                        }
@ -3229,6 +3234,7 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
3229 3234
                routeOverLay.setStartPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_newstarr)));
3230 3235
                routeOverLay.setEndPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_newstopr)));
3231 3236
                routeOverLay.setWayPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_zhanwei)));
3237
                routeOverLay.setTrafficLightsVisible(false);
3232 3238
                routeOverLay.addToMap();
3233 3239
                routeOverlays.put(routeIds[i], routeOverLay);
3234 3240
            }

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

@ -12,6 +12,7 @@ import android.view.View;
12 12
import android.view.WindowManager;
13 13

14 14
import com.amap.api.maps.AMap;
15
import com.amap.api.maps.model.CustomMapStyleOptions;
15 16
import com.blankj.utilcode.util.StringUtils;
16 17
import com.electric.chargingpile.activity.MainMapActivity;
17 18
import com.electric.chargingpile.data.Zhan;
@ -58,10 +59,10 @@ public class Util {
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 63
        StringBuffer sb = new StringBuffer();
63 64
        if (map.size() > 0) {
64
            for (String key: map.keySet()) {
65
            for (String key : map.keySet()) {
65 66
                sb.append(key + "=");
66 67
                String value = map.get(key);
67 68
                if (StringUtils.isEmpty(value)) {
@ -350,46 +351,43 @@ public class Util {
350 351

351 352
    /**
352 353
     * 设定高德地图离线样式文件
354
     *
353 355
     * @param aMap
354 356
     * @param context
355 357
     */
356 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 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 372
        } catch (IOException e) {
376 373
            e.printStackTrace();
377 374
        } finally {
378 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 380
            } catch (IOException e) {
386 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