Bangladesh Navigation Map API — Routing, Geocoding & Vector Tiles
What you need:
Authorization: Bearer YOUR_API_KEY[email protected]) for mapslat,lng for API params (e.g. origin=23.81,90.41)Polyline: Route polylines use Valhalla polyline6 (6 decimal precision). Use factor 1e6 when decoding — see our demo for reference.
// Polyline6 decode (matches our demo - [email protected]) function decodePolyline(str) { const factor = 1e6; // Valhalla polyline6 const coords = []; let i = 0, lat = 0, lng = 0; while (i < str.length) { let b, shift = 0, result = 0; do { b = str.charCodeAt(i++) - 63; result |= (b & 0x1f) << shift; shift += 5; } while (b >= 0x20); const dlat = (result & 1) ? ~(result >> 1) : (result >> 1); result = 0; shift = 0; do { b = str.charCodeAt(i++) - 63; result |= (b & 0x1f) << shift; shift += 5; } while (b >= 0x20); const dlng = (result & 1) ? ~(result >> 1) : (result >> 1); lat += dlat; lng += dlng; coords.push([lng / factor, lat / factor]); // [lng, lat] for GeoJSON } return coords; }
Tiles: Add Authorization header via MapLibre transformRequest. Vector layers: water, roads (Planetiler schema).
Authorization: Bearer YOUR_API_KEY
https://map.arohon.co
Calculate a route between two points. Returns distance, duration, polyline (for map drawing), and turn-by-turn steps.
Params: origin=lat,lng destination=lat,lng vehicle_type=car|bike|motorbike|pedestrian|truck|bus|taxi|cng
curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://map.arohon.co/v1/route?origin=23.81,90.41&destination=23.75,90.37&vehicle_type=car"
Response: {"distance": 10.89, "duration": 642, "polyline": "...", "steps": [...]}
The polyline field uses Valhalla polyline6 (factor 1e6). Use the decoder above — add decoded [lng, lat] coordinates as a GeoJSON LineString to your map. See our demo for a working example.
ETA and distance matrix for driver dispatch (many-to-many).
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{"origins":[[23.81,90.41]],"destinations":[[23.75,90.37],[23.70,90.35]],"vehicle_type":"car"}' \
"https://map.arohon.co/v1/matrix"
Snap GPS traces to the road network.
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{"gps_points":[[23.81,90.41],[23.80,90.40]],"vehicle_type":"car"}' \
"https://map.arohon.co/v1/match"
Reachable area within a time limit (drive-time polygon).
Params: origin=lat,lng time_limit=15 vehicle_type=car
curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://map.arohon.co/v1/isochrone?origin=23.81,90.41&time_limit=15&vehicle_type=car"
Forward geocoding — search for places by name.
curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://map.arohon.co/v1/search?q=Dhaka&size=10"
Reverse geocoding — get address from coordinates.
curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://map.arohon.co/v1/reverse?lat=23.81&lng=90.41"
Address autocomplete.
curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://map.arohon.co/v1/autocomplete?q=banani&size=5"
Vector tiles (MapLibre / Mapbox compatible). Requires Authorization header. Layers: water, roads, boundary, buildings, poi.
// MapLibre style + transformRequest for auth
map = new maplibregl.Map({
style: {
sources: {
arohon: {
type: 'vector',
tiles: ["https://map.arohon.co/tiles/{z}/{x}/{y}"],
minzoom: 0,
maxzoom: 14
}
},
layers: [
{ id: 'water', type: 'fill', source: 'arohon', 'source-layer': 'water', paint: { 'fill-color': '#aad3df' } },
{ id: 'roads', type: 'line', source: 'arohon', 'source-layer': 'roads', paint: { 'line-color': '#019157', 'line-width': 2 } }
]
},
transformRequest: (url, resourceType) => {
if (resourceType === 'Tile' && url.startsWith('https://map.arohon.co'))
return { url, headers: { 'Authorization': 'Bearer ' + apiKey } };
return { url };
}
});
Service health check.
curl "https://map.arohon.co/health"