Migrating from Google Directions & Distance Matrix

Migrate from Google Directions API and Distance Matrix API to Woosmap Distance API — REST endpoints, JS SDK examples, and key differences.

Google’s Directions API and Distance Matrix API map to Woosmap’s Distance API: Route endpoint for directions, Matrix endpoint for many-to-many calculations.

REST API: Directions (Route)

Shell
        # Google Maps
curl "https://maps.googleapis.com/maps/api/directions/json?origin=48.8566,2.3522&destination=52.5246,13.4235&key=YOUR_GOOGLE_KEY"

# Woosmap
curl "https://api.woosmap.com/distance/route/json?origin=48.8566,2.3522&destination=52.5246,13.4235&private_key=YOUR_PRIVATE_KEY"

    

⚠️ The endpoint is /distance/route/json, not /directions/json — a global find-and-replace won’t catch this.

REST API: Distance Matrix

Shell
        # Google Maps
curl "https://maps.googleapis.com/maps/api/distancematrix/json?origins=48.8566,2.3522&destinations=52.5246,13.4235|40.7128,-74.0060&key=YOUR_KEY"

# Woosmap
curl "https://api.woosmap.com/distance/distancematrix/json?origins=48.8566,2.3522&destinations=52.5246,13.4235|40.7128,-74.0060&key=YOUR_KEY"

    

JS SDK

Same pattern as the map migration — namespace swap:

JavaScript
        // Google Maps
const directionsService = new google.maps.DirectionsService();
const directionsRenderer = new google.maps.DirectionsRenderer({ map });

directionsService.route(
  {
    origin: { lat: 48.8566, lng: 2.3522 },
    destination: { lat: 52.5246, lng: 13.4235 },
    travelMode: google.maps.TravelMode.DRIVING,
  },
  (result, status) => {
    if (status === "OK") directionsRenderer.setDirections(result);
  }
);

// Woosmap
const directionsService = new woosmap.map.DirectionsService();
const directionsRenderer = new woosmap.map.DirectionsRenderer({ map });

directionsService.route(
  {
    origin: { lat: 48.8566, lng: 2.3522 },
    destination: { lat: 52.5246, lng: 13.4235 },
    travelMode: woosmap.map.TravelMode.DRIVING,
    unitSystem: woosmap.map.UnitSystem.METRIC,
  },
  (result, status) => {
    if (status === "OK") directionsRenderer.setDirections(result);
  }
);

    

Note the unitSystem parameter — Woosmap lets you request METRIC or IMPERIAL results directly.

Travel Modes

Travel Mode Google (Routes API) Woosmap REST Woosmap JS SDK
Driving DRIVE driving woosmap.map.TravelMode.DRIVING
Walking WALK walking woosmap.map.TravelMode.WALKING
Cycling BICYCLE cycling woosmap.map.TravelMode.CYCLING

Woosmap’s mode parameter is case-insensitive.

Key Differences

Area Google Maps Woosmap
Directions path /directions/json /distance/route/json
Matrix path /distancematrix/json /distance/distancematrix/json
Authentication Single key key (client) / private_key (server)
Was this helpful?