I am trying to make a custom map in which you can make a route from point A to point B.
var start_point; var geocoder = new google.maps.Geocoder(); geocoder.geocode({ 'address': 'Москва' }, function (results) { start_point = results[0].geometry.location; console.log(start_point); //тут выводит координаты }); console.log(start_point); //undefind Why can't I overwrite a variable?