Last active
February 21, 2023 08:50
-
-
Save TravelTime-Frontend/3d801837e67c6406de6ec35114e2a303 to your computer and use it in GitHub Desktop.
TravelTime Isochrone API GeoJSON request
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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