Map Tile API

Characteristic

Short description

With the PTV xMap service RESTClosed REST (Representational State Transfer) represents a World Wide Web paradigm, consisting of constraints to the design of components which results in a better performance and maintainability. API for map tiles you are able to use de facto standards in web mapping to display interactive maps by using map tiles instead of a single map image.

Use

It is important to understand that the PTV xMap service only provides the map tiles. Any user interaction must be implemented on the client side, for example by using an existing JavaScript toolkit.

Detailed Consideration

Map Tiles

By using map tiles the displayed map is not requested as a single image but assembled from several map tiles with a default size of 256x256 pixels. The client application only requests the map tiles needed for the current map view. Whenever the map view changes (by zooming or panning), the application must only request the tiles that come into view but not the entire map.

The tiles generated by the PTV xMap service are delivered through a Representational State TransferClosed REST (Representational State Transfer) represents a World Wide Web paradigm, consisting of constraints to the design of components which results in a better performance and maintainability. (REST) API. REST is a pattern for simple stateless client-server protocols (see Wikipedia for an introduction). In the case of PTV xMap service, only GET requests for retrieving the individual tiles are supported.

Identification of map tiles

The figure illustrates the x and y identifiers for map tiles at z = 0 - 3

You can also check out this interactive map, where tiles are shown as an overlay in the map.

Projection and coordinate system

Displaying the (approximately ellipsoidal) surface of the earth on a flat surface, such as a computer screen, requires the use of a projection. PTV xMap service employs the Web Mercator (EPSG:3857) projection, which is the de-facto standard for web mapping. It is based on the WGS84 coordinate system. Check Coordinate Systems for further information about coordinate systems in the PTV xServer environment.

Addressing a map tile

The URL pattern of a map tile is http://hostname:50000/services/rest/XMap/tile/{z}/{x}/{y} (note the order of the parameters). This is the information you need to supply to your toolkit to have it display map tiles from the PTV xMap service.

Distance matrices are organized in columns and rows, squared and rectangular matrices are possible.

Good to know

Use Case

Check the use case Displaying a basic interactive map for information about the usage of map tiles, including an example using the Leaflet toolkit.

If you use the Leaflet toolkit together with a hatch configuration for Feature Layers it works only with image standard sizes like 128x128, 256 x 256, 512x512 or 1024x1024. If you use other images sizes you will get a hatch displacement at the image border.