question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

get filled color for polygon_marker

See original GitHub issue

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

import folium
print folium.__version__

from IPython.display import HTML, display

def inline_map(m):
    if isinstance(m, folium.folium.Map):
        m._build_map()
        srcdoc = m.HTML.replace('"', '"')
        embed = HTML('<iframe srcdoc="{}" '
                 '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
map_5 = folium.Map(width=600, height=400, location=[45.5236, -122.6750], zoom_start=13)

map_5.polygon_marker(location=[45.5318, -122.6745], popup='Broadway Bridge',
                     line_color='red',
                     fill_color='blue', num_sides=8, radius=10, fill_opacity=1)

inline_map(map_5)

folium_02

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).

folium_03

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
prodriguezciaecommented, Jul 20, 2020

Hello all,

This is not working properly in folium 0.11. We still get gradient colors in RegularPolygonMarker. CircleMarker works fine.

Thank you, Patricio

1reaction
davidrosspaintercommented, Oct 19, 2020

@prodriguezciae I agree, any fix for this - it’s quite annoying. 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

PolygonMarker | Wolfram Function Repository
ResourceFunction["PolygonMarker"][shape,spec] returns a Polygon graphics primitive that can be used in ... Filled markers with lighter filling colors: ...
Read more >
Draw a closed and filled contour - python - Stack Overflow
I am trying to draw a closed contour an fill it up with (transparent or whatever) color with folium ...
Read more >
How can we make publication-quality PlotMarkers without ...
PolygonMarker [shape, spec] returns Polygon graphics primitive which can be used in Graphics . ... Filled markers with lighter filling colors:
Read more >
How can i fill a marker with color? - MATLAB Answers
I have two plots. How can I fill the marker in plot2? At the moment it is empty. With: plot(x(i),y(i),'s','MarkerFaceColor',colors(ID(i),:));???
Read more >
How to set Point Symbol outline colour in UniqueValueRenderer
The colour is being applied to the fill, but not to the shape outline. ... GetEsriSymbolTable(symbolIndex) returns a tuple with font, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found