Domanda

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?!

È stato utile?

Soluzione

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++.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top