Geolocation: Displaying the Result in a Map

//in the example below, the returned latitude and longitude is used to show the //location in a Google Map (using a static image)

function showPosition(position) {
  var latlon = position.coords.latitude + "," + position.coords.longitude;

  var img_url = "https://maps.googleapis.com/maps/api/staticmap?center=
  "+latlon+"&zoom=14&size=400x300&sensor=false&key=YOUR_:KEY";

  document.getElementById("mapholder").innerHTML = "<img src='"+img_url+"'>";
}

To display the result in a map, you need access to a map service, like Google Maps.

Geolocation: Displaying the Result in a Map — Structure map

Clickable & Draggable!

Geolocation: Displaying the Result in a Map — Related pages: