default_legend does not show layer symbol for basic point, line, and polygon layers
Closed this issue ยท 4 comments
I am trying to add a layer to a map where all features of that layer are styled uniformly. In other words, a feature's styling is not based on an attribute of the data. I am able to add the layer and style as I'd like with success, but when I define the legend argument for the layer using default_legend()
, the rendered legend does not contain an example of the symbol.
In reading through related issues (#1192 and #1301) it seems like this was a known issue and was resolved with cartoframes 1.0.1. However, I am working with that same version of cartoframes and am still unable to render a symbol for basic point, line, or polygon layers in a legend.
The example below demonstrates the behavior I am experiencing. I have added a point, line, and polygon layer to a Map()
without any attribute-based styling. Assigning default_legend()
to the legends
argument for each layer, I expected the basic symbol for each layer to be rendered in the legend, but this is not the case. Although the example shown is in a Google Colab notebook, I have experienced the same behavior in Jupyter Lab and Jupyter Notebooks.
You can access my Google Colab notebook here.
Hi, @maptastik
As you mention: yes, this was a known issue. We'll develop a solution for this in the next weeks. We're trying to think about the best solution for this, mainly what we should show as a label. Any feedback is welcome :)
@elenatorro Thanks for the response and my apologies. I misunderstood what I was reading in those issues I referenced and thought this had been resolved. Generally speaking what @makella has proposed (#1192) is what I had expected when using default_legend()
with a single symbol layer type.
Yes, my fault cause maybe it wasn't clear: this was meant to be done in two steps: the first one was to remove the wrong label, and the next one to implement a solution, following @makella and other proposals along with internal user tests ๐
Hi @maptastik, this was already added to CARTOframes, you can check an example here.
Thanks for your feedback :)