minube / MapzenPHP

Client to query Mapzen (Valhalla) service
1 stars 0 forks source link

Mapzen PHP

How to use it

To extract all the points between different locations

$client = new \Mapzen\MapzenClient($apiKey);

$turnByTurn = new \Mapzen\Request\TurnByTurn();
foreach ($points as $point) {
        $turnByTurn->addLocation($point['latitude'], $point['longitude']);
}
$result = $client->turnByTurn($turnByTurn);
$points = $result->getDecodedRoutePoints();