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
Add the plot legend to the GeoJSON properties #35
Comments
@ocefpaf Can you provide an example? I've always wanted legends to show up on the final page. One of the goals of mplleaflet is to allow plotting in matplotlib normally and it just "does the right thing" to generate the web page. Is there a way to create a legend using |
Yeah, maybe that is better and more consistent with mplleaflet's goal. (But not exactly what I had in mind 😉)
Probably yes. Just not sure how to do it yet. What I was thinking was to just export GeoJSON with the label string information as a popup property for each geometry. For example: in cell [5] of this notebook I add the drifter label to each line. The easiest way to propagate the drifter name to the map would be the save the label string in the BTW adding the actually legend in the final page could be done via two routes: a) (the ugly hack) save the legend as a PNG images and add it using b) (the elegant solution) Create a custom legend control with the proper css, symbols, colors, and text. All exported from the original legend. Right now I am selfishly thinking about just creating a |
Ah. I see. So use the matplotlib legend to set properties on the exported features? That would be really nice. |
I guess that mplleaflet follow the simplestyle-spec closely and what I propose here this is not in the simplestyle-spec, but it would be nice to use the legend information to create popups later on. (Or just to keep track of who-is-who in the JSON.)
@jwass is that something you would be OK to add? If so I can take try to implementing this.
The text was updated successfully, but these errors were encountered: