mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-14 01:33:03 +00:00
Add iD.Map#redrawEnable to enable/disable redraws
This commit is contained in:
@@ -267,6 +267,7 @@ window.iD = function () {
|
||||
context.zoomOut = map.zoomOut;
|
||||
context.zoomInFurther = map.zoomInFurther;
|
||||
context.zoomOutFurther = map.zoomOutFurther;
|
||||
context.redrawEnable = map.redrawEnable;
|
||||
|
||||
context.surfaceRect = function() {
|
||||
// Work around a bug in Firefox.
|
||||
|
||||
@@ -8,6 +8,7 @@ iD.Map = function(context) {
|
||||
.scaleExtent([1024, 256 * Math.pow(2, 24)])
|
||||
.on('zoom', zoomPan),
|
||||
dblclickEnabled = true,
|
||||
redrawEnabled = true,
|
||||
transformStart,
|
||||
transformed = false,
|
||||
minzoom = 0,
|
||||
@@ -186,7 +187,7 @@ iD.Map = function(context) {
|
||||
}
|
||||
|
||||
function redraw(difference, extent) {
|
||||
if (!surface) return;
|
||||
if (!surface || !redrawEnabled) return;
|
||||
|
||||
clearTimeout(timeoutId);
|
||||
|
||||
@@ -255,6 +256,12 @@ iD.Map = function(context) {
|
||||
return map;
|
||||
};
|
||||
|
||||
map.redrawEnable = function(_) {
|
||||
if (!arguments.length) return redrawEnabled;
|
||||
redrawEnabled = _;
|
||||
return map;
|
||||
};
|
||||
|
||||
function interpolateZoom(_) {
|
||||
var k = projection.scale(),
|
||||
t = projection.translate();
|
||||
|
||||
Reference in New Issue
Block a user