Displaying toll roads

This article explains how to visualize toll roads on a map. Note that the vehicleClosed attributes and the time dependency are not taken into account to display the toll roads; that means a road can be rendered as tolled even if it is free of charge for your vehicle or at the time you drive on it. Nevertheless the map may contain different sets of toll roads for example when it is already known that at some point in the future new roads will be tolled.

Benefits

This feature gives you the ability to see the toll roads and the toll locations.

Prerequisites

Check if the following prerequisites are fulfilled before you start with the use case:

  • Installed and licensed PTV xMap Server
  • Installed PTV Map containing toll data
  • Installed and activated license key toll

Programming Guide

When using the RESTClosed API to build a tiled map, the REST operation tile is part of the following URL, by means individual tiles can be requested:

http://hostname:50000/services/rest/XMap/tile/{zoomLevel}/{x}/{y}?storedProfile={profileClosed}

Concrete values in URL template have to be defined for zoomlevel, x and y coordinates, specifying the map section of the corresponding tile.

To display toll roads on a map with common content, the parameter layers has to be specified in the URL enabling all base layers and toll.

http://hostname:50000/services/rest/XMap/tile/{zoomLevel}/{x}/{y}?storedProfile={profile}&layers=labels,transport,background,toll

To obtain a map which contains only toll roads, the parameter layers has to be specified in the URL enabling only toll.

http://hostname:50000/services/rest/XMap/tile/{zoomLevel}/{x}/{y}?storedProfile={profile}&layers=toll

With the request option timeConsideration set to SNAPSHOT it is possible to define a point in time for which the toll roads should be displayed.

http://hostname:50000/services/rest/XMap/tile/{zoomLevel}/{x}/{y}?storedProfile={profile}&layers=labels,transport,background,toll&timeConsideration=SNAPSHOT&referenceTime={referenceTime}

Example

In the example below, which is based on the one from Displaying a Basic Interactive Map, Toll roads are displayed on a tiled map using the Leaflet toolkit depending on the toll data detail level. The function determineTollLayer sends a dataInformation request and checks the toll detail level of the map. If there is detailed toll data available for at least some parts of the map, the toll layer is requested in addition to the other base layers.

Related Topics

The following topics might be relevant for this use case.