     $a.broker.trigger("map:select_item:#{beginNode.cid}")
     $a.broker.trigger("map:select_item:#{endNode.cid}")
 
-  # called from the context menu as well. It clears itself and its nodes as 
+  # called from the context menu as well. It clears itself and its nodes as
   # well as the higlighted tree items
   clearSelfandMyNodes: () ->
     @clearSelected()

    lg = new $a.LinkGeometry()
    ep = new $a.EncodedPolyline()
    pts = new $a.Points()
    pts.set({text:@encodedPath})
    ep.set({points: pts})
    lg.set({encodedpolyline:ep})
    @model.set({linkgeometry: lg})

  # Creates the Polyline to rendered on the map
  # The Polyline map attribute will be null until render is called

  showLink: () ->
    @link.setMap($a.map)

  # in order to remove an element you need to unpublish the events, hide the
  # marker and set it to null
  removeLink: ->
    $a.broker.off('map:init')
