Skip to content

Instantly share code, notes, and snippets.

@niraj-shah
Last active December 10, 2015 18:28
Show Gist options
  • Save niraj-shah/4474306 to your computer and use it in GitHub Desktop.
Save niraj-shah/4474306 to your computer and use it in GitHub Desktop.
The success function
function success(position) {
// variable to store the coordinates
var location = position.coords.latitude + ',' + position.coords.longitude;
// select the span with id status
var s = $('#status');
// update the status message
s.html('found you!');
// Google Maps image using location
$('#wrapper').append('<img src="http://maps.google.com/maps/api/staticmap?center='+ location +
'&zoom=17&markers=size:medium|color:red|'+ location +
'&path=color:0x0000FF80|weight:2|'+ location +
'&size=480x360&sensor=false" />');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment