私はRubyonRailsでアプリを作成しています。これは
、私のコードが適切にインデントされていると信じている私のコーヒースクリプトファイルの1つですが、それでもエラーが発生します。
エラーが発生している行に、以下のコメントでマークを付けました。
助けてください!
jQuery ->
today_date = new Date()
month = today_date.getMonth()
day = today_date.getDay()
pkpstyle= [
featureType: "landscape.natural"
elementType: "geometry"
stylers: [
lightness: -29
,
hue: "#ffee00"
,
saturation: 54
]
,
featureType: "poi.park"
stylers: [
lightness: -35
,
hue: "#005eff"
]
,
featureType: "road.arterial"
,
featureType: "road.arterial"
stylers: [ lightness: 45 ]
]
tempDay = 4
//I get an error here saying Uncaught TypeError: undefined is not a function
today_latlng = getLatlng(stops[tempDay])
markericon = new google.maps.MarkerImage("/assets/cycling.png")
myOptions =
center: today_latlng
zoom: 12
minZoom: 4
styles: pkpstyle
mapTypeId: google.maps.MapTypeId.ROADMAP
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions)
for i of stops
latlng = getLatlng(stops[i].latlng)
marker = new google.maps.Marker(
map: map
icon: markericon
position: latlng
)
getLatlng = (loc) ->
loc_split = loc.split(", ")
lat = loc_split[0]
lng = loc_split[1]
new google.maps.LatLng(lat, lng)