guppylab

Routing — USD 49, one-time

How far, and how long, to each of these.

One origin, many destinations, one call. Real road distance and travel time — the numbers you need to order a list of stores, pickup points or drivers by how long it actually takes to get there, not by a straight line on a map.

Read this before buying: Android needs a routing endpoint.

iOS routes on the device through MapKit, free and with no key. Android has no on-device routing engine at all — Play Services Location only positions, the Maps SDK only draws, and the google.navigation: intent hands the user to the Maps app without returning anything.

So on Android the plugin talks to a routing service, and the plugin ships the adapter for five of them. The account is yours: billed to you, under that provider's terms, and any attribution they require is yours to display. We carry no quota and no key. Without a provider configured, Android falls back cleanly and tells your app so.

Providers on Android

MapboxMatrix API. The free tier is metered in elements — origins × destinations.
openrouteserviceResults are licensed CC-BY-SA and attribution is required. Check both against your use before choosing it.
GeoapifyCommercial use allowed on the free tier, with visible attribution.
GoogleRoutes computeRouteMatrix. Billed per element.
OSRMYour own osrm-backend, or any endpoint speaking its table/route shape — including your own API proxying one of the above.

Switching provider is one line of config. Each one speaks a different dialect — Geoapify indexes by target_index, Google returns an array with the duration as a string — and the adapters translate, so your app sees one shape.

A key in the app config ships inside the build, where anyone holding the APK can read it. For production, point the OSRM adapter at your own backend instead: the key stays on your server, results can be cached per area, and you can swap provider without shipping a new version.

What it does

How it looks

use Guppylab\Directions\Facades\Directions;
use Guppylab\Directions\Events\DistancesReceived;

Directions::distances($lat, $lng, [
    ['id' => 1, 'lat' => -23.5614, 'lng' => -46.6559],
    ['id' => 2, 'lat' => -23.5880, 'lng' => -46.6820],
]);

#[OnNative(DistancesReceived::class)]
public function onDistances(DistancesReceived $event): void
{
    if ($event->failed()) {
        $this->useStraightLineEstimate();

        return;
    }

    $this->etas = $event->routed();   // ['1' => ['meters' => 4312, 'seconds' => 780, …]]
}

Platforms

iOSMapKit MKDirections, iOS 15+. On-device, no key, no quota, nothing to configure.
AndroidAPI 21+, plus an account with one of the providers above. Requires INTERNET, which the plugin declares.
NativePHP Mobile3.x

Licence and delivery

Not sure it fits? Ask first: suporte@guppylab.com.br