diff --git a/folium/features.py b/folium/features.py index e49521a14c..76f21af064 100644 --- a/folium/features.py +++ b/folium/features.py @@ -507,12 +507,12 @@ def _get_self_bounds(self): ymax = none_max(y, ymax) return [ [ - self.data['transform']['translate'][0] + self.data['transform']['scale'][0] * xmin, # noqa self.data['transform']['translate'][1] + self.data['transform']['scale'][1] * ymin, # noqa + self.data['transform']['translate'][0] + self.data['transform']['scale'][0] * xmin # noqa ], [ - self.data['transform']['translate'][0] + self.data['transform']['scale'][0] * xmax, # noqa self.data['transform']['translate'][1] + self.data['transform']['scale'][1] * ymax, # noqa + self.data['transform']['translate'][0] + self.data['transform']['scale'][0] * xmax # noqa ] ] diff --git a/folium/plugins/heat_map.py b/folium/plugins/heat_map.py index ca00e28cee..14ebbed588 100644 --- a/folium/plugins/heat_map.py +++ b/folium/plugins/heat_map.py @@ -40,7 +40,7 @@ def __init__(self, data, name=None, min_opacity=0.5, max_zoom=18, gradient : dict, default None Color gradient config. e.g. {0.4: 'blue', 0.65: 'lime', 1: 'red'} """ - super(TileLayer, self).__init__() + super(TileLayer, self).__init__(name=name) self._name = 'HeatMap' self.tile_name = name if name is not None else self.get_name() @@ -91,12 +91,12 @@ def _get_self_bounds(self): for point in self.data: bounds = [ [ - none_min(bounds[0][0], point[1]), - none_min(bounds[0][1], point[0]), + none_min(bounds[0][0], point[0]), + none_min(bounds[0][1], point[1]), ], [ - none_max(bounds[1][0], point[1]), - none_max(bounds[1][1], point[0]), + none_max(bounds[1][0], point[0]), + none_max(bounds[1][1], point[1]), ], ] return bounds diff --git a/tests/plugins/test_heat_map.py b/tests/plugins/test_heat_map.py index bbc601de60..7158e554e3 100644 --- a/tests/plugins/test_heat_map.py +++ b/tests/plugins/test_heat_map.py @@ -44,5 +44,5 @@ def test_heat_map(): assert tmpl.render(this=hm) bounds = m.get_bounds() - assert bounds == [[3.0302801394447734, 46.218566840847025], - [7.132453997672826, 50.75345011431167]], bounds + assert bounds == [[46.218566840847025, 3.0302801394447734], + [50.75345011431167, 7.132453997672826]], bounds diff --git a/tests/test_folium.py b/tests/test_folium.py index 1cceaac0c5..92aae21013 100644 --- a/tests/test_folium.py +++ b/tests/test_folium.py @@ -450,7 +450,7 @@ def test_geo_json_data_binding(self): [71.285909, -66.979601]], bounds def test_topo_json(self): - """Test geojson method.""" + """Test topojson method.""" self.map = folium.Map([43, -100], zoom_start=4) @@ -467,8 +467,8 @@ def test_topo_json(self): assert ''.join(topojson_str.split())[:-1] in ''.join(out.split()) bounds = self.map.get_bounds() - assert bounds == [[-124.56617536999985, 41.99187135900012], - [-116.46422312599977, 46.28768217800006]], bounds + assert bounds == [[41.99187135900012, -124.56617536999985], + [46.28768217800006, -116.46422312599977]], bounds def test_map_build(self): """Test map build."""