You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Layout legend: a label per layer, instead of the layer's name #1654
A layout legend shows each layer under its name in the project. Plugins name their layers so they can find them again. The BrasilData plugin, for example, uses a prefix: BrasilData: Setores censitários 2022 (MG), BrasilData: Indicadores por município. Every map it lays out then shows that prefix in the legend.
There is no way around it today:
The legend element:layout.update takes title, exclude, hideOther, allClasses and columns, but no label for a layer.
Renaming the layer: this breaks whatever finds the layer by its name (the plugin itself, scripts, saved styles).
A copy under another name: this duplicates the data in the project.
The same happens to a user who keeps technical layer names (setores_mg_2022_clip) but wants a readable legend.
Choices in this proposal
Where the label lives: on the legend element (ElementKind::Legend), as labels: {"<layer name>": "<label>"}, matched as exclude is (by name, any case). The layer keeps its name everywhere else, so nothing that addresses layers changes. Two legends can label the same layer differently, for instance in two languages.
Command:layout.update takes "labels": {"<layer>": "<label>"|null}. A null entry or an empty map goes back to the layer's name. A layer that is not on the map is refused, as exclude refuses one.
Sizing: the legend measures the label it draws, so its box and columns fit the label, not the name.
Saved projects: the map is kept in the .rgislayout and .rgis, with skip_serializing_if = "HashMap::is_empty", so existing files do not change.
Rejected: a display name on the layer. A name used in the legend, the layers pane and the identify popup is more general, but it touches every place a name is shown or matched, and it raises questions this proposal does not need to answer (which one scripts address, which one exports keep).
Activity
fix(layout): refuse a legend label over 200 characters, and name labe…
fix(layout): a layout read from a file keeps one label per layer (ope…
fix(layout): refuse labels of any value on elements that aren't legen…
fix(layout): say when a renamed layer loses its legend label (opengeo…
fix(layout): say where a map frame's grid labels go, and rewrap the l…
fix(layout): a legend given labels says when they don't fit its box (o…
feat(layout): a legend shows a layer under a label instead of its name (