             if bounds.getNorthEast().equals bounds.getSouthWest()
               @map.setZoom 18
           # Add legend
-          legend = legendControl.getContainer()
+          legend = @controls.legendControl.getContainer()
           legend.innerHTML += renderedLayer.buildLegend()
+          L.DomUtil.removeClass(legend, 'leaflet-hidden-control')
         else
           console.warn "Cannot add layer #{layer.type}"
 

      this._refreshView()
      this._refreshControls()

    _destroy: ->
      @mapElement.remove()



        overlays[layer.name] = L.tileLayer(layer.url, opts)

      @controls.legendControl = new L.control(position: "bottomright")
      @controls.legendControl.onAdd = (map) ->
        L.DomUtil.create('div', 'leaflet-legend-control')
      @map.addControl @controls.legendControl

      L.DomUtil.addClass(@controls.legendControl.getContainer(), 'leaflet-hidden-control')


      $('.leaflet-legend-control').on 'click', () ->
        $(this).find('#legend-activity').toggleClass('minified')
