MapController.java code suggestion
See original GitHub issueI am right now away from all my development environment. So, this is a strange pull request.
But for the reason of issue #411 , I was browsing through code of org/osmdroid/views/MapController.java
.
Line 367-377 I found (sorry, struggling with multi line code formatting). `float difference = zoomLevel < currentZoomLevel ? currentZoomLevel - zoomLevel : zoomLevel - currentZoomLevel;
float end = zoomLevel < currentZoomLevel ? 1f/(float) Math.pow(difference, 2f) : (float) Math.pow(difference, 2f);
end = difference == 1f ? (zoomLevel < currentZoomLevel ? 0.5f : 2f) : end;`
This really looks like a misunderstood Math.pow() and other strange code. I think, the following single line should be not only equivalent for the case difference == 1 but better in every other case:
float end = (float) Math.pow(2.0, zoomLevel - currentZoomLevel);
Issue Analytics
- State:
- Created 7 years ago
- Comments:14
We can just add a button that simulates any zoom condition we want
great, i’ll get it merged in. thanks for doing the leg work