         $.each this.options.layers, ( index, value ) ->
           max_value = 0
           min_value = 0
-          if value.list[1]['style'] = 'choropleth'
+          choro = false
+          if value.list[1]['style'] == 'choropleth'
             max_value = value.list[1]['choropleth_value']
-            min_value = value.list[1]['choropleth_value']
-          choro = false 
+            min_value = value.list[1]['choropleth_value'] 
           level_number = 0 
           start = ""
           end = ""

                  div.innerHTML += "<br>"   
                  $.each simple_grades, ( index, value ) ->
                    div.innerHTML += '<i class="leaflet-legend-circle" style="background:' + value + '"></i>' + " " + index +  " "
                    div.innerHTML += "<br>"
                                 
                div
              legend.addTo that.map

            layer_options = {
              collapsed: true,
              position: 'topright',

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