Skip to content

Commit

Permalink
vector tile: update/restore edge styles
Browse files Browse the repository at this point in the history
  • Loading branch information
flaktack committed Nov 7, 2024
1 parent 14cef7c commit 4dee5af
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import org.opentripplanner.apis.vectortiles.model.ZoomDependentNumber;
import org.opentripplanner.apis.vectortiles.model.ZoomDependentNumber.ZoomStop;
import org.opentripplanner.service.vehiclerental.street.StreetVehicleRentalLink;
import org.opentripplanner.service.vehiclerental.street.VehicleRentalPlaceVertex;
import org.opentripplanner.street.model.StreetTraversalPermission;
import org.opentripplanner.street.model.edge.AreaEdge;
import org.opentripplanner.street.model.edge.BoardingLocationToStopLink;
Expand Down Expand Up @@ -50,7 +49,6 @@ public class DebugStyleSpec {
private static final String DARK_GREEN = "#136b04";
private static final String PURPLE = "#BC55F2";
private static final String BLACK = "#140d0e";
private static final String GRAY = "#DDDDDD";

private static final int MAX_ZOOM = 23;
private static final int LINE_DETAIL_ZOOM = 13;
Expand Down Expand Up @@ -197,7 +195,8 @@ private static List<StyleBuilder> edges(VectorSourceLayer edges) {
.group(EDGES_GROUP)
.typeLine()
.vectorSourceLayer(edges)
.lineColor(GRAY)
.lineColor(MAGENTA)
.edgeFilter(EDGES_TO_DISPLAY)
.lineWidth(LINE_HALF_WIDTH)
.lineOffset(LINE_OFFSET)
.minZoom(6)
Expand All @@ -209,6 +208,7 @@ private static List<StyleBuilder> edges(VectorSourceLayer edges) {
.typeSymbol()
.lineText("name")
.vectorSourceLayer(edges)
.edgeFilter(EDGES_TO_DISPLAY)
.minZoom(17)
.maxZoom(MAX_ZOOM)
.intiallyHidden(),
Expand All @@ -217,8 +217,7 @@ private static List<StyleBuilder> edges(VectorSourceLayer edges) {
.group(EDGES_GROUP)
.typeLine()
.vectorSourceLayer(edges)
.lineColor(GRAY)
.lineOpacity(0.2f)
.lineColor(BRIGHT_GREEN)
.edgeFilter(
StreetTransitStopLink.class,
StreetTransitEntranceLink.class,
Expand Down Expand Up @@ -316,11 +315,11 @@ private static List<StyleBuilder> noThruTraffic(VectorSourceLayer edges) {
private static List<String> permissionColors() {
return Arrays
.stream(StreetTraversalPermission.values())
.flatMap(p -> Stream.of(streetPermissionAsString(p), permissionColors(p)))
.flatMap(p -> Stream.of(streetPermissionAsString(p), permissionColor(p)))
.toList();
}

private static String permissionColors(StreetTraversalPermission p) {
private static String permissionColor(StreetTraversalPermission p) {
return switch (p) {
case NONE -> BLACK;
case PEDESTRIAN -> "#2ba812";
Expand Down

0 comments on commit 4dee5af

Please sign in to comment.