gws.base.legend.core

Base legend object.

Source code: gws.base.legend.core

Module Contents

gws.base.legend.core.combine_outputs(lro_list: list[gws.LegendRenderOutput], options: dict = None) → gws.LegendRenderOutput | None

Combine several legend outputs into one image.

The images are stacked vertically, aligned to the left. Outputs without an image are skipped.

Parameters:
  • lro_list – Legend outputs to combine; None entries are allowed.

  • options – Legend options, currently unused.

Returns:

A new legend output with the combined image, or None if there are no images.

class gws.base.legend.core.Config(*args, **kwargs)

Bases: gws.ConfigWithAccess

Layer legend confuguration.

cacheMaxAge: gws.Duration = '1d'

How long legend images from remote sources are cached.

options: dict | None

Provider-specific legend options.

class gws.base.legend.core.Object

Bases: gws.Legend

Base legend object.

Reads the common cacheMaxAge and options settings. Subclasses implement render and can stack several legend images into one with combine_outputs.

cacheMaxAge: int

How long legend images from remote sources are cached, in seconds.

options: dict

Provider-specific legend options.

configure()

Configuration hook.

Called when the node is initialized. Raising an exception here aborts the creation of the node.

class gws.base.legend.core.Props(*args, **kwargs)

Bases: gws.Props

Object properties.

type: str