I'm trying to convert this homepage to AMP: excurj.com. Is there a way to keep the Autocomplete feature on the hero search field ?
I saw this question. However, I need these two scripts to make autocomplete work:
<script src="{% static 'js/autocomplete.js' %}"></script>
<script src="https://maps.googleapis.com/maps/api/js?key=*****&callback=initMap&libraries=places"></script>
This is what's inside autocomplete.js:
// script to auto complete location
function initMap() {
var defaultBounds = new google.maps.LatLngBounds(
new google.maps.LatLng(-90, 91), new google.maps.LatLng(-180, 80));
var options = {
types: ['(cities)'],
bounds: defaultBounds
};
var input = document.getElementById('google_city_search');
var autocomplete = new google.maps.places.Autocomplete(input, options);
}