       found = elemLatLng
   found
 
+drawPath = (from, to) ->
+  fetch("/calculate_route?#{route_params(from, to)}")
+    .then((response) => response.text())
+    .then((body) =>
+      debugger
+    )
+
 document.addEventListener('DOMContentLoaded', ->
   map = L.map('map').setView([25.1701, 121.6], 15)
 

        found = findClosestTo(latlng, JSON.parse(body))
        if found?
          L.marker(found).addTo(map)
        else
          # TODO: change this to a nice error message
          console.log("no ways next to #{latlng}")

    attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
  ).addTo(map)

  prevMarker = null
  map.on('click', (ev) ->
    latlng = ev.latlng
    console.log(latlng)
