Skip to content

Commit

Permalink
[WIP] address design suggestions - arrow on top of the road name and …
Browse files Browse the repository at this point in the history
…stroke color (dark blue/gray) and slightly slimmer
  • Loading branch information
Guardiola31337 committed May 17, 2018
1 parent 88a8d75 commit fabf549
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,15 @@ public class NavigationMapRoute implements ProgressChangeListener, MapView.OnMap
private static final String BEARING_ARROW = "mapbox-navigation-bearing-arrow";
private static final String SHAFT_SOURCE_ID = "mapbox-navigation-shaft-source";
private static final String ARROW_SOURCE_ID = "mapbox-navigation-arrow-source";
private static final String RED_HEX = "#FF0000";
private static final String DARK_BLUE_GRAY_HEX = "#2D3F53";
private static final String WHITE_HEX = "#FFFFFF";
private static final String SHAFT_CASING_LINE_LAYER_ID = "mapbox-navigation-shaft-casing-layer";
private static final String SHAFT_LINE_LAYER_ID = "mapbox-navigation-shaft-layer";
private static final String ARROW_ICON = "mapbox-navigation-arrow-icon";
private static final String ARROW_ICON_CASING = "mapbox-navigation-arrow-icon-casing";
private static final String ROAD_LABEL = "road-label";
private static final int MAX_DEGREES = 360;
private static final float SHAFT_CASING_LINE_WIDTH = 8.5f;
private static final float SHAFT_LINE_WIDTH = 6f;
private static final float SHAFT_LINE_WIDTH = 6.25f;
private static final String ARROW_CASING_LAYER_ID = "mapbox-navigation-arrow-casing-layer";
private static final float ARROW_CASING_SIZE = 1.75f;
private static final Float[] ARROW_CASING_OFFSET = {0f, -1f};
Expand Down Expand Up @@ -468,7 +467,8 @@ private void initializeUpcomingManeuverArrow() {
SymbolLayer arrowLayer = createArrowLayer();
SymbolLayer arrowCasingLayer = createArrowCasingLayer();

placeArrowBelowRoadLabels(shaftLayer, arrowLayer);
mapboxMap.addLayer(shaftLayer);
mapboxMap.addLayer(arrowLayer);

mapboxMap.addLayerBelow(shaftCasingLayer, shaftLayer.getId());
mapboxMap.addLayerBelow(arrowCasingLayer, shaftCasingLayer.getId());
Expand Down Expand Up @@ -519,7 +519,7 @@ private LineLayer createShaftLayer() {

private LineLayer createShaftCasingLayer() {
return new LineLayer(SHAFT_CASING_LINE_LAYER_ID, SHAFT_SOURCE_ID).withProperties(
PropertyFactory.lineColor(Color.parseColor(RED_HEX)),
PropertyFactory.lineColor(Color.parseColor(DARK_BLUE_GRAY_HEX)),
PropertyFactory.lineWidth(SHAFT_CASING_LINE_WIDTH),
PropertyFactory.lineCap(Property.LINE_CAP_ROUND),
PropertyFactory.lineJoin(Property.LINE_JOIN_ROUND),
Expand Down Expand Up @@ -554,28 +554,6 @@ private SymbolLayer createArrowCasingLayer() {
);
}

private void placeArrowBelowRoadLabels(LineLayer shaftLineLayer, SymbolLayer arrowSymboLayer) {
Layer roadLabelLayer = findRoadLabelLayer();
if (roadLabelLayer != null) {
String roadLayerLabelId = roadLabelLayer.getId();
mapboxMap.addLayerBelow(shaftLineLayer, roadLayerLabelId);
mapboxMap.addLayerBelow(arrowSymboLayer, roadLayerLabelId);
} else {
mapboxMap.addLayer(shaftLineLayer);
mapboxMap.addLayer(arrowSymboLayer);
}
}

@Nullable
private Layer findRoadLabelLayer() {
for (Layer layer : mapboxMap.getLayers()) {
if (layer.getId().contains(ROAD_LABEL)) {
return layer;
}
}
return null;
}

private void initializeArrowLayers(LineLayer shaftLayer, LineLayer shaftCasingLayer, SymbolLayer arrowLayer,
SymbolLayer arrowCasingLayer) {
arrowLayers = new ArrayList<>(4);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFFF0000"
android:fillColor="#FF2D3F53"
android:pathData="M7,14l5,-5 5,5z"/>
</vector>

0 comments on commit fabf549

Please sign in to comment.