Skip to content

transitlos.map.circle_bands

Zoom bands of the circle view, from how far apart the circles of each H3 resolution are on screen.

A resolution takes over where its neighbouring cell centres are ~6 px apart (at the map's latitude) and keeps the view until the next finer resolution reaches that spacing, so a view never shows a sparse handful of circles nor a solid carpet of them. Each band starts no earlier than the first zoom its tiles exist at (an earlier start would draw nothing); the radius grows with zoom inside the band (the page's __applyCircleRadius). Bands may start at fractional zooms.

apply_to_page(path)   # rewrites a built page's circle layers and `__circleZoomBands`

start_zoom(res, lat)

Zoom at which cells of res are TARGET_PX apart at latitude lat.

Parameters:

Name Type Description Default
res int

H3 resolution.

required
lat float

Latitude (degrees).

required

Returns:

Type Description
float

Zoom level.

circle_bands(resolutions, lat, tile_min_zoom=None)

{res: (min_zoom, max_zoom_exclusive)}; the coarsest resolution starts at 0 and the finest runs to 24.

Parameters:

Name Type Description Default
resolutions Iterable[int]

H3 resolutions drawn as circles.

required
lat float

Latitude of the map.

required
tile_min_zoom Optional[Dict[int, int]]

Optional {res: first zoom with tiles}.

None

apply_to_page(page)

Sets every circle layer's zoom range and the page's __circleZoomBands (inclusive ints are [lo, hi_exclusive - 1]) from the circle tiles next to the page.

Parameters:

Name Type Description Default
page

Path of the built page.

required

Returns:

Type Description
dict

{res: (min zoom, max zoom)} applied (empty if the page has no circle tiles).