 
   # sets the viewBox attribute on the svg element to cover the whole map
   # dynamically adjusts the snippet height to the ratio to the viewBox
-  resizeMap = (bounds) ->
+  resizeMap = (svg, bounds) ->
     svgHeight = bounds[1][1] - bounds[0][1]
     svgWidth = bounds[1][0] - bounds[0][0]
     svg.attr('viewBox', "#{bounds[0][0]} #{bounds[0][1]} #{svgWidth} #{svgHeight}")

        # TODO: for now id's are always numeric -> make this an interface property
        # TODO: make value an interface property
        valueById.set(+eval("d.#{defaults.mappingValue.inData}"), +d.value)
      mapGroup.selectAll('path')
        .attr('class', (d) -> quantize(valueById.get(+eval("d.#{defaults.mappingValue.inMap}"))))
        # TODO: use default value when quantize does not return a value


        $placeholder = $(element).find('.placeholder-image')
        $placeholder.remove() if $placeholder
        if newVal != oldVal # to prevent init redraw
          removeExistingMap(scope.mapGroup)
          renderDataMap(scope, newVal, scope.data)
          stopProgressBar()
      )
