Skip to content

Instantly share code, notes, and snippets.

@TravelTime-Frontend
Last active February 21, 2023 08:50
Show Gist options
  • Save TravelTime-Frontend/3d801837e67c6406de6ec35114e2a303 to your computer and use it in GitHub Desktop.
Save TravelTime-Frontend/3d801837e67c6406de6ec35114e2a303 to your computer and use it in GitHub Desktop.
TravelTime Isochrone API GeoJSON request
import {
TravelTimeClient,
} from 'traveltime-api';
const travelTimeClient = new TravelTimeClient({
apiKey: 'YOUR_APP_KEY',
applicationId: 'YOUR_APP_ID',
});
const departure_search = {
id: 'public transport from Trafalgar Square',
coords: { lat: 51.507609, lng: -0.128315 },
departure_time: new Date().toISOString(),
travel_time: 900,
transportation: { type: 'public_transport' },
properties: ['is_only_walking'],
};
travelTimeClient.timeMap({
departure_searches: [departure_search],
}, 'application/geo+json').then((data) => console.log(data))
.catch((e) => console.error(e));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment