Change line style for plan route
This commit is contained in:
parent
6ed43e7fc1
commit
bb52aaaf33
2 changed files with 12 additions and 11 deletions
|
@ -354,6 +354,10 @@ public class PlanRouteFragment extends Fragment {
|
||||||
@Override
|
@Override
|
||||||
public void onApplicationModeItemClick(ApplicationMode mode) {
|
public void onApplicationModeItemClick(ApplicationMode mode) {
|
||||||
if (planRouteContext.getSnappedMode() != mode) {
|
if (planRouteContext.getSnappedMode() != mode) {
|
||||||
|
MapMarkersLayer layer = getMapMarkersLayer();
|
||||||
|
if (layer != null) {
|
||||||
|
layer.setDefaultAppMode(mode == ApplicationMode.DEFAULT);
|
||||||
|
}
|
||||||
planRouteContext.getSnappedToRoadPoints().clear();
|
planRouteContext.getSnappedToRoadPoints().clear();
|
||||||
planRouteContext.setSnappedMode(mode);
|
planRouteContext.setSnappedMode(mode);
|
||||||
planRouteContext.recreateSnapTrkSegment();
|
planRouteContext.recreateSnapTrkSegment();
|
||||||
|
|
|
@ -71,7 +71,7 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi
|
||||||
|
|
||||||
private final RenderingLineAttributes lineAttrs = new RenderingLineAttributes("measureDistanceLine");
|
private final RenderingLineAttributes lineAttrs = new RenderingLineAttributes("measureDistanceLine");
|
||||||
private final RenderingLineAttributes textAttrs = new RenderingLineAttributes("rulerLineFont");
|
private final RenderingLineAttributes textAttrs = new RenderingLineAttributes("rulerLineFont");
|
||||||
private Paint paint;
|
private final RenderingLineAttributes planRouteAttrs = new RenderingLineAttributes("markerPlanRouteline");
|
||||||
private TrkSegment route;
|
private TrkSegment route;
|
||||||
|
|
||||||
private TIntArrayList tx = new TIntArrayList();
|
private TIntArrayList tx = new TIntArrayList();
|
||||||
|
@ -81,6 +81,7 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi
|
||||||
private ContextMenuLayer contextMenuLayer;
|
private ContextMenuLayer contextMenuLayer;
|
||||||
|
|
||||||
private boolean inPlanRouteMode;
|
private boolean inPlanRouteMode;
|
||||||
|
private boolean defaultAppMode = true;
|
||||||
|
|
||||||
public MapMarkersLayer(MapActivity map) {
|
public MapMarkersLayer(MapActivity map) {
|
||||||
this.map = map;
|
this.map = map;
|
||||||
|
@ -98,6 +99,10 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi
|
||||||
this.inPlanRouteMode = inPlanRouteMode;
|
this.inPlanRouteMode = inPlanRouteMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setDefaultAppMode(boolean defaultAppMode) {
|
||||||
|
this.defaultAppMode = defaultAppMode;
|
||||||
|
}
|
||||||
|
|
||||||
private void initUI() {
|
private void initUI() {
|
||||||
bitmapPaint = new Paint();
|
bitmapPaint = new Paint();
|
||||||
bitmapPaint.setDither(true);
|
bitmapPaint.setDither(true);
|
||||||
|
@ -120,15 +125,6 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi
|
||||||
bitmapPaintDestTeal = createPaintDest(R.color.marker_teal);
|
bitmapPaintDestTeal = createPaintDest(R.color.marker_teal);
|
||||||
bitmapPaintDestPurple = createPaintDest(R.color.marker_purple);
|
bitmapPaintDestPurple = createPaintDest(R.color.marker_purple);
|
||||||
|
|
||||||
paint = new Paint();
|
|
||||||
paint.setStyle(Paint.Style.STROKE);
|
|
||||||
paint.setStrokeWidth(7 * view.getDensity());
|
|
||||||
paint.setAntiAlias(true);
|
|
||||||
paint.setStrokeCap(Paint.Cap.ROUND);
|
|
||||||
paint.setStrokeJoin(Paint.Join.ROUND);
|
|
||||||
paint.setColor(ContextCompat.getColor(map, R.color.marker_red));
|
|
||||||
paint.setAlpha(200);
|
|
||||||
|
|
||||||
float textSize = TEXT_SIZE * map.getResources().getDisplayMetrics().density;
|
float textSize = TEXT_SIZE * map.getResources().getDisplayMetrics().density;
|
||||||
textAttrs.paint.setTextSize(textSize);
|
textAttrs.paint.setTextSize(textSize);
|
||||||
textAttrs.paint2.setTextSize(textSize);
|
textAttrs.paint2.setTextSize(textSize);
|
||||||
|
@ -207,9 +203,10 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi
|
||||||
List<MapMarker> activeMapMarkers = markersHelper.getMapMarkers();
|
List<MapMarker> activeMapMarkers = markersHelper.getMapMarkers();
|
||||||
|
|
||||||
if (route != null && route.points.size() > 0) {
|
if (route != null && route.points.size() > 0) {
|
||||||
|
planRouteAttrs.updatePaints(view, nightMode, tileBox);
|
||||||
route.renders.clear();
|
route.renders.clear();
|
||||||
route.renders.add(new Renderable.StandardTrack(new ArrayList<>(route.points), 17.2));
|
route.renders.add(new Renderable.StandardTrack(new ArrayList<>(route.points), 17.2));
|
||||||
route.drawRenderers(view.getZoom(), paint, canvas, tileBox);
|
route.drawRenderers(view.getZoom(), defaultAppMode ? planRouteAttrs.paint : planRouteAttrs.paint2, canvas, tileBox);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (map.getMyApplication().getSettings().SHOW_LINES_TO_FIRST_MARKERS.get() && myLoc != null) {
|
if (map.getMyApplication().getSettings().SHOW_LINES_TO_FIRST_MARKERS.get() && myLoc != null) {
|
||||||
|
|
Loading…
Reference in a new issue