Arohon Map API

Bangladesh Navigation Map API — Routing, Geocoding & Vector Tiles

Developer Requirements

What you need:

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).

Authentication: All API requests (except /health) require Authorization: Bearer YOUR_API_KEY

Sign up or Log in to get your API key.

Base URL

https://map.arohon.co

Route

GET /v1/route

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": [...]}

Polyline

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.

Distance Matrix

POST /v1/matrix

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"

Map Matching

POST /v1/match

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"

Isochrone

GET /v1/isochrone

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"

Geocoding

GET /v1/search

Forward geocoding — search for places by name.

curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://map.arohon.co/v1/search?q=Dhaka&size=10"
GET /v1/reverse

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"
GET /v1/autocomplete

Address autocomplete.

curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://map.arohon.co/v1/autocomplete?q=banani&size=5"

Map Tiles

GET /tiles/{z}/{x}/{y}

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 };
  }
});

Health (no auth)

GET /health

Service health check.

curl "https://map.arohon.co/health"