Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// HERE HQ in Berlin, Germany:
var HEREHQcoordinates = {
lat: 52.530974,
lng: 13.384944
var routeRendered = false;
function updatePosition (event) {
var coordinates = {
lat: event.coords.latitude,
lng: event.coords.longitude
var marker = new;
// If the route has not been rendered yet,
// calculate and render it
if (!routeRendered) {
var route = new HERERoute(map, platform, {
mode: 'fastest;car',
representation: 'display',
waypoint0: locationToWaypointString(coordinates),
waypoint1: locationToWaypointString(HEREHQcoordinates)
routeRendered = true;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment