Skip to content

Second try v0.2.1 #386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 14, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions folium/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
]

]
Expand Down
10 changes: 5 additions & 5 deletions folium/plugins/heat_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions tests/plugins/test_heat_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions tests/test_folium.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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."""
Expand Down