           minZoom: 6
         ).addTo lmap
         mapLayers = {}
+        currentLeafletLayer = false
         for mdgL in mdgLayers
           do ->
             curMdgL = mdgL

          $ "<option>", value: @slug, text: @name

      onSelect: ()->
      selectBoxChange = ()->
        layersBySlug[$(@).val()].onSelect()

      createSelectBox = ->
        sb = $ "<select>", title: plsSelectMsg, style: "width:100%", change: selectBoxChange
        sb.append $ '<option>', value:""
        for mdg in mdgs.sort() when mdg?
          sb.append og = $ "<optgroup>", label: "MDG #{mdg}"
          og.append layer.$option()  for layer in layersByMdg[mdg]

              tileset: mdgL.slug
              maxZoom: 9
              minZoom: 6
            if "mdg" of mdgL
              curMdgL.onSelect = ()->
                lmap.addLayer(ml)
                lmap.removeLayer baseLayer
                lmap.removeLayer(currentLeafletLayer)  if currentLeafletLayer
                currentLeafletLayer = ml
                @show_description()
                @show_legend()
            else
              curMdgL.onSelect = ->
                lmap.addLayer baseLayer
                lmap.removeLayer(currentLeafletLayer)  if currentLeafletLayer
                currentLeafletLayer = false
                @hide_legend()
                @hide_description()

      launcher.fail ()->
        log "LAUNCHER FAIL! Scripts not loaded"

