Skip to content

Instantly share code, notes, and snippets.

@here-devblog-gists
Created November 7, 2016 09:34
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 here-devblog-gists/19cd9a7da3344a731c1399c2c1a0aa45 to your computer and use it in GitHub Desktop.
Save here-devblog-gists/19cd9a7da3344a731c1399c2c1a0aa45 to your computer and use it in GitHub Desktop.
HEREMap.prototype.updateMyPosition = function(event) {
this.position = {
lat: event.coords.latitude,
lng: event.coords.longitude
};
// Remove old location marker if it exists
this.updateMarker('myLocation', this.position)
// Draw the route from current location to HERE HQ if not yet drawn
this.drawRoute(this.position, HEREHQcoordinates);
this.map.setCenter(this.position);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment