1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
var geocoder;
var directionsDisplay;
var map;
$(document).ready(function() {
geocoder = new google.maps.Geocoder();
directionsDisplay = new google.maps.DirectionsRenderer();
var latlng = new google.maps.LatLng(2.20, 48.52);
var myOptions = {
zoom: 12,
center: latlng,
disableDefaultUI: true,
navigationControl: true,
scrollwheel: false,
navigationControlOptions: {
style: google.maps.NavigationControlStyle.SMALL,
position: google.maps.ControlPosition.TOP_RIGHT
},
mapTypeId: google.maps.MapTypeId.HYBRID
};
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
directionsDisplay.setMap(map);
});
function getDistance(dep, arr) {
var directionsService = new google.maps.DirectionsService();
$("#estim").hide();
$(".err-hide").hide();
$("#estim_wait").show();
var request = {
origin: dep,
destination: arr,
travelMode: google.maps.DirectionsTravelMode.DRIVING,
unitSystem: google.maps.DirectionsUnitSystem.METRIC
}; |
Partager