function displayMap() {
navigator.geolocation.getCurrentPosition(function(position) {
var coordinates = new google.maps.LatLng(position.coords.latitude,
position.coords.longitude);
var map = new google.maps.Map(document.body, {
center: coordinates,
zoom: 17
});
var direction = new google.maps.DirectionsService();
direction.route({
origin: coordinates,
destination: coordinates,
travelMode: google.maps.DirectionsTravelMode.DRIVING
}, function (response, status) {
var marker = new google.maps.Marker({
position: coordinates,
title: response.routes[0].legs[0].start_address,
map: map
});
});
});
}