문제

map.on "click", (e) ->
  if count >= 2
    map.removeLayer(newMarkerGroup)
    count = 0
    return
  else
    newMarker = new L.marker(e.latlng).addTo(map)
    count= count+1
    return

Why am I getting the unexpected if statement, I think my code is properly indented?!

도움이 되었습니까?

해결책

Found the solution. Notepad ++ was acting strange, it was immediately adding tab when it sees 4 white spaces, and coffeescript didn't like it. Just turn off that option in Notepad++.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top