2

I have seen the following example of the Autosuggestion Google Maps feature

https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete?hl=en

However, if I put a given location, and does not select a suggested item, but hits Enter key, an alert box displays saying "Autcomplete returned place contains no geometry".

I have seen Drupal modules based on the JS library that detect the place and does not display this caveat. If you write a non-existing location, it does nothing, but if you write "Barcelona", for example, but hits Enter Key instead of selecting the suggestion, it works perfectly.

How can achieve this? Maybe selecting automatically the first option of the suggested list? And what would be the code?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.