Javascript/Google Maps Autocomplete

You might also try adding defer to your script tag

<script defer src="https://maps.googleapis.com/maps/api/js?key=[MY KEY]&libraries=places"></script>

Bonus - you can also move your function to python


from anvil.js.window import google


class Form1(Form1Template):
  def __init__(self, **properties):
    # Set Form properties and Data Bindings.
    self.init_components(**properties)
    google.maps.places.Autocomplete(anvil.js.get_dom_node(self.address_box))

3 Likes