gws.base.map.core

Default map object.

Source code: gws.base.map.core

Module Contents

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

Bases: gws.Config

Map with its layers, extent, CRS and zoom levels.

center: gws.Point | None

Initial map center.

coordinatePrecision: int | None

Decimal places for coordinates.

crs: gws.CrsName | None = 'EPSG:3857'

CRS of the map and its layers.

extent: gws.Extent | None

Map extent in map CRS coordinates.

extentBuffer: int | None

Buffer added around the configured extent, in map units.

layers: list[gws.ext.config.layer]

Map layers.

title: str = ''

Map title, used as the root layer title.

wrapX: bool = False

Repeat the world horizontally in the client.

zoom: gws.gis.zoom.Config | None

Allowed scales or zoom levels and the initial zoom.

class gws.base.map.core.Object

Bases: gws.Map

Default map.

wrapX: bool

Repeat the world horizontally in the client.

configure()

Configuration hook.

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

props(user)

Generate a Props struct for this object.

Do not call this method directly, use gws.props_of instead, which also checks permissions.

Parameters:

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

Returns:

A Props object or a dict. Nested objects are converted to props as well.

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

Bases: gws.Data

Basic data object.

This object can be instantiated by passing one or more dict or Data arguments and/or keyword args. All keys and keywords become attributes of the object.

Accessing an undefined attribute returns None and no error is raised, unless the attribute name starts with an underscore.

Example:

d = gws.Data({'a': 1}, b=2)
d.a     # 1
d['b']  # 2
d.c     # None
center: gws.Point
coordinatePrecision: int
crs: str
crsDef: str | None
extent: gws.Extent
initResolution: float
resolutions: list[float]
rootLayer: gws.base.layer.Props
title: str = ''
wrapX: bool