With the Vector Maps service you can render geographical vector tiles with your own renderer.
Using the Vector Maps API is simple. Follow the steps on this page to get started with rendering maps. You can use the open source MapLibre renderer for this.
Please note the individual rate and request limits for each API. You can find all limits in our FAQ.
API Endpoint
To send a vector tiles request you need to use the following API endpoint
https://api.myptv.com/maps/v1/vector-tiles
Request
For a single tile showing Paris, France specify the map tile path with zoomLevel, x and y as shown below.
You can test this by entering the URL into your web browser (be sure to replace YOUR_API_KEY with your actual API key).
https://api.myptv.com/maps/v1/vector-tiles/11/1037/704?apiKey=YOUR_API_KEY
Alternatively you can choose one of the following options to send your request. You also have the option to send the API key in the request header.
cURL:
curl --location --request GET "https://api.myptv.com/maps/v1/vector-tiles/11/1037/704" --header "ApiKey: YOUR_API_KEY"
PowerShell:
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("ApiKey", "YOUR_API_KEY")
$response = Invoke-RestMethod "https://api.myptv.com/maps/v1/vector-tiles/11/1037/704" -Method GET -Headers $headers
Response
The call result is a single map tile in MapBox Vector Tiles format.
Copyright
Attribution
The usage of the PTV Developer map requires attribution to the PTV and their data providers.
If you use map styles provided by PTV, the correct attribution is delivered in the style.
Adding copyright information to the map
Adding copyright information is only necessary if you do not use map styles provided by PTV or if you have to add additional copyright information to your map.
Adding attribution is very simple. Add the following two options when initializing the renderer (as an example, we will set an additional copyright of 'ContentProvider'):
<script>
...
var map = new maplibregl.Map({
attributionControl: true,
customAttribution: 'ContentProvider',
...
});
...
</script>
The custom attribution is merged with the copyright provided in the map style. The latest copyright string can be obtained from a map style provided by PTV.
Used fonts
Noto is licensed under Apache License Version 2.0, January 2004