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.
This commit is contained in:
Bryan Housel
2018-11-02 10:49:55 -04:00
parent 26e63d64e3
commit c2971f667d
-2
View File
@@ -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;