     $("##{ elementId }").prop("disabled", true)
 
   displayWayData = (way) ->
-    id = way.id
-    $("#wayId").html(id)
+    $("#wayId").html(way.id)
     $("#wayLength").val(way.length)
     $("#wayMaxSpeed").val(way.maxSpeed)
     $("#wayTripTime").val(way.tripTime)


  $(() ->
    map = L.map("map",
      layers: [cloudMadeLayer, incomingWaysLayer, osmLayer, outgoingWaysLayer, waysLayer, directionsLayer, nodesLayer]
    ).fitWorld()
    baseLayers =
      "CloudMade": cloudMadeLayer


  deselectWay = (style) ->
    if selectedWay?
      clearWayData()
      selectedWay.setStyle(style)
      selectedWay = null

  displayNodeData = (node) ->
    $("#nodeId").html("<a href=\"http://www.openstreetmap.org/browse/node/#{ node.id }\">#{ node.id }</a>")
    $("#nodeLongitude").html(node.longitude)
    $("#nodeLatitude").html(node.latitude)

  retrieveNodes = () ->
    $.get "nodes",
