Skip to content

Host heatmap.js to circumvent adblockers #886

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
Jun 19, 2018
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
2 changes: 1 addition & 1 deletion folium/plugins/heat_map_withtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def render(self, **kwargs):

figure.header.add_child(
JavascriptLink(
'https://cdnjs.cloudflare.com/ajax/libs/heatmap.js/2.0.2/heatmap.min.js'),
'https://rawgit.com/python-visualization/folium/master/folium/templates/pa7_hm.min.js'), # noqa
name='heatmap.min.js')

figure.header.add_child(
Expand Down
9 changes: 9 additions & 0 deletions folium/templates/pa7_hm.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/plugins/test_heat_map_withtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def test_heat_map_with_time():
# We verify that the script imports are present.
script = '<script src="https://rawgit.com/socib/Leaflet.TimeDimension/master/dist/leaflet.timedimension.min.js"></script>' # noqa
assert script in out
script = '<script src="https://cdnjs.cloudflare.com/ajax/libs/heatmap.js/2.0.2/heatmap.min.js"></script>' # noqa
script = '<script src="https://rawgit.com/python-visualization/folium/master/folium/templates/pa7_hm.min.js"></script>' # noqa
assert script in out
script = '<script src="https://rawgit.com/pa7/heatmap.js/develop/plugins/leaflet-heatmap/leaflet-heatmap.js"></script>' # noqa
assert script in out
Expand Down