From c2971f667d2ba76f098db776e8f5174fe00f6f54 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Fri, 2 Nov 2018 10:49:55 -0400 Subject: [PATCH] Remove setCenter() from map.dimensions() This was triggering a weird redraw which made the map slow and look wrong The map will redraw again in a few milleseconds anyway. This means that the the map will not stay on the center, but rather the top-left corner, which kind of feels better anyway, as it doesn't move things around as much. --- modules/renderer/map.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/renderer/map.js b/modules/renderer/map.js index 2878d8a48..2d699b862 100644 --- a/modules/renderer/map.js +++ b/modules/renderer/map.js @@ -662,13 +662,11 @@ export function rendererMap(context) { map.dimensions = function(_) { if (!arguments.length) return dimensions; - var center = map.center(); dimensions = _; drawLayers.dimensions(dimensions); context.background().dimensions(dimensions); projection.clipExtent([[0, 0], dimensions]); mouse = utilFastMouse(supersurface.node()); - setCenter(center); scheduleRedraw(); return map;