         <img class="placeholder-image" src="http://placehold.it/#{$(element).width()}x200}/F55CB7/ffffff&text=select%20this%20snippet%20and%20choose%20a%20map%20in%20the%20sidebar" />
       """)
 
+
+      #    #############################################
+      #      Change Listeners
+      #    #############################################
+
       scope.$watch('map', (newVal, oldVal) ->
         return unless newVal
         $placeholder = $(element).find('.placeholder-image')

    return valFn


  # gets all mapped property values that are actually on the map
  # Either gets all from the set mappingProperty or gets all from the default
  # no mixing of default and set property!
  deduceAllAvailableMappingOnMap = (map, mappingPropertyOnMap) ->
    map.features.map (mapEntry) ->
      if mappingPropertyOnMap
        mapEntry.properties[mappingPropertyOnMap]
      else
        mapEntry.properties[defaults.mappingPropertyOnMap]


  renderVisualization = (scope) ->
    map = scope.map
    data = scope.data
    path = deducePathProjection(scope.projection)
    valueProperty = scope.valueProperty
    mappingPropertyOnMap = scope.mappingPropertyOnMap
    mappingPropertyOnData = scope.mappingPropertyOnData
    quantizeSteps = scope.quantizeSteps || defaults.quantizeSteps

    renderMap(scope, map, path)

    bounds =  path.bounds(map)
    resizeMap(scope.svg, bounds)

    if data
      allMappingPropertiesOnMap = deduceAllAvailableMappingOnMap(map, mappingPropertyOnMap)
      valFn = deduceValueFunction(data, valueProperty, quantizeSteps, allMappingPropertiesOnMap, mappingPropertyOnData, scope.mapId)
      renderData(scope, data, mappingPropertyOnData, valueProperty, mappingPropertyOnMap, valFn)
      renderLegend(scope, valFn)



  #    #############################################
  #      Legend Rendering
  #    #############################################

          key: entry
          value: category
    data


  #    #############################################
  #      Utilities
  #    #############################################

  # gets all mapped property values that are actually on the map
  # Either gets all from the set mappingProperty or gets all from the default
  # no mixing of default and set property!
  deduceAllAvailableMappingOnMap = (map, mappingPropertyOnMap) ->
    map.features.map (mapEntry) ->
      if mappingPropertyOnMap
        mapEntry.properties[mappingPropertyOnMap]
      else
        mapEntry.properties[defaults.mappingPropertyOnMap]


  # Stop progress bar with a timeout to prevent running conditions
