Skip to content

Instantly share code, notes, and snippets.

@omas
Created December 9, 2014 13:11
Show Gist options
  • Select an option

  • Save omas/72995b4a5bf86ea98f78 to your computer and use it in GitHub Desktop.

Select an option

Save omas/72995b4a5bf86ea98f78 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<script src='https://code.jquery.com/jquery-2.1.1.min.js'></script>
<script>
$(function(){
var uri = 'http://maps.google.com/maps/api/staticmap?';
var query = {
zoom:14
,size:"512x512"
,sensor:true
};
navigator.geolocation.getCurrentPosition(function(pos){
query.center = [
pos.coords.latitude
,pos.coords.longitude
].join();
$("<img/>",{
src:uri + $.param(query)
}).appendTo("body");
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment