M
M
Maxim2019-03-14 00:58:43
JavaScript
Maxim, 2019-03-14 00:58:43

Country code by city?

When choosing a city, how to get the country code and the country itself?

<form action="" class="search-delivery">
        <input type="text" name="city" id="location_city" placeholder="Москва">
    </form>

var pac_input = document.getElementById('location_city');
$(function(){
  var autocomplete = new google.maps.places.Autocomplete(pac_input);
});

<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&amp;libraries=places&amp;language=ru&amp;key=AIzaSyCSJmcUclvlj25FmDdGS8GMdr_3wkTv2Y8"></script>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question