python-visualization / folium

Python Data. Leaflet.js Maps.
https://python-visualization.github.io/folium/
MIT License
6.94k stars 2.23k forks source link

Confine a marker(flag picture) into a specific area(territory) #1828

Closed dobefore closed 1 year ago

dobefore commented 1 year ago

Hi! Is it possible for us to create a custom marker that draws a country flag(or with a flag file) whose size fits perfectly in a country's territory?

Conengmo commented 1 year ago

I don’t think Folium has anything to show flag colors as a background in polygons.

I tried a quick search but seems Leaflet doesn’t have it either.

maybe check out this blog post for inspiration: https://dev.to/haideralipunjabi/flag-colours-visualisation-from-geopandas-to-leaflet-and-back-4ohk

Though I like the idea, I’m closing the issue because since this functionality is not in Leaflet or in a leaflet plugin, it is far away to get it in Folium. If somebody wants to develop it as a plug-in, it’s probably best if they host it themselves and we can link to it.