سؤال

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