useMapFly's zoomToLegendRow comment names readSourceFeatures, not the engine-private _data

The comment still said the code reads map.getSource()._data, which invites a copy
of the private field back in; the code reads through the shared helper that knows
both engines' source shapes.
This commit is contained in:
Doxa Maps 2026-09-28 09:55:53 +00:00
parent f5a9ee40b7
commit 5ae7d31b04

View file

@ -474,8 +474,9 @@ export function useMapFly(options = {}) {
/**
* zoomToLegendRow — uniform "click a legend row, fit the scope it represents."
*
* Reads the full `language-families` source data via map.getSource()._data
* and evaluates the Mapbox filter expression in JS, bypassing the viewport
* Reads the full `language-families` source data through readSourceFeatures()
* (library/maps/pin-selection.js, which knows both engines' source shapes; never
* the engine-private `_data` directly) and evaluates the filter expression in JS, bypassing the viewport
* clip that previously caused off-screen regions to silently no-op. fitBounds
* is bidirectional — it zooms OUT to a wider region just as readily as it
* zooms IN to a tight cluster, so Africa-row and North-India-cluster-row