geeViz.viewerPages

The viewer pages: which skins there are, and the page Map.export_html writes for each.

Kept apart from geeViz.geeView, which initializes Earth Engine on import, so a host that serves saved maps (askterra) can rebuild one on today’s viewer with refresh_exported_html() without touching Earth Engine. geeViz.geeView re-exports everything here.

Functions

refresh_exported_html(html[, skin])

Rebuild a page mapper.export_html() wrote, on today's viewer.

geeViz.viewerPages.refresh_exported_html(html: str, skin: str | None = None) → str[source]

Rebuild a page mapper.export_html() wrote, on today’s viewer.

An exported map freezes two things: its layers and map calls (the run script, the same in every skin) and the page around them (which skin, and that skin’s markup as it was then). This keeps the first and rebuilds the second, as export_html would write it now: no Earth Engine call is made and no Python session is needed, so a map saved long ago, or by a process that has since exited, moves to the current viewer (or another skin) as it is. Its asset base and auth placeholders are kept as saved.

What it cannot update is anything the run script itself carries: layers and visualization parameters computed in Python when the map was made. Those change only by running that code again.

Parameters:
  • html (str) – A page written by export_html.

  • skin (str, optional) – "original" or "delta". Defaults to the skin a new Map starts with (GEEVIZ_SKIN, else DEFAULT_SKIN).

Returns:

The rebuilt page.

Return type:

str

Raises:

ValueError – If html is not a page export_html wrote, or the skin is unknown.