javascript - Autocomplete in google maps places throws error TypeError: undefined is not a function (evaluating 'a[zG]("placeholder")') -
i struggling more should.
i creating simple search map feature, autocomplete throws me not-so-descriptive error: typeerror: undefined not function (evaluating 'azg')
i initialising map in bootstrap modal on modal.s.shown event.
here javascript:
$('#map-modal').on('shown.bs.modal', function (e) { //picking data attributes image initialised modal var image = $(e.relatedtarget); map_lat = $(image).data('lat'); map_lng = $(image).data('lng'); //passing data initialise map function initialisemodalmap(map_lat,map_lng); //add autocomplete var input = $('#start-point'); var options = { types: ['geocode'] }; var autocomplete = new google.maps.places.autocomplete(input, options); autocomplete.bindto('bounds', map); google.maps.event.addlistener(autocomplete, 'place_changed', function() { console.log('changed'); }); });
but event shown.bs.modal fired, following error in console:
typeerror: undefined not function (evaluating 'a[zg]("placeholder")')
and autocomplete never executed, , before autocomplete chunk of code, fine.
what missing?
if need more info please ask.
thanks in advance!
when switched vanilla javascript input element, error not thrown
so instead
var input = $('#start-point');
i put
var input = document.getelementbyid('start-point');
but dropdown of autocomplete not rendered, guess whole different question
Comments
Post a Comment