画面サイズ全体を占めるGoogleマップがあります。ジオコンプリート テキスト フィールドがあるトップ バーがあるので、場所の名前を入力すると、マップがその場所に移動します。ただし、問題は、bounds_changed イベントのトリガーに失敗することです。
2 つ目の問題は、マップを最初にロードしたときに、マップをドラッグできない (手のアイコンが表示されない) ことです。地図をドラッグできるのは、geocomplete フィールドを使用して別の場所に移動した後でのみです。以下は、私が使用した関連するコード スニペットです。
$(document).ready ->
google.maps.event.addListener window.map, "bounds_changed", ->
// Here I fire an ajax request to retrieve some data and display it in a 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'
上記の情報が十分でない場合は、コメントを残してください。ありがとう。