   source = null
   sourceMarker = null
 
+  clearNodeData = () ->
+    $("#nodeId").html("")
+    $("#nodeLongitude").html("")
+    $("#nodeLatitude").html("")
+
+  clearWayData = () ->
+    $("#wayId").html("")
+    $("#wayLength").val("")
+    $("#wayMaxSpeed").val("")
+    $("#wayTripTime").val("")
+    $("#way-nodes").html("")
+
   deselectNode = () ->
     if selectedNode?
+      clearNodeData()
       incomingWaysLayer.clearLayers()
       outgoingWaysLayer.clearLayers()
       selectedNode.setRadius(styles.node.radius)


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

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


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