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

          "q#{i}-#{categoryValues.length}"
        )
    else
      maxValue = deduceMaxValue(data, valueProperty, allMappingPropertiesOnMap, mappingPropertyOnData)
      minValue = deduceMinValue(data, valueProperty, allMappingPropertiesOnMap, mappingPropertyOnData)
      valFn = d3.scale.quantize()
        .domain([minValue, maxValue])
        .range(d3.range(quantizeSteps).map (i) ->

    mapPaths.exit().remove()


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

