Skip to content

Layout legend: point symbols don't match the map #1441

Closed

Description

@jgregoriorincon

A layout's legend doesn't show the point symbol the map draws, though a legend is there to say what the map's symbols mean.

What happens

Every point in a legend is drawn by swatch in crates/render/src/layout.rs as a circle, whatever the layer's symbol:

  • Shape: a square, triangle, diamond, star or character marker comes out as a circle.
  • Stacked marks: the marks of a layer or a class are left out.
  • Outline: at least 0.5 pt, even with no outline on the map.
  • Size: at least 1.5 pt of radius, and cut to the 15 pt row, so a large symbol comes out smaller than on the map.
  • Transparency: a see-through layer, or a layer in a see-through group, comes out opaque.
  • Reference scale: a layer that grows or shrinks with the map keeps its plain size.

To reproduce

layer.addDataText={"fileName":"Peaks.csv","text":"name,lon,lat\nA,0,0\n"}
layer.marker={"layer":"Peaks","shape":"triangle","size":12}
layout.new={"name":"Legend","page":"a4","orientation":"landscape"}

The map frame shows a triangle and the legend a circle.

Expected

The legend's point symbol looks as it does on the map.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions