HTMLspecstableimplmature
HTML encoding for every supported resource.
Scope
Conformance Classes
JSON implements all requirements of conformance class HTML from OGC API - Features - Part 1: Core 1.0 for the resources Landing Page, Conformance Declaration, Feature Collections, and Feature Collection.
Configuration
Custom Templates
The HTML encoding is implemented using Mustache templates. Custom templates are supported, they have to reside in the data directory under the relative path templates/html/{templateName}.mustache
, where {templateName}
equals the name of a default template (see source code on GitHub).
Login Provider
For APIs with restricted access using an identity provider with login capabilities, the loginProvider
option can be set to enable automatic redirects to the login form of the identity provider for restricted HTML pages. The logged-in user will also be shown on all HTML pages along with a logout button.
WARNING
This functionality uses cookies to retain the login information when navigating between HTML pages. The cookies are neither processed nor passed on to any third party.
In regard to the European GDPR and the German TTDSG we would deem these cookies as technically required. That means if you publish an API with this functionality, you would be required to mention these cookies in the privacy policy. :::6
Info
If the identity provider uses https
(which it should), this feature only works if the API is also published using https
. The only exception is accessing an API on localhost
.
Options
Name | Default | Description | Type | Since |
---|---|---|---|---|
buildingBlock | Always HTML . | string | v2.0 | |
extensionType | Deprecated See buildingBlock . | string | v2.0 | |
enabled | true | Enable the building block? | boolean | v2.0 |
noIndexEnabled | true | Set noIndex for all sites to prevent search engines from indexing. | boolean | v2.0 |
schemaOrgEnabled | true | Enable schema.org annotations for all sites, which are used e.g. by search engines. The annotations are embedded as JSON-LD. | boolean | v2.0 |
microdataEnabled | true | Deprecated See schemaOrgEnabled . | boolean | v2.0 |
collectionDescriptionsInOverview | false | Show collection descriptions in the HTML representation of the Feature Collections resource. | boolean | v2.0 |
suppressEmptyCollectionsInOverview | false | Suppress collections without items in the HTML representation of the Feature Collections resource. | boolean | v3.4 |
sendEtags | boolean | v2.0 | ||
legalName | Legal notice | Label for optional legal notice link on every site. | string | v2.0 |
legalUrl | null | URL for optional legal notice link on every site. | string | v2.0 |
privacyName | Privacy notice | Label for optional privacy notice link on every site. | string | v2.0 |
privacyUrl | null | URL for optional privacy notice link on every site. | string | v2.0 |
defaultStyle | NONE | A default style in the style repository that is used in maps in the HTML representation of the feature and tile resources. If NONE , a simple wireframe style will be used with OpenStreetMap as a basemap, if the map client is MapLibre; for Cesium, the default 3D Tiles styling will be used with the basemap. If the value is not NONE and the map client is MapLibre, the API landing page (or the collection page) will also contain a link to a web map with the style for the dataset (or the collection). | string | v2.0 |
basemapUrl | https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png | URL template for background map tiles. | string | v2.0 |
basemapAttribution | © <a href='http://osm.org/copyright'>OpenStreetMap</a> contributors | Source attribution for background map. | string | v2.0 |
leafletUrl | https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png | Deprecated See basemapUrl . | string | v2.0 |
leafletAttribution | © <a href='http://osm.org/copyright'>OpenStreetMap</a> contributors | Deprecated See basemapAttribution . | string | v2.0 |
openLayersUrl | https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png | Deprecated See basemapUrl . | string | v2.0 |
openLayersAttribution | © <a href='http://osm.org/copyright'>OpenStreetMap</a> contributors | Deprecated See basemapAttribution | string | v2.0 |
footerText | null | Additional text shown in footer of every site. | string | v2.0 |
loginProvider | null | Option to enable automatic redirects to the login form of an identity provider. The value is the id of a provider with login capabilities in the global configuration. Also see Login Provider. | string | v2.0 |
additionalApis | array | v2.0 |
Examples
Example of the specifications in the configuration file (from the API for Topographic data in Daraa, Syria):
- buildingBlock: HTML
enabled: true
noIndexEnabled: true
schemaOrgEnabled: true
defaultStyle: topographic
Example of the specifications in the configuration file (from the API for Vineyards in Rhineland-Palatinate](https://demo.ldproxy.net/vineyards)):
- buildingBlock: HTML
enabled: true
noIndexEnabled: false
schemaOrgEnabled: true
collectionDescriptionsInOverview: true
legalName: Legal notice
legalUrl: https://www.interactive-instruments.de/en/about/impressum/
privacyName: Privacy notice
privacyUrl: https://www.interactive-instruments.de/en/about/datenschutzerklarung/
basemapUrl: https://sg.geodatenzentrum.de/wmts_topplus_open/tile/1.0.0/web_grau/default/WEBMERCATOR/{z}/{y}/{x}.png
basemapAttribution: '©<a href="https://www.bkg.bund.de" target="_new" >Bundesamt für Kartographie und Geodäsie</a>(2020), <a href="https://sg.geodatenzentrum.de/web_public/Datenquellen_TopPlus_Open.pdf" target="_new" >Datenquellen</a>'
defaultStyle: default