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?

  • the scope is not the same - elik
  • By the way, do you know how to find the distance between them?) - elik
  • I know, I can throw an example - Dimka Rudnik
  • if it's not difficult, I found one in the documentation, but it’s too kaverezna) - elik

0