   # location (if supplied)
   ###
     if not currentChallenge? or currentChallenge.slug != challenge
-      updateDetails(challenge)
+      updateChallengeDetails(challenge)
     # In the meantime, we can grab our task, I think...
     if near
       url = "/c/#{currentChallenge.slug}/task?near=#{near}"


# Misc variables
map = undefined
geojsonLayer = new L.GeoJSON()

setDelay = (seconds, func) ->
  ###

    if data.tileurl? and data.tileurl != tileURL
      tileURL = data.tileurl
      tileAttrib = data.tileasttribution if data.tileattribution?
      changeMapLayer(tileURL, tileAttrib)

@init = ->
  ###
  # Find a challenge and set the map up
  ###
  map = new L.Map "map"
  tileLayer = new L.TileLayer(tileUrl, attribution: tileAttrib)
  map.setView new L.LatLng(40.0, -90.0), 17
  map.addLayer tileLayer
  addGeoJSONLayer()

  # add keyboard hooks
  if enablekeyboardhooks
