全览模式高德地图自定义样式替换
This commit is contained in:
@@ -19,6 +19,7 @@ import com.amap.api.maps.CameraUpdate;
|
||||
import com.amap.api.maps.CameraUpdateFactory;
|
||||
import com.amap.api.maps.CoordinateConverter;
|
||||
import com.amap.api.maps.UiSettings;
|
||||
import com.amap.api.maps.model.CustomMapStyleOptions;
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
import com.amap.api.maps.model.Polyline;
|
||||
import com.amap.api.navi.AMapNavi;
|
||||
@@ -54,6 +55,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListen
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
|
||||
import com.mogo.eagle.core.function.map.R;
|
||||
import com.mogo.eagle.core.function.smp.view.ISmallMapDirectionView;
|
||||
import com.mogo.eagle.core.utilcode.mogo.MapAssetStyleUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||
import com.mogo.module.common.utils.DrivingDirectionUtils;
|
||||
@@ -281,7 +283,7 @@ public class AMapCustomView
|
||||
options.setTrafficBarEnabled(false);
|
||||
//指南针
|
||||
// options.setCompassEnabled(false);
|
||||
options.setTilt((int) tilt);
|
||||
// options.setTilt((int) tilt);
|
||||
//自车车标
|
||||
options.setCarBitmap(BitmapFactory.decodeResource(this.getResources(), R.drawable.module_small_map_view_my_location_logo));
|
||||
options.setFourCornersBitmap(BitmapFactory.decodeResource(this.getResources(), R.drawable.amap_custom_corner));
|
||||
@@ -294,7 +296,7 @@ public class AMapCustomView
|
||||
RouteOverlayOptions routeOverlayOptions = new RouteOverlayOptions();
|
||||
routeOverlayOptions.setTurnArrowIs3D(false);
|
||||
routeOverlayOptions.setUnknownTraffic(BitmapFactory.decodeResource(getResources(), R.drawable.custtexture_no));//未知路段
|
||||
routeOverlayOptions.setSmoothTraffic(BitmapFactory.decodeResource(getResources(), R.drawable.jianbian));
|
||||
routeOverlayOptions.setSmoothTraffic(BitmapFactory.decodeResource(getResources(), R.drawable.amap_custom_smooth_route));
|
||||
routeOverlayOptions.setJamTraffic(BitmapFactory.decodeResource(getResources(), R.drawable.custtexture_bad));//拥堵路段
|
||||
routeOverlayOptions.setVeryJamTraffic(BitmapFactory.decodeResource(getResources(), R.drawable.custtexture_grayred));//超级拥堵路段
|
||||
routeOverlayOptions.setPassRoute(BitmapFactory.decodeResource(getResources(), R.drawable.amap_custom_pass_route));//走过的路段
|
||||
@@ -302,6 +304,14 @@ public class AMapCustomView
|
||||
mAMapNaviView.setViewOptions(options);
|
||||
|
||||
mAMap = mAMapNaviView.getMap();
|
||||
// 加载自定义样式
|
||||
CustomMapStyleOptions customMapStyleOptions = new CustomMapStyleOptions()
|
||||
.setEnable(true)
|
||||
.setStyleData(MapAssetStyleUtils.getAssetsStyle(context))
|
||||
.setStyleExtraData(MapAssetStyleUtils.getAssetsExtraStyle(context));
|
||||
// 设置自定义样式
|
||||
mAMap.setCustomMapStyle(customMapStyleOptions);
|
||||
|
||||
// 地图文字标注
|
||||
mAMap.showMapText(true);
|
||||
// 显示实时路况图层,aMap是地图控制器对象。
|
||||
@@ -620,6 +630,7 @@ public class AMapCustomView
|
||||
@Override
|
||||
public void onCalculateRouteSuccess(AMapCalcRouteResult aMapCalcRouteResult) {
|
||||
Log.d(TAG, "onCalculateRouteSuccess aMapCalcRouteResult" + aMapCalcRouteResult.toString());
|
||||
//提测修改为EMULATOR
|
||||
mAMapNavi.startNavi(NaviType.GPS);
|
||||
mAMapNaviView.displayOverview();
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user