   out;
   """
 
+route_params = (from, to) ->
+  "from_lat=#{from.lat}&from_lon=#{from.lng}&to_lat=#{to.lat}&to_lon=#{to.lng}"
+
 findClosestTo = (origin, parsed) ->
   minDistance = 1000
   found = null

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

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

      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)

