Get your own customer support community
 

zoom bug

I noticed an issue where the user can click zoom in or out buttons and 'erase' the map when they click past the zoom limits. I tried to ignore clicks past the zoom range, but some clicks can make it in before the zoomLevel is updated on the map. I considered disabling the controls until the action finished, but I rejected this because I wanted the controls to remain responsive.

The animationProcess method in Map has:
grid.allowPainting(__animSteps.length <= 1);
(2 times, but it is commented out for panning, and available for zooming in my version).

Tiles are not redrawn when the map hits a zoom limit because there are more animation steps queued up, and TileGrid throws out the zoomBy calls that would go past the zoom limits.

I put a hack into my copy of the normalizeWell function on TileGrid which seems to do the trick:
...
zoomAdjust = Math.round(Math.log(_well.scaleX) / Math.log(2));
scaleAdjust = Math.pow(2, zoomAdjust);

//trace('This is where we scale the whole well by '+zoomAdjust+' zoom levels: '+(100 / scaleAdjust)+'%');

var newZoom:int = zoomLevel + zoomAdjust;
if (newZoom == bottomRightInLimit.zoom || newZoom == topLeftOutLimit.zoom)
allowPainting(true);


var n:int;
for (n = 0; n < zoomAdjust; n += 1)
...

I think I am reporting a problem more than submitting code to be used- there must be a cleaner way to handle this, but I hope this helps someone else.
 
indifferent I’m undecided
Inappropriate?
1 person has this problem

User_default_medium