Skip to content

Commit e4d19a7

Browse files
author
Martin Journois
committed
Typos + geo_json -> choropleth
1 parent 70700bf commit e4d19a7

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

folium/features.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,14 @@ def __init__(self, data, style_function=None):
204204
if 'read' in dir(data):
205205
self.data = json.load(data)
206206
elif type(data) is dict:
207-
self.data = json.loads(json.dumps(data)) # a lazy way of doing deep copy.
207+
self.data = json.loads(json.dumps(data)) # A lazy way of doing deep copy.
208208
else:
209209
self.data = json.loads(data)
210210

211211
if 'features' not in self.data.keys():
212-
# Catch case when GEOJson is just a single Feature or a geometry.
212+
# Catch case when GeoJSON is just a single Feature or a geometry.
213213
if not (isinstance(self.data, dict) and 'geometry' in self.data.keys()):
214-
# Catch case when GEOJson is just a geometry.
214+
# Catch case when GeoJSON is just a geometry.
215215
self.data = {'type' : 'Feature', 'geometry' : self.data}
216216
self.data = {'type' : 'FeatureCollection', 'features' : [self.data]}
217217

folium/folium.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,12 @@ def add_plugin(self, plugin):
438438
#
439439
# self.template_vars.update({'fit_bounds': fit_bounds_str.strip()})
440440

441-
def geo_json(self, geo_path=None, geo_str=None, data_out='data.json',
441+
def geo_json(self, **kwargs):
442+
"""This method is deprecated, see `Map.choropleth` instead."""
443+
warnings.warn('This method is deprecated. Please use Map.choropleth instead.')
444+
return self.choropleth(**kwargs)
445+
446+
def choropleth(self, geo_path=None, geo_str=None, data_out='data.json',
442447
data=None, columns=None, key_on=None, threshold_scale=None,
443448
fill_color='blue', fill_opacity=0.6, line_color='black',
444449
line_weight=1, line_opacity=1, legend_name=None,
@@ -604,15 +609,9 @@ def geo_json(self, geo_path=None, geo_str=None, data_out='data.json',
604609
else:
605610
geo_json = GeoJson(geo_data, style_function=style_function)
606611

607-
# Create GeoJsonStyle.
608-
#geo_json_style = GeoJsonStyle(
609-
# color_domain, fill_color, color_data=color_data, key_on=key_on,
610-
# weight=line_weight, opacity=line_opacity, color=line_color,
611-
# fill_opacity=fill_opacity)
612-
613-
#geo_json.add_children(geo_json_style)
614612
self.add_children(geo_json)
615-
# Create ColorScale
613+
614+
# Create ColorScale.
616615
if color_domain:
617616
color_scale = ColorScale(color_domain, fill_color, caption=legend_name)
618617
self.add_children(color_scale)

0 commit comments

Comments
 (0)