question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MapController.java code suggestion

See original GitHub issue

I 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:closed
  • Created 7 years ago
  • Comments:14

github_iconTop GitHub Comments

1reaction
spyhunter99commented, Sep 17, 2016

We can just add a button that simulates any zoom condition we want

1reaction
spyhunter99commented, Sep 16, 2016

great, i’ll get it merged in. thanks for doing the leg work

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I show the places suggestions below text box?
I am using mapbox for my apllication where I want to to show the suggestions of places below the textbox... Below is my...
Read more >
Find a route and directions | ArcGIS Runtime API for Java
Learn how to find a route and directions with the route service . find a route and directions. Routing is the process of...
Read more >
com.google.android.maps.MapController java code examples
Best Java code snippets using com.google.android.maps.MapController (Showing top 20 results out of 315) · Most used methods · Popular in Java.
Read more >
How to Turn on Code Suggestion in Eclipse Java - YouTube
In this Quick Video i will show how to turn on Code Suggestion for Java in Eclipse.
Read more >
MapView and java.lang.IllegalStateException - Issue Tracker
Thread.run(Thread.java:1058) I think that there is some problem with recycling map object, becuse on my second activity, MapView ocupies only 50% od width, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found