I want to get the auto plete behaviour of the Google maps, but I am not getting the exact reason why it is showing this
*Uncaught TypeError: Cannot read property 'Autoplete' of undefined *
where as I used this
var addressValue = document.getElementById('geoFenceAddress');
alert(addressValue);
var autoplete = new google.maps.places.Autoplete(addressValue);
autoplete.bindTo('bounds', geoFenceAddress);
I have an element with id 'geoFenceAddress' and infact the alert is showing this [Object HTMLInputElement].
I am not understanding where I am lacking , please shed some light.........
:(
I want to get the auto plete behaviour of the Google maps, but I am not getting the exact reason why it is showing this
*Uncaught TypeError: Cannot read property 'Autoplete' of undefined *
where as I used this
var addressValue = document.getElementById('geoFenceAddress');
alert(addressValue);
var autoplete = new google.maps.places.Autoplete(addressValue);
autoplete.bindTo('bounds', geoFenceAddress);
I have an element with id 'geoFenceAddress' and infact the alert is showing this [Object HTMLInputElement].
I am not understanding where I am lacking , please shed some light.........
:(
Share asked Dec 11, 2012 at 5:43 Ankur VermaAnkur Verma 5,93316 gold badges61 silver badges95 bronze badges 01 Answer
Reset to default 6You need to add the places library when you load the API.
<script src="https://maps.googleapis./maps/api/js?sensor=false&libraries=places"></script>
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744920194a4601085.html
评论列表(0条)