diff --git a/src/main/java/org/opentripplanner/apis/vectortiles/DebugStyleSpec.java b/src/main/java/org/opentripplanner/apis/vectortiles/DebugStyleSpec.java index cc30726b474..0dde1494f0a 100644 --- a/src/main/java/org/opentripplanner/apis/vectortiles/DebugStyleSpec.java +++ b/src/main/java/org/opentripplanner/apis/vectortiles/DebugStyleSpec.java @@ -49,6 +49,10 @@ public class DebugStyleSpec { 1.3f, List.of(new ZoomStop(13, 0.5f), new ZoomStop(MAX_ZOOM, 10)) ); + private static final ZoomDependentNumber LINE_OFFSET = new ZoomDependentNumber( + 1.3f, + List.of(new ZoomStop(13, 0.3f), new ZoomStop(MAX_ZOOM, 6)) + ); private static final ZoomDependentNumber CIRCLE_STROKE = new ZoomDependentNumber( 1, List.of(new ZoomStop(15, 0.2f), new ZoomStop(MAX_ZOOM, 3)) @@ -88,6 +92,7 @@ static StyleSpec build( .lineColor(MAGENTA) .edgeFilter(EDGES_TO_DISPLAY) .lineWidth(LINE_WIDTH) + .lineOffset(LINE_OFFSET) .minZoom(6) .maxZoom(MAX_ZOOM) .intiallyHidden(), @@ -114,6 +119,7 @@ static StyleSpec build( StreetStationCentroidLink.class ) .lineWidth(LINE_WIDTH) + .lineOffset(LINE_OFFSET) .minZoom(13) .maxZoom(MAX_ZOOM) .intiallyHidden(), diff --git a/src/main/java/org/opentripplanner/apis/vectortiles/model/StyleBuilder.java b/src/main/java/org/opentripplanner/apis/vectortiles/model/StyleBuilder.java index d842b5e6687..14b2fe8b014 100644 --- a/src/main/java/org/opentripplanner/apis/vectortiles/model/StyleBuilder.java +++ b/src/main/java/org/opentripplanner/apis/vectortiles/model/StyleBuilder.java @@ -165,6 +165,11 @@ public StyleBuilder lineWidth(ZoomDependentNumber zoomStops) { return this; } + public StyleBuilder lineOffset(ZoomDependentNumber zoomStops) { + paint.put("line-offset", zoomStops.toJson()); + return this; + } + public StyleBuilder fillColor(String color) { paint.put("fill-color", validateColor(color)); return this; diff --git a/src/test/resources/org/opentripplanner/apis/vectortiles/style.json b/src/test/resources/org/opentripplanner/apis/vectortiles/style.json index 9c7572f4b6e..f15bc45b2e8 100644 --- a/src/test/resources/org/opentripplanner/apis/vectortiles/style.json +++ b/src/test/resources/org/opentripplanner/apis/vectortiles/style.json @@ -45,6 +45,19 @@ 10.0 ] ] + }, + "line-offset" : { + "base" : 1.3, + "stops" : [ + [ + 13, + 0.3 + ], + [ + 23, + 6.0 + ] + ] } }, "filter" : [ @@ -134,6 +147,19 @@ 10.0 ] ] + }, + "line-offset" : { + "base" : 1.3, + "stops" : [ + [ + 13, + 0.3 + ], + [ + 23, + 6.0 + ] + ] } }, "filter" : [