gws.gis.zoom

Source code: gws.gis.zoom

Package Contents

class gws.gis.zoom.Config(*args, **kwargs)

Bases: gws.Config

Zoom levels and resolutions

initResolution: float | None

initial resolution

initScale: float | None

initial scale

maxResolution: float | None

maximal resolution

maxScale: float | None

maximal scale

minResolution: float | None

minimal resolution

minScale: float | None

minimal scale

resolutions: list[float] | None

allowed resolutions

scales: list[float] | None

allowed scales

gws.gis.zoom.init_resolution(cfg, resolutions: list) float

Returns the initial resolution.

Parameters:
  • cfg – A config.

  • resolutions – List of Resolutions.

gws.gis.zoom.OSM_RESOLUTIONS

Resolutions corresponding to OSM zoom levels.

gws.gis.zoom.OSM_SCALES = [500000000, 250000000, 150000000, 70000000, 35000000, 15000000, 10000000, 4000000, 2000000,...

//wiki.openstreetmap.org/wiki/Zoom_levels)

Type:

Scales corresponding to OSM zoom levels. (https

gws.gis.zoom.resolutions_from_bounds(b: gws.Bounds, tile_size: int) list[float]

Loads resolutions from bounds.

Parameters:
  • b – Bounds object.

  • tile_size – The tile size.

Returns:

A list of resolutions.

gws.gis.zoom.resolutions_from_config(cfg, parent_resolutions: list[float] = None) list[float]

Loads resolution from a config.

Parameters:
  • cfg – A config.

  • parent_resolutions – List of parent resolutions.

Returns:

A list of resolutions.

gws.gis.zoom.resolutions_from_source_layers(source_layers: list[gws.SourceLayer], parent_resolutions: list[float]) list[float]

Loads resolution from a source layers.

Parameters:
  • source_layers – Source layers.

  • parent_resolutions – List of parent resolutions.

Returns:

A list of resolutions.