     mapPaths.exit().remove()
 
 
-  renderMap = (scope, map, path) ->
+  renderMap = (scope, path) ->
     mapPaths = scope.mapGroup.selectAll('path')
-      .data(map.features)
+      .data(scope.map.features)
     mapPaths.enter().append('path')
       .attr('d', path)
 



  # either quantize or ordinal depending on type of data
  deduceValueFunction = (data, valueProperty, quantizeSteps, allMappingPropertiesOnMap, mappingPropertyOnData, mapId) ->
    mapInstance = mapMediatorService.getUIModel(mapId)
    if mapInstance.getValueType() == 'categorical'
      categoryValues = mapInstance.getCategoryValues()
      valFn = d3.scale.ordinal()

angular.module('ldEditor').directive 'choropleth', ($timeout, ngProgress, mapMediatorService) ->

  # TODO: once we have initialized everything in the form this can go
  defaults =
    projection: 'mercator'
    quantizeSteps: 9
