Adding multiple Custom Icon in Folium
See original GitHub issueI am creating a Custom Icon in folium, and displaying it on a map, but when i try to add another coordinate with the same Icon, it fails.
import folium
map_osm = folium.Map(location=[45.3288, -121.6625])
icon_url = 'https://cdn1.iconfinder.com/data/icons/maps-locations-2/96/Geo2-Number-512.png'
icon = folium.features.CustomIcon(icon_url,icon_size=(28, 30)) # Creating a custom Icon
folium.Marker(location=[45.3288, -121.6625],icon=icon).add_to(map_osm) #adding it to the map
map_osm
Now adding another location with the same icon
folium.Marker(location=[46.3288, -122.6625],icon=icon).add_to(map_osm)
map_osm
[The map_osm points to new location with its default icon, and the previous pin is removed.]
Expected Output should have been two map pins with the same icon.
folium.__version__
= ‘0.5.0’
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:6
Top Results From Across the Web
python - Folium unable to add multiple points with "same" icon
My guess is that it is designed not to accept the same object ID. In this example, markers with the same icon settings...
Read more >Custom icons in folium
This new class allow users to display custom images as icons instead of the default markers. Here is how to do it. First...
Read more >Map with markers with Python and Folium
This blogpost explains how to build an interactive map with markers using Python and Folium . It explains how to add the markers...
Read more >Python Folium — A Data Visualization Superhero - Medium
Create powerful & beautiful Maps with Python Folium. ... Custom Icons: To save even more time, we are making additional use of the ......
Read more >2 Creating and Styling Markers (Best Folium and Python ...
Full course available below:https://www.udemy.com/course/introduction-to-maps-in- folium -and-python/?referralCode=BC6929A9BAEA48934B45LEARN ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
When icon have to be initialised everytime we got huge file. It’s a bug.
I got this solved, it needs icon to be initialised everytime you add a marker.