search icon
TravelTime API
Developer Tools
Database Plugins
TravelTime API
TravelTime API
Isochrone API
Distance Map API
TravelTime API
Travel Time Matrix API
Travel Time Matrix API
Protocol Buffers
TravelTime API
Routes API
Geocoding API
Additional API Reference
Error Handling
TravelTime API
ArcGIS plugin
QGIS plugin
Alteryx plugin

Map Tiles Leafletanchor icon

For interactive map development we suggest using open-source JavaScript library Leaflet. It's a lightweight, feature-rich library which can be extended with lots of plugins.

Here is a short guide on how to add a map to your project using Leaflet and TravelTime tiles. More extensive tutorials on using Leaflet can be found here.

Setting up maps on your page with TravelTime tilesanchor icon

To get the interactive map to work, first of all you’ll need to include CSS code needed for your page to access leaflet.js, then define elements, map size, default zoom parameters and focus point of the map.

  • Include Leaflet CSS file in the head section of your document:

<link rel="stylesheet" href=""
  • Include Leaflet JavaScript file after Leaflet’s CSS:

<script src=""
  • Put a div element with a certain id where you want your map to be:

<div id="mapid"></div>
  • Define map container height, for example by setting it in CSS:

#mapid { height: 180px; }
  • To initialize the map, set the inital geographical position of the map and a zoom level:

var mymap ='mapid').setView([51.505, -0.09], 13);
  • Add TravelTime tile layer to the map. Code below has the tiles server URL which includes the tiles style, in this case it’s lux and your access key should replace the YOUR_APP_ID string. Please note, that tiles are not available by default or with the free API key. To gain authentification please contact us at Use of attribution is required to meet OpenStreetMap and TravelTime copyright requirements.

L.tileLayer('{z}/{x}/{y}.png?key=YOUR_APP_ID', {
  attribution: 'Map data &copy; <a href="">OpenStreetMap</a> | Created with <a href="" target="_blank">TravelTime API</a>',
  maxZoom: 18,
  tileSize: 512,
  zoomOffset: -1

It is important to add 'tileSize: 512', 'maxZoom: 18' and 'zoomOffset: -1' parameters for tiles to be displayed correctly on Leaflet.

After doing all of these steps you should have a working map with mouse, touch interactions working as well as zoom and attribution control.

More extensive tutorials on using Leaflet can be found here.

Test example on CodePenanchor icon

Feel free to test tile styles and performance on a CodePen windown provided here. After entering your API authentification data to the APP_ID and APP_KEY you will be able to not only see tiles, but will be able to test TravelTime API as well.