Avoid unnecessary style recalculation

This commit is contained in:
John Firebaugh
2013-02-13 11:57:32 -08:00
parent 7fcf329ee8
commit a53e604b5b

View File

@@ -152,8 +152,12 @@ iD.Map = function(context) {
if (resetTransform())
difference = undefined;
surface.attr('data-zoom', ~~map.zoom());
tilegroup.call(background);
var zoom = String(~~map.zoom());
if (surface.attr('data-zoom') !== zoom)
surface.attr('data-zoom', zoom);
if (!difference)
tilegroup.call(background);
if (map.editable()) {
context.connection().loadTiles(projection, dimensions);