MapXL / route-me

Automatically exported from code.google.com/p/route-me
0 stars 0 forks source link

Double clicking on map doesn't go to the next zoom level #135

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Start SampleMap application, and note the current zoom level shown on 
screen e.g. 15 
2. Double click on map
3. Zoom level after zooming is not a native zoom level e.g. it goes from 15 
to 16.20

What is the expected output?
Map should zoom exactly to the current zoom level + 1.

What subversion release are you using? 
r612

Does the behavior occur on the simulator, a real iPhone/iPod Touch, or 
both?
Both

I have managed to circumvent this by modifying animatedZoomStep to 
never exceed the targetZoom:

- (void)animatedZoomStep:(NSTimer *)timer
{

        .....

    if ((zoomIncr > 0 && [self zoom] >= targetZoom) || (zoomIncr < 0 && 
[self zoom] <= targetZoom))
    { 
               ...
    }
    else
    {
        if (([self zoom] + zoomIncr) > targetZoom) {
            zoomIncr = targetZoom - [self zoom];
        }
        float zoomFactorStep = exp2f(zoomIncr);

                ......
    }
}

However I still don't understand the root of the problem i.e. why the 
parameters passed to animatedZoomStep cause it to overstep the 
targetZoom.

Original issue reported on code.google.com by Alex.Bax...@gmail.com on 6 Mar 2010 at 9:38