MapSourceRegistry

class MapSourceRegistry(**properties: Any)

Superclasses: Object

Implemented Interfaces: ListModel

This object allows you to hold MapSource instances, you can access a default set of sources with populate_defaults.

It conveniently implements ListModel to easily integrate with it.

Constructors

class MapSourceRegistry
classmethod new() MapSourceRegistry

Create a new MapSourceRegistry.

classmethod new_with_defaults() MapSourceRegistry

Create a new MapSourceRegistry with defaults map sources. This is identical to calling populate_defaults after new().

Methods

class MapSourceRegistry
add(map_source: MapSource) None

Adds the MapSource to the MapSourceRegistry

Parameters:

map_source – a MapSource

get_by_id(id: str) MapSource | None

Find the MapSource with the corresponding id

Parameters:

id – the id of the MapSource

populate_defaults() None

Populates the MapSourceRegistry with a default set of sources.

remove(id: str) None

Removes the corresponding MapSource from the registry. If the source doesn’t exist in the registry, this function does nothing.

Parameters:

id – a MapSource id