TMaps API Examples
Live, copy-paste JavaScript examples for the TMaps APIs: maps, geocoding and routing with worldwide coverage and extra detail for Tunisia. Each example runs in the browser with Leaflet, OpenLayers or MapLibre GL, and shows the exact API request it sends.
API documentation · Source code on GitHub · Postman collection
Display a map
- 01Map with Leaflet
Raster tiles · Leaflet - 02Map with OpenLayers
Raster tiles · OpenLayers - 03Vector map styles
Vector tiles · MapLibre GL
Find addresses and places
- 04Address search
Forward geocoding - 05Address from a map click
Reverse geocoding - 08Nearby places
Nearby search
Complete use cases
Coming soon: static maps, directions, isochrones, route optimization and distance matrix examples.
Frequently asked questions
What is TMaps?
TMaps is a mapping platform built for Tunisia. Its APIs provide raster and vector map tiles, forward and reverse geocoding, nearby search, directions, route optimization, isochrones, a distance matrix and static map images, with worldwide coverage and extra detail for Tunisia.
How do I authenticate with the TMaps API?
Create an API key in the TMaps console and pass it in the api_key query parameter of every request, including POST requests. TMaps does not use an Authorization header.
Can I call the TMaps API from the browser?
Yes. Restrict the key to your own domains in the console (Authorized Domains). Requests from other origins are rejected with HTTP 403. Wildcards are not accepted, so add each subdomain and localhost explicitly.
Which map libraries work with TMaps?
Raster tiles follow the standard XYZ scheme and work with Leaflet, OpenLayers, MapLibre GL and mobile SDKs. Vector tiles are served as Mapbox Style Specification JSON for MapLibre GL JS and MapLibre Native.
What administrative data does TMaps geocoding return for Tunisia?
Each result includes the formatted address, GPS coordinates, a confidence score from 0 to 1 and the Tunisian administrative breakdown: street, postcode, commune, delegation and governorate.