Skip to content

add_h3t_source() for tiled H3 data (#199) - #209

Merged
walkerke merged 1 commit into
mainfrom
pr-199-h3t
Jun 17, 2026
Merged

add_h3t_source() for tiled H3 data (#199)#209
walkerke merged 1 commit into
mainfrom
pr-199-h3t

Conversation

@walkerke

Copy link
Copy Markdown
Owner

Lands @bbest's #199 (H3 tiled source), rebased onto the current 0.5 main with conflicts resolved.

Adds add_h3t_source() — an R wrapper for the h3tiles:// MapLibre protocol bundled in h3j-h3t — so H3 hex layers can be driven from a tiled {z}/{x}/{y} endpoint (one request per viewport) instead of loading a single monolithic H3J file. Includes Ben's five upstreamed h3j-h3t fixes (0.9.2 → 0.9.7) for MapLibre v3–v5, query-string tile URLs, empty tiles, and multiple sources per page / per compare side.

Conflict resolution notes

The original PR predated the 0.5 slider/flowmap/compare work and conflicted in maplibregl.js and maplibregl_compare.js:

  • maplibregl.js — kept main's filter-registry set_filter (so the slider/legend filter composition is preserved) and layered Ben's new add_h3t_sources / add_h3j_sources proxy handlers alongside it.
  • maplibregl_compare.js — main has since added getLayerControlVisibility() / setLayerControlVisibility() helpers that already perform Ben's getLayer() pre-check (silencing the missing-layer error event) and support multi-map compare (sync more than 2 maps  #204) and flowmap layers. Those supersede Ben's inline version, so the helpers were kept. Ben's h3t init + proxy handlers are retained.
  • Removed a stray debug build-marker / console.log that survived from the PR's development commits.
  • add_h3t_source() now ends with return(map) to match the package convention.

Ben's authorship is preserved on the commit. R CMD check clean (0 errors / 0 warnings / 0 notes); both JS bindings pass node --check. Supersedes #199.

Note: Mapbox parity (addH3TSource on mapboxgl.js) is still out of scope, as in the original PR.

@walkerke
walkerke merged commit 70b5056 into main Jun 17, 2026
@bbest

bbest commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Bravo! Thank you so much for your detailed review and merge :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants