Skip to content

Commit af86a32

Browse files
authored
Merge pull request #31 from heremaps/html
save map to html file
2 parents 6618f4d + e7eb2c5 commit af86a32

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

here_map_widget/map.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
interactive,
1919
widget_serialization,
2020
)
21+
from ipywidgets.embed import embed_minimal_html
2122
from traitlets import (
2223
Any,
2324
Bool,
@@ -2175,3 +2176,15 @@ def __add__(self, item):
21752176
elif isinstance(item, InfoBubble):
21762177
self.add_bubble(item)
21772178
return self
2179+
2180+
def save(self, outfile, **kwargs):
2181+
"""Save the Map to .html file.
2182+
2183+
Parameters
2184+
----------
2185+
outfile: str or file-like object
2186+
The file to write the HTML output to.
2187+
kwargs: keyword-arguments
2188+
Extra parameters to pass to the ipywidgets.embed.embed_minimal_html function.
2189+
"""
2190+
embed_minimal_html(outfile, views=[self], **kwargs)

js/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"dist/*.png",
3030
"lib/**/*.gif",
3131
"dist/*.gif",
32+
"dist/*.map",
3233
"LICENSE"
3334
],
3435
"scripts": {

0 commit comments

Comments
 (0)