Skip to content

Commit 4d034d5

Browse files
authored
fix(plugins): keep globe projection when adding a Zarr layer via addZarrLayer (#1470)
addZarrLayerExclusively called ensureMercatorProjection, snapping the map out of globe whenever a plugin added a Zarr layer through addZarrLayer — while the Add Data → Zarr panel (same renderer) kept globe. @carbonplan/zarr-layer reprojects on the GPU and renders projected data correctly in globe, so the switch was unnecessary and made the two Zarr entry points inconsistent. Remove it; the COG / cloud-NetCDF / LiDAR deck.gl paths keep their own ensureMercatorProjection calls. Fixes #1466
1 parent a76bbbf commit 4d034d5

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

packages/plugins/src/plugins/maplibre-components.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2281,9 +2281,9 @@ async function addZarrLayerExclusively(
22812281
zarrControl.hide();
22822282
}
22832283

2284-
// The untiled Zarr renderer draws in Web Mercator; switch off globe first
2285-
// (matching the COG raster flow) so the layer paints.
2286-
ensureMercatorProjection(app.getMap?.());
2284+
// Zarr renders correctly in globe (proj4js reprojects on the GPU), so — unlike the
2285+
// COG/deck.gl path — do not force Mercator here. This keeps addZarrLayer consistent
2286+
// with the Add Data → Zarr panel, which never switched projection. See #1466.
22872287

22882288
const control = zarrControl;
22892289
const headers = options.headers;

0 commit comments

Comments
 (0)