Skip to content
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

Markers with different shapes #1290

Closed
EmanuelCastanho opened this issue Oct 13, 2022 · 6 comments · Fixed by #1595
Closed

Markers with different shapes #1290

EmanuelCastanho opened this issue Oct 13, 2022 · 6 comments · Fixed by #1595
Labels
Feature Request New feature or request

Comments

@EmanuelCastanho
Copy link

Is it possible to add markers to the map with different shapes (square, triangle, star, ...), not only circle?

It would be interesting to have a function like add_markers_from_xy(..., shape='square')

Or even include HTML icons.

@EmanuelCastanho EmanuelCastanho added the Feature Request New feature or request label Oct 13, 2022
@giswqs
Copy link
Member

giswqs commented Oct 13, 2022

I don't think ipyleaflet supports that. You can have an icon inside the marker though. See https://leafmap.org/notebooks/50_marker_cluster/

@giswqs
Copy link
Member

giswqs commented Oct 13, 2022

Or you can use geopandas to generate shapes (square, triangle, etc) as a polygon layer based on points and then add the polygon layer to the map.

@EmanuelCastanho
Copy link
Author

I will check both options.
This idea came to me because of this post:
https://stackoverflow.com/questions/60131314/folium-draw-star-marker

Thank you for the reply and amazing work.

@giswqs
Copy link
Member

giswqs commented Oct 13, 2022

Good to know. I will see if I can implement it.

@giswqs
Copy link
Member

giswqs commented Oct 13, 2022

Looks like it is feasible. Need some time to make the function robust so that it can use multiple shapes at the same time.

image
image

@EmanuelCastanho
Copy link
Author

Looks great! Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants