gws.base.layer.core

Base layer object.

Source code: gws.base.layer.core

Module Contents

class gws.base.layer.core.AutoLayersOptions(*args, **kwargs)

Bases: gws.ConfigWithAccess

Configuration for automatic layers.

applyTo: gws.gis.source.LayerFilter | None
config: dict
class gws.base.layer.core.CacheConfig(*args, **kwargs)

Bases: gws.Config

Cache configuration

maxAge: gws.Duration = '7d'

cache max. age

maxLevel: int = 1

max. zoom level to cache

requestBuffer: int | None
requestTiles: int | None
class gws.base.layer.core.ClientOptions(*args, **kwargs)

Bases: gws.Data

Client options for a layer

exclusive: bool = False

only one of this layer’s children is visible at a time

expanded: bool = False

the layer is expanded in the list view

hidden: bool = False

the layer is initially hidden

selected: bool = False

the layer is initially selected

unfolded: bool = False

the layer is not listed, but its children are

unlisted: bool = False

the layer is hidden in the list view

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

Bases: gws.ConfigWithAccess

Layer configuration

cache: CacheConfig | None

Cache configuration.

clientOptions: ClientOptions

Options for the layer display in the client.

cssSelector: str = ''

Css selector for feature layers.

display: gws.LayerDisplayMode

Layer display mode.

extent: gws.Extent | None

Layer extent.

extentBuffer: int | None

Extent buffer.

finders: list[gws.ext.config.finder] | None

Search providers.

grid: GridConfig | None

Client grid.

imageFormat: gws.ImageFormat

Image format.

legend: gws.ext.config.legend | None

Legend configuration.

loadingStrategy: gws.FeatureLoadingStrategy

Feature loading strategy.

metadata: gws.Metadata | None

Layer metadata.

models: list[gws.ext.config.model] | None

Data models.

opacity: float = 1

Layer opacity.

ows: Config.ows | None

Configuration for OWS services.

templates: list[gws.ext.config.template] | None

Layer templates.

title: str = ''

Layer title.

withCache: bool | None = False

Layer is cached.

withLegend: bool | None = True

Layer has a legend.

withOws: bool | None = True

Layer is enabled for OWS services.

withSearch: bool | None = True

Layer is searchable.

zoom: gws.gis.zoom.Config | None

Layer resolutions and scales.

gws.base.layer.core.DEFAULT_TILE_SIZE = 256
class gws.base.layer.core.GridConfig(*args, **kwargs)

Bases: gws.Config

Grid configuration for caches and tiled data

crs: gws.CrsName | None
extent: gws.Extent | None
origin: gws.Origin | None
resolutions: list[float] | None
tileSize: int | None
class gws.base.layer.core.GridProps(*args, **kwargs)

Bases: gws.Props

Object properties.

extent: gws.Extent
origin: str
resolutions: list[float]
tileSize: int
class gws.base.layer.core.Object

Bases: gws.Layer

Layer object.

canRenderBox = False
canRenderSvg = False
canRenderXyz = False
clientOptions: gws.LayerClientOptions
cssSelector: str
hasLegend = False
isEnabledForOws = False
isGroup = False
isSearchable = False
parent: gws.Layer
parentBounds: gws.Bounds
parentResolutions: list[float]
ancestors()
configure()

Configuration hook.

configure_bounds()
configure_cache()
configure_grid()
configure_group_layers(layer_configs)
configure_layer()

Layer configuration protocol.

configure_legend()
configure_metadata()
configure_models()
configure_ows()
configure_provider()
configure_resolutions()
configure_sources()
configure_templates()
descendants()
find_features(search, user)
mapproxy_config(mc)
post_configure()

Post-configuration hook.

props(user)

Generate a Props struct for this object.

Parameters:

user – The user for which the props should be generated.

render(lri)
render_legend(args=None) gws.LegendRenderOutput | None
url_path(kind)
class gws.base.layer.core.Props(*args, **kwargs)

Bases: gws.Props

Object properties.

clientOptions: gws.LayerClientOptions
cssSelector: str
displayMode: str
extent: gws.Extent | None
geometryType: gws.GeometryType | None
grid: GridProps
layers: list[Props] | None
loadingStrategy: gws.FeatureLoadingStrategy
metadata: gws.lib.metadata.Props
model: gws.base.model.Props | None
opacity: float | None
resolutions: list[float] | None
title: str = ''
type: str
uid: str
url: str = ''