Skip to content

Commit

Permalink
Fix inconsistency with Mapbox canvas layer api #113 (#114)
Browse files Browse the repository at this point in the history
This PR fixes #113
  • Loading branch information
CaviarChen authored Dec 9, 2024
1 parent 2514d28 commit 47eb8a2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions editor/src/utils/MapRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -423,18 +423,18 @@ export class MapRenderer {
this.mainCanvas.height = 512 * (bottom - top + 1);
this.renderOnce();
const tileBounds = new mapboxgl.LngLatBounds(
tileXYToLngLat([left, top], zoom),
tileXYToLngLat([right + 1, bottom + 1], zoom)
tileXYToLngLat([left, bottom + 1], zoom),
tileXYToLngLat([right + 1, top], zoom)
);

const mainCanvasSource = this.mapboxMap.getSource(
"main-canvas-source"
) as mapboxgl.CanvasSource | undefined;
mainCanvasSource?.setCoordinates([
tileBounds.getSouthWest().toArray(),
tileBounds.getSouthEast().toArray(),
tileBounds.getNorthEast().toArray(),
tileBounds.getNorthWest().toArray(),
tileBounds.getNorthEast().toArray(),
tileBounds.getSouthEast().toArray(),
tileBounds.getSouthWest().toArray(),
]);
}

Expand Down

0 comments on commit 47eb8a2

Please sign in to comment.