Folium: Adding Colormap to a map yields an assertion error

Created on 31 Aug 2016  路  3Comments  路  Source: python-visualization/folium

Hi! Great work all. I love this package.

After creating and implementing a colormap, when I do:

m.add_children(colormap)

I'm getting the same error as is displayed at the end of this folium example notebook.

AssertionError: You cannot render this Element if it's not in a Figure.

Not sure if this is upstream to be committed to conda, but I've tried a number of workarounds thus far, so if there's one extant I'm happy to use that as well.

Thanks,

Adam

Most helpful comment

Might be useful for others. I had the precisely the same problem. I was importing colormap from branca. Once I imported colormap from folium instead, it worked.

All 3 comments

Hello,

Happy to try to fix this in a PR if someone could point me to a way to bind a colormap Element to a figure beyond the add_children method.

Thanks,

Adam

@adamkgoldfarb I could not reproduce that problem with latest master so maybe this is fixed or it is another problem I cannot reproduce here. Can you try it with the dev version and re-open this if the problem still exists?

I am working on a new release soon btw.

Might be useful for others. I had the precisely the same problem. I was importing colormap from branca. Once I imported colormap from folium instead, it worked.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

FlorianHoevelmann picture FlorianHoevelmann  路  14Comments

spanishinquistion picture spanishinquistion  路  16Comments

ElmWer picture ElmWer  路  24Comments

ibayer picture ibayer  路  21Comments

achourasia picture achourasia  路  19Comments