I would like to extend the functionality of my folium map
I found a nice thread here:
but it doesn't work when apply to my code
export_js = [
(
"leaflet_bigimage_js",
"js/Leaflet.BigImage.js",
)
]
export_css = [
(
"leaflet_bigimage_css",
"css/Leaflet.BigImage.css",
)
]
exp = folium.MacroElement()
exp.template = jinja2.Template("""
{% macro script(this, kwargs) %}
L.control.bigImage({position: 'topright'}).addTo{map}
{% endmacro %}
""")
map.get_root().add_child(exp)
the map works, but the element doesn't appear at all. Moreover, JS console sees nothing.
Is there any way how could I sort it out?
UPDATE:
I tried also:
class exp(MacroElement):
exp_template = Template(u"""
{% macro script(this, kwargs) %}
L.control.bigImage({position: 'topright'}).addTo({{
this._parent.get_name() }})
{% endmacro %}
""")
map.add_child(exp())
but with the same result