From 47eb8a23de443f226b86ed2b562b83ee6d0911e4 Mon Sep 17 00:00:00 2001 From: "Zed(Zijun) Chen" Date: Mon, 9 Dec 2024 22:16:48 +0800 Subject: [PATCH] Fix inconsistency with Mapbox canvas layer api #113 (#114) This PR fixes #113 --- editor/src/utils/MapRenderer.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/editor/src/utils/MapRenderer.ts b/editor/src/utils/MapRenderer.ts index 040f423..c97757c 100644 --- a/editor/src/utils/MapRenderer.ts +++ b/editor/src/utils/MapRenderer.ts @@ -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(), ]); }