How to get all countries from google map with AngularJS

859 Views Asked by At

how can i get JSON list of all countries (autocomplet) in select for example With AngularJS (http://ngmap.github.io/)?

1

There are 1 best solutions below

2
Paula Tomasi On

A "place autocomplete" request is a url http with the following format (output can have the values json or xml): https://maps.googleapis.com/maps/api/place/autocomplete/output?parameters

The mandatory parameters are

  • input (string with the text you want to research)
  • key (the app's api key)

You can also set the location type you want (countries in this case). An example URL would be:

https://maps.googleapis.com/maps/api/place/autocomplete/json?input={TYPED_TEXT}&types=countries&key={YOUR_API_KEY}

You can check a detailed Google documentation for this here: https://developers.google.com/places/web-service/autocomplete