map.js.coffee
# geocoderのインスタンス化
geocoder = new google.maps.Geocoder()
# geocodeメソッドを実行
geocoder.geocode { 'address': '静岡' }, (results, status)->
# ステータスが正しかった場合
if (status == google.maps.GeocoderStatus.OK)
# 緯度経度取得
latlng = results[0].geometry.location
# オプションの設定
options = { zoom: 15, center: latlng }
# マップの表示
map = new google.maps.Map(document.getElementById('map'), options)
# エラーが発生した場合
else
console.log('マップを取得できませんでした')