We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4ef1c1c commit 2fb8333Copy full SHA for 2fb8333
examples/isochrones.php
@@ -0,0 +1,28 @@
1
+<?php
2
+include __DIR__ . '/../src/autoload.php';
3
+
4
+$inst = new \OSRM\Isochrones\OpenRouteService();
5
6
+$inst->setApiKey('{api_key}');
7
8
+try {
9
+ $response = $inst
10
+ ->setLocations([[8.681495,49.41461],[8.686507,49.41943]])
11
+ ->setRange([300,200])
12
+ ->fetch();
13
+ if ($response->isOK())
14
+ {
15
+ echo '<pre>';
16
+ print_r($response->getFeatures());
17
+ print_r($response->getBbox());
18
+ print_r($response->getMetadata());
19
+ var_dump($response->getType());
20
+ print_r($response->toArray());
21
+ } else {
22
+ echo 'Isochrone not found.';
23
+ }
24
+} catch (\OSRM\Exception $e) {
25
+ echo $e->getMessage();
26
+} catch (Exception $e) {
27
28
+}
0 commit comments