       geojsonFeature
       style: styleGeojson
     ).addTo(@map)
+
+  onClose: ->
+    @map.off('moveend')


    return @

  onClose: ->
    
  renderMap: =>
    @map = L.map(
      @$el.find(".map-visualisation")[0],

      'http://{s}.tiles.mapbox.com/v3/onlyjsmith.map-9zy5lnfp/{z}/{x}/{y}.png'
    ).addTo(@map)

    @map.on('moveend', @saveMapBounds)

    @fitToBounds()
    @renderDataToMap()

  saveMapBounds: =>
    bounds = @map.getBounds()
    minll = bounds.getSouthWest()
    maxll = bounds.getNorthEast()
    bbox = [
      [minll.lat,minll.lng],
      [maxll.lat, maxll.lng]
    ]

    @visualisation.set('map_bounds', bbox)

  fitToBounds: =>
    if @visualisation.get('map_bounds')?
