Skip to content

transitlos.map.cell_popup

The click / address-search popup of a MapLibre page: always the H3 stats-resolution (H3 res 8) cell under the point.

One script (CELL_POPUP_JS) serves the city maps and the US map. It owns the popup rendering (header with level of service + population, a collapsible table of every statistic of the cell, and for each statistic its percentile among all the cells of a few scopes) and delegates data access to a page-provided provider:

window.__cellPopupProvider(lng, lat) -> Promise<null | {cell, row, scopes}>
    row    {column: value} of the res-8 cell,
    scopes [{name, pct(column, value) -> 0..100 | null}]   (e.g. County, State, Nation  /  Urban area, City core, All places)

window.__openCellPopup(lng, lat, {expanded, title}) opens it (the geohierarchy click handler calls it before falling back to its own per-shape popup, the address search calls it with expanded: true so all the stats show at once). percentile_helpers_js() is the shared client-side percentile machinery (exact over an array, or interpolated in a 101-point quantile table).

cell_popup_script(abs_to_rel)

Script of the cell popup (percentiles of the clicked res-9 cell against its areas).

Parameters:

Name Type Description Default
abs_to_rel Dict[str, str]

{absolute column: relative column} pairs shown together.

required

Returns:

Type Description
str

JavaScript text.