私のコーヒースクリプトは次のようになります。
initialize = ->
$.ajax
url: "map_groups/1.json"
type: "get"
dataType: "json"
success: (response) ->
console.log response
mapOptions =
center: new google.maps.LatLng(response.latitude, response.longitude)
zoom: 16
mapTypeId: google.maps.MapTypeId.ROADMAP
問題は、mapOptions
ajax 応答にアクセスできる必要があることです。response
がアクセスできるように、 のスコープを拡大するにはどうすればよいmapOptions
ですか?