JSFiddle - React, Tailwind, and code Playground

by Horia-Adrian Ionescu

HTML

<script type="text/javascript" src = "https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true&libraries=places"></script>

JavaScript

function initialize() {
  var service = new google.maps.places.AutocompleteService();
  service.getQueryPredictions({ input: 'București RO' }, callback);
}

function callback(predictions, status) {
  if (status != google.maps.places.PlacesServiceStatus.OK) {
    alert(status);
    return;
  }

console.log(predictions[0].description);
}
initialize();