     @link.setMap($a.map)
     @
 
-  # this method reads the path of points contained in the legs, joins them 
-  # into one array with no duplicates and then encodes the using googles 
+  # this method reads the path of points contained in the legs, joins them
+  # into one array with no duplicates and then encodes the using googles
   # geomtry package in order to save the path to models linkgeometry field
   _createEncodedPath: (legs) ->
     smPath = []

    contextMenuOptions.class = 'context_menu'
    contextMenuOptions.id = "context-menu-link-#{@model.cid}"
    contextMenu = new $a.ContextMenuView(contextMenuOptions)
    
    google.maps.event.addListener(@link, 'rightclick', (mouseEvent) => 
      contextMenu.show mouseEvent.latLng 
    )
    @model.set('contextMenu', contextMenu)


  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')
