Skip to Content

how to implement google autocomplete API in sap webIDE

I have created a sapui5 application in WEBIDE. In index.html i added below script
<scriptsrc="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=places&callback=initMap"asyncdefer></script>

And then in view.xml

<Input id="search" type="Text"/>

In controller of that view

onInit: function() { var autoComplete = new google.maps.places.Autocomplete($("#search")); }

This is just the extract of complete code.

This is throwing below error (For proper error vie, please find attached image)

InvalidValueError: not an instance of HTMLInputElement

Please find below URL, for reference

https://developers.google.com/maps/documentation/javascript/examples/places-autocompleteerror.jpg

error.jpg (66.4 kB)
Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

0 Answers