                   
                   bubble_legend = true
                   if value.radius > max_bubble_value
-                    color = value.fillColor
+                    bubble_legend_color = value.fillColor
                     max_bubble_value = value.radius
                     max_bubble_value_digits = (max_bubble_value.toString().length)-1
                     

                  choropleth_layer.bindPopup(popup)
                  layer_group.push(choropleth_layer)
                  
              overLayer = L.layerGroup(layer_group)
              overlays[value.name] = overLayer
              group = new L.featureGroup(layer_group)
              that.map.addLayer(overLayer)
              that.map.fitBounds(group.getBounds())
              
              legend.onAdd = (map) ->
                                
                if bubble_legend == true

                    rounded_max_value *= (i/bubble_grades)
                    width = rounded_max_value /3
                    height = rounded_max_value /3
                    div.innerHTML += '<i class="leaflet-legend-circle" style="background-color:' + bubble_legend_color + "; width: #{width}px; height: #{height}px" + '"></i>'  + " " + rounded_max_value +  " "
                    i++
                if choropleth_legend == true
                   
