jquery - why does geocomplete not trigger bounds_changed event? -


i have google map takes whole screen size. there top bar has geocomplete text field, can type in place name , map moves place. however, problem fails trigger bounds_changed event.

second problem is, when map first loads, can't drag (the hand icon doesn't appear). after move other place using geocomplete field i'm able drag map. following relevant code snippet i've used.

$(document).ready ->  google.maps.event.addlistener window.map, "bounds_changed", ->    // here fire ajax request retrieve data , display in custom overlay.  if navigator.geolocation navigator.geolocation.getcurrentposition(set_user_location,error, { 'enablehighaccuracy' : 'true' })   set_user_location = (position) -> mapoptions =   center: new google.maps.latlng(position.coords.latitude, position.coords.longitude)   zoom: 14 window.map = new google.maps.map(document.getelementbyid("map-canvas"), mapoptions) $('.countries-dropdown').geocomplete   map: '#map-canvas'   mapoptions: { scrollwheel: true }   bounds: true .bind 'geocode:result', (event,result) ->   console.log 'result'   console.log result .bind 'geocode:error', (event,result) ->   console.log 'error' 

please leave comment if above information not enough. thanks.

nevermind. fixed bug myself. needed give window.map object in place of selector. is, instead of this

$('.countries-dropdown').geocomplete map: '#map-canvas' 

used this

$('.countries-dropdown').geocomplete map: window.map 

Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -