Skip to content

Instantly share code, notes, and snippets.

@leopectus
Created October 8, 2015 10:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leopectus/3342c6b334cf89f33c68 to your computer and use it in GitHub Desktop.
Save leopectus/3342c6b334cf89f33c68 to your computer and use it in GitHub Desktop.
Maps API for JavaScript snippet generated by the HERE API Explorer (calculate route from A to B using public transport)
/*
* @param {H.service.Platform} platform
*/
function calculateRoute(platform) {
var router = platform.getRoutingService(),
parameters = {
waypoint0: '52.5208,13.4093',
waypoint1: '52.5034,13.3295',
mode: 'fastest;publicTransport',
combineChange: 'true'};
router.calculateRoute(parameters,
function (result) {
alert(result);
}, function (error) {
alert(error);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment