Skip to content

[BUG] H3 layers are not fully rendered in Map when layer is swapped #1044

@hamilton-earthscope

Description

@hamilton-earthscope

Context

When i use ScatterPlotLayers in my Map, i can dynamically replace the layers and the map redraws as expected.

scatterlayer.mp4

However, when I use H3HexagonLayer and try to do the same thing, the map never fully redraws until i pan or zoom the map. The outlines of the hexagons are being drawn.

h3layer.mp4

Resulting behaviour, error message or logs

No logs/warnings/errors.

Environment

  • OS: Mac Sequoia 15.6.1
  • Browser: VSCode/Cursor using IPython.display
  • Python 3.13.5
  • Lonboard Version: [e.g. 0.13.0]

Steps to reproduce the bug

  1. build h3 hexagon layers that i can dynamically switch between with a slider widget
  2. create map and set first h3 layer (doesn't render fully until panning/zooming)
  3. on slider change, dynamically replace the map's layer with pre-computed layer

For clarity, when I say "replace the map's layer" I mean:

map_widget = Map(...)
slider = widgets.IntSlider(...)

def on_slider_change(change):
    current_minute_idx = change["new"]
    new_layer = bin_layers[current_minute_idx]
    map_widget.layers = [new_layer]

slider.observe(on_slider_change, names="value")

I'm creating the layers as follows

bin_layers = {}
for ... in range(...):
    colors = ...

    # Create H3 layer
    layer = H3HexagonLayer(layer_table, get_hexagon=layer_table.column("h3_index"))
    layer.get_fill_color = colors

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions