From 5f6d73ae418c0aa529c476837708479b4f482267 Mon Sep 17 00:00:00 2001 From: Aidan H Date: Fri, 15 Apr 2022 16:59:06 -0600 Subject: [PATCH] Fix rendering issue with globe view at high zoom --- src/mapbox/mapbox.ts | 2 ++ src/types/index.ts | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/mapbox/mapbox.ts b/src/mapbox/mapbox.ts index f2fd5ad3b..b9d271c7b 100644 --- a/src/mapbox/mapbox.ts +++ b/src/mapbox/mapbox.ts @@ -852,7 +852,9 @@ export default class Mapbox { // Replace map.transform with ours during the callbacks map.transform = this._renderTransform; baseFire.call(map, event, properties); + const savedProjection = map.transform.projection; map.transform = tr; + map.transform.projection = savedProjection; return map; } diff --git a/src/types/index.ts b/src/types/index.ts index db358cf00..1421bf0e3 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -17,6 +17,8 @@ export type { ScaleControl as MapboxScaleControl } from 'mapbox-gl'; +import type {ProjectionSpecification} from '../types'; + /** * Stub for mapbox's Transform class * https://github.com/mapbox/mapbox-gl-js/blob/main/src/geo/transform.js @@ -29,6 +31,7 @@ export type Transform = { bearing: number; pitch: number; padding: PaddingOptions; + projection: ProjectionSpecification; clone: () => Transform; resize: (width: number, height: number) => void;