gis.integration

Module Contents

Classes

MapboxApp

Provides mapbox integration

Functions

get_js_path(→ str)

get_css_path(→ str)

get_leaflet_asset(→ Iterator[str])

get_proj4js_asset(→ Iterator[str])

get_geo_mapbox(→ Iterator[str])

get_geo_vermessungsamt_winterthur(→ Iterator[str])

get_geo_zugmap_basisplan(→ Iterator[str])

get_geo_zugmap_orthofoto(→ Iterator[str])

get_geo_bs(→ Iterator[str])

get_geo_admin(→ Iterator[str])

get_geo_admin_aerial(→ Iterator[str])

inject_mapbox_api_token_tween_factory(...)

class gis.integration.MapboxApp[source]

Bases: more.webassets.WebassetsApp

Provides mapbox integration onegov.core.framework.Framework based applications.

Doesn’t do much except serve the mapbox public token, so we can store it in configuration and not with the source. Not that this token is inherently unsafe and must be the public token.

Do not use private tokens!

If we wanted to avoid this we would have to use a mapbox proxy server, which seems a bit too much. If we detect abuse of the public token we just switch to a new one. If it must be we can even automatically rotate the token regularly.

configure_mapbox(*, mapbox_token: str | None = None, **cfg: Any) None[source]

Configures the mapbox.

The following configuration options are accepted:

Mapbox_token:

The public mapbox token to be used for the mapbox api.

gis.integration.get_js_path() str[source]
gis.integration.get_css_path() str[source]
gis.integration.get_leaflet_asset() Iterator[str][source]
gis.integration.get_proj4js_asset() Iterator[str][source]
gis.integration.get_geo_mapbox() Iterator[str][source]
gis.integration.get_geo_vermessungsamt_winterthur() Iterator[str][source]
gis.integration.get_geo_zugmap_basisplan() Iterator[str][source]
gis.integration.get_geo_zugmap_orthofoto() Iterator[str][source]
gis.integration.get_geo_bs() Iterator[str][source]
gis.integration.get_geo_admin() Iterator[str][source]
gis.integration.get_geo_admin_aerial() Iterator[str][source]
gis.integration.inject_mapbox_api_token_tween_factory(app: MapboxApp, handler: Callable[[CoreRequest], Response]) Callable[[CoreRequest], Response][source]