Skip to content

LegendItemSchema

const LegendItemSchema: ZodObject<{ color: ZodString; icon: ZodOptional<ZodString>; label: ZodString; shape: ZodDefault<ZodEnum<["circle", "square", "line", "icon"]>>; }, "strip", ZodTypeAny, { color: string; icon?: string; label: string; shape: "circle" | "line" | "square" | "icon"; }, { color: string; icon?: string; label: string; shape?: "circle" | "line" | "square" | "icon"; }>

Defined in: packages/core/src/schemas/layer.schema.ts:433

Legend item for a layer.

Defines how the layer appears in the map legend.

Shape Options:

  • circle - Circular symbol
  • square - Square symbol
  • line - Line symbol
  • icon - Custom icon
legend:
color: "#ff0000"
label: "Earthquakes"
shape: circle