-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
get filled color for polygon_marker #212
Comments
OK I get a solution after reading and testing #135 from IPython.display import HTML, display
def inline_map(m):
if isinstance(m, folium.folium.Map):
m._build_map()
srcdoc = "data:text/html;base64," + m.HTML.encode('base64')
embed = HTML('<iframe src="{}" '
'style="width: {}px; height: {}px; '
'border: none"></iframe>'.format(srcdoc, m.width, m.height))
else:
raise ValueError('{!r} is not a folium Map instance.')
return embed Using that inline_map function that encodes the src of the iframe in base64 allows correct filling colors for polygon markers. |
I let this issue open because the problem remains with 0.1.6 branch. Leaving the mapobject as the last line in the notebook to get a rich HTML displayed should display filled colors but it's not the case. |
Ooops! I took me so long to answer that you found the solution 😳
Thanks! I will address that before the |
@PBrockmann this is fixed in master. I will push for a new release ASAP. |
Cool. Thnks. |
I am re-opening this. Let's port the bug fix to |
Done in #234 |
Yep: #237 To inline everything breaks more stuff than fixes it. The proper fix is in folium Although I strongly recommend you to take a look at the unreleased |
Ok I will switch to the v0.2.0 when released |
Hello all, This is not working properly in folium 0.11. We still get gradient colors in RegularPolygonMarker. CircleMarker works fine. Thank you, |
@prodriguezciae I agree, any fix for this - it's quite annoying. 👍 |
I cannot get a flat filled color when I use polygon_marker. Instead I get a gradient that comes from Leaflet-DVF I suppose.
But many times, I would prefer to display a flat color.
Another point, I have noticed on the use of the property fill_color from polygon_marker is that the filled color is not displayed when you embed your map in a notebook.
Here is an example tested with 0.1.5
Inspecting the SVG I find a
fill="url(#gradeac640f5-53f0-6c37-ea2b-10d33cbc9aa0)"
whereas in a saved html with map_5.create_map(path="myfile.html"), I get a
fill='blue' as expected (event if it is a gradient that is finally displayed).
The text was updated successfully, but these errors were encountered: