           map.addWaterpoint(wp)
         map.zoomToMarkers()
 
-      dc.chartRegistry.list().forEach (chart) ->
-        chart.on "filtered", () ->
-          dc.events.trigger () ->
-            updateMap()
+      if not exists
+        filterHandlers.push(updateMap)
 
       updateMap()
 

        datatable.fnAddData(alldata)
        datatable.fnDraw()

      dc.chartRegistry.list().forEach (chart) ->
        chart.on "filtered", () ->
          dc.events.trigger () ->
            reloadTable()

      if exists
        reloadTable()

    # controller level map object
    map = null

    loadMap = (container, dim) ->
      id = "regionalDashMap"

      if not $('#' + id).length
        e = $('<div id="' + id + '"></div>')
        $(container).append(e)


      table.fnAdjustColumnSizing()

    $scope.clearFilters = () ->
     # note this triggeres a whole set of filtered events
     dc.filterAll()
     dc.renderAll()

    # central handler and listeners for dc filtered events
    # used by the map and datatable widgets
    # FIXME: eventually this should be replaced by making the map
    # and data table proper dc charts
    filterHandlers = []
    onFilteredHandler = () ->
      filterHandlers.forEach (x) ->
        x()

    setupCharts = (region) ->
      getData region, (data) ->
