       this._refreshView()
       this._refreshControls()
 
+      @async_loading()
+
+    async_loading: ->
+      return unless @options.asyncUrl?
+
+      $.ajax
+        method: 'GET'
+        dataType: 'json'
+        url: @options.asyncUrl
+        beforeSend: () =>
+          @dynamic_loading = new L.Control(position: "bottomleft")
+          @dynamic_loading.onAdd = (map) =>
+            L.DomUtil.create('div', 'leaflet-dynamic loading')
+          @map.addControl @dynamic_loading
+        success: (data) =>
+          $.extend(true, @options, data)
+          @_refreshControls()
+        error: () =>
+          dynamic_error = new L.Control(position: "bottomleft")
+          dynamic_error.onAdd = (map) =>
+            L.DomUtil.create('div', 'leaflet-dynamic error')
+          @map.addControl dynamic_error
+        complete: () =>
+          @map.removeControl @dynamic_loading
+
     _destroy: ->
       @mapElement.remove()
 


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

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

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

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

