setShowServerInfo((v) => !v)}>
-
OTP Debug Client
+
OTP Debug
{showServerInfo &&
}
diff --git a/client/src/style.css b/client/src/style.css
index c33f5dff711..f838dce2c7b 100644
--- a/client/src/style.css
+++ b/client/src/style.css
@@ -181,6 +181,10 @@
margin-left: 6px;
}
+.maplibregl-ctrl-group.layer-select select {
+ margin-bottom: 14px;
+}
+
.maplibregl-ctrl-group.layer-select h4 {
font-size: 17px;
}
diff --git a/doc/templates/Configuration.md b/doc/templates/Configuration.md
index 45b2c36c67b..39843b57077 100644
--- a/doc/templates/Configuration.md
+++ b/doc/templates/Configuration.md
@@ -41,9 +41,9 @@ default behavior of scanning the base directory for input files. Scanning is ove
independently for each file type, and can point to remote cloud storage with arbitrary URIs.
See [the storage section](Configuration.md#Storage) for further details.
-## Three Scopes of Configuration
+## Four scopes of configuration
-OTP is configured via three configuration JSON files which are read from the directory specified on
+OTP is configured via four configuration JSON files which are read from the directory specified on
its command line. We try to provide sensible defaults for every option, so all three of these files
are optional, as are all the options within each file. Each configuration file corresponds to
options that are relevant at a particular phase of OTP usage.
@@ -51,7 +51,8 @@ options that are relevant at a particular phase of OTP usage.
Options and parameters that are taken into account during the graph building process will be "baked
into" the graph, and cannot be changed later in a running server. These are specified
in `build-config.json`. Other details of OTP operation can be modified without rebuilding the graph.
-These run-time configuration options are found in `router-config.json`. Finally, `otp-config.json`
+These run-time configuration options are found in `router-config.json`. If you want to configure
+the built-in debug UI add `debug-ui-config.json`. Finally, `otp-config.json`
contains simple switches that enable or disable system-wide features.
## Configuration types
diff --git a/doc/templates/DebugUiConfiguration.md b/doc/templates/DebugUiConfiguration.md
new file mode 100644
index 00000000000..a54b1db8d2a
--- /dev/null
+++ b/doc/templates/DebugUiConfiguration.md
@@ -0,0 +1,23 @@
+
+
+# Debug UI configuration
+
+The Debug UI is the standard interface that is bundled with OTP and available by visiting
+[`http://localhost:8080`](http://localhost:8080). This page list the configuration options available
+by placing a file `debug-ui-config.json` into OTP's working directory.
+
+
+
+
+## Parameter Details
+
+
+
+## Config Example
+
+
diff --git a/doc/user/Configuration.md b/doc/user/Configuration.md
index 13ba16889b1..97c70594b78 100644
--- a/doc/user/Configuration.md
+++ b/doc/user/Configuration.md
@@ -41,9 +41,9 @@ default behavior of scanning the base directory for input files. Scanning is ove
independently for each file type, and can point to remote cloud storage with arbitrary URIs.
See [the storage section](Configuration.md#Storage) for further details.
-## Three Scopes of Configuration
+## Four scopes of configuration
-OTP is configured via three configuration JSON files which are read from the directory specified on
+OTP is configured via four configuration JSON files which are read from the directory specified on
its command line. We try to provide sensible defaults for every option, so all three of these files
are optional, as are all the options within each file. Each configuration file corresponds to
options that are relevant at a particular phase of OTP usage.
@@ -51,7 +51,8 @@ options that are relevant at a particular phase of OTP usage.
Options and parameters that are taken into account during the graph building process will be "baked
into" the graph, and cannot be changed later in a running server. These are specified
in `build-config.json`. Other details of OTP operation can be modified without rebuilding the graph.
-These run-time configuration options are found in `router-config.json`. Finally, `otp-config.json`
+These run-time configuration options are found in `router-config.json`. If you want to configure
+the built-in debug UI add `debug-ui-config.json`. Finally, `otp-config.json`
contains simple switches that enable or disable system-wide features.
## Configuration types
diff --git a/doc/user/DebugUiConfiguration.md b/doc/user/DebugUiConfiguration.md
new file mode 100644
index 00000000000..a1657796fe0
--- /dev/null
+++ b/doc/user/DebugUiConfiguration.md
@@ -0,0 +1,66 @@
+
+
+# Debug UI configuration
+
+The Debug UI is the standard interface that is bundled with OTP and available by visiting
+[`http://localhost:8080`](http://localhost:8080). This page list the configuration options available
+by placing a file `debug-ui-config.json` into OTP's working directory.
+
+
+
+
+| Config Parameter | Type | Summary | Req./Opt. | Default Value | Since |
+|-----------------------------------------------------------|:----------:|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:----------:|-----------------------|:-----:|
+| [additionalBackgroundLayers](#additionalBackgroundLayers) | `object[]` | Additional background raster map layers. | *Optional* | | 2.7 |
+| attribution | `string` | Attribution for the map data. | *Optional* | `"© OpenTripPlanner"` | 2.7 |
+| name | `string` | Name to appear in the layer selector. | *Required* | | 2.7 |
+| templateUrl | `string` | The [Maplibre-compatible template URL](https://maplibre.org/maplibre-native/ios/api/tile-url-templates.html) for the raster layer, for example `https://examples.com/tiles/{z}/{x}/{y}.png`. | *Required* | | 2.7 |
+| tileSize | `integer` | Size of the tile in pixels. | *Optional* | `256` | 2.7 |
+
+
+
+
+## Parameter Details
+
+
+
+
+
additionalBackgroundLayers
+
+**Since version:** `2.7` ∙ **Type:** `object[]` ∙ **Cardinality:** `Optional`
+**Path:** /
+
+Additional background raster map layers.
+
+Add additional background layers that will appear in the Debug UI as one of the choices.
+
+Currently only raster tile layers are supported.
+
+
+
+
+
+## Config Example
+
+
+
+
+```JSON
+// debug-ui-config.json
+{
+ "additionalBackgroundLayers" : [
+ {
+ "name" : "TriMet aerial photos",
+ "templateUrl" : "https://maps.trimet.org/wms/reflect?bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.0&request=GetMap&srs=EPSG:3857&width=256&height=256&layers=aerials",
+ "attribution" : "© TriMet"
+ }
+ ]
+}
+```
+
+
diff --git a/mkdocs.yml b/mkdocs.yml
index b40f77ff3c0..51245f6c3b8 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -82,6 +82,7 @@ nav:
- Router: 'RouterConfiguration.md'
- "Route Request": 'RouteRequest.md'
- "Realtime Updaters": 'UpdaterConfig.md'
+ - "Debug UI": 'DebugUiConfiguration.md'
- "Migrating between versions/builds": 'Migrating-Configuration.md'
- Features explained:
- "Routing modes": 'RoutingModes.md'
diff --git a/utils/src/main/java/org/opentripplanner/utils/lang/StringUtils.java b/utils/src/main/java/org/opentripplanner/utils/lang/StringUtils.java
index 72eb2638c13..c1a2219da72 100644
--- a/utils/src/main/java/org/opentripplanner/utils/lang/StringUtils.java
+++ b/utils/src/main/java/org/opentripplanner/utils/lang/StringUtils.java
@@ -132,6 +132,14 @@ public static String kebabCase(String input) {
return input.toLowerCase().replace('_', '-');
}
+ /**
+ * Create a URL-friendly "slug" version of the string, so "Entur Routebanken" becomes
+ * "entur-routebanken".
+ */
+ public static String slugify(String input) {
+ return input.toLowerCase().replace('_', '-').replaceAll("\\s+", "-");
+ }
+
/**
* Detects unprintable control characters like newlines, tabs and invisible whitespace
* like 'ZERO WIDTH SPACE' (U+200B) that don't have an immediate visual representation.
diff --git a/utils/src/test/java/org/opentripplanner/utils/lang/StringUtilsTest.java b/utils/src/test/java/org/opentripplanner/utils/lang/StringUtilsTest.java
index 7e8f0a6217b..dda9248468e 100644
--- a/utils/src/test/java/org/opentripplanner/utils/lang/StringUtilsTest.java
+++ b/utils/src/test/java/org/opentripplanner/utils/lang/StringUtilsTest.java
@@ -100,4 +100,10 @@ void containsInvisibleChars(String input) {
void noInvisibleChars(String input) {
assertFalse(StringUtils.containsInvisibleCharacters(input));
}
+
+ @ParameterizedTest
+ @ValueSource(strings = { "AAA Bbb", "aAa bbb", "aaa bbb", "aaa bbb", "AAA_BBB" })
+ void slugify(String input) {
+ assertEquals("aaa-bbb", StringUtils.slugify(input));
+ }
}