-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
center_on does not center, plus once more the random zoom problem #33
Comments
After some more hours of poking around, I first had to realize that the random zoom had not been entirely defeated, as I had thought.
Note the various calls to round(). Interestingly, I had to replace in on_touch_up the final call of
with
otherwise the super()-call failed with the message The whole rounding is certainly a hack, but apparently mapview needs some more consideration for floating |
Closed involuntarily, not meaning to do so... |
@michaelu123 After several tests, I commented out the following 2 lines self.animated_diff_scale_at(.....) in
This removes all random zooms! |
@michaelu123 @bsuarez49 , thank you guys , you really helped it, now the problem is gone |
Two bugs in mapview
The following program demonstrates two bugs in mapview.
My mapview version is 0.104.
Python is at 3.7.
The first bug is a random zoom, when the map is moved in high zoom levels.
It is also issued in #22 .
This one is easy to fix. I noticed that the zoom changed when scale was
a little bit larger than 2.0, e.g. 2.00000004. In view.py/on_transform replace
with
The second bug I was unable to fix, because the interaction
between Scatter and Mapview remains a mystery for me. The problem shows
normally in high zoom level, and it occurs randomly. When you press the
"Center" button, the map moves consistently to the "Fischbrunnen" at
Marienplatz, Munich. When you however move the map, so that the marker is
outside of the center, and click on the marker, the marker does often not move
back to the center. This may require a few attempts to reproduce. It is easiest
to reproduce when you zoom to level 19, click the Center Button, move the map
so that the marker is near the upper right corner, and click it. Often, the
map moves erratically and sometimes zooms out. This behaviour seems to be
dependent on the mouse position when the marker is clicked. When we center
the map with the "Center"-Button, the mouse is outside of the Scatter,
and this seems to be the reason why this center always succeeds.
In the error case,
do_update gets called many times, where the scale grows slowly from 1 to 2.
Maybe floating point precision plays a role here. But then there is the random
behaviour of the bug, which may have to do with the unforeseeable times,
in which the Clock calls the scheduled callbacks.
Workaround technique
I could easily change the code in the package, when running my program on the desktop.
On Android, however, I could not find out what must be done, to change
the code in one of the required packages, Below .buildozer, there are a
couple of directories containing mapview code, plus some zip files, plus
some .pyc files, and nothing I did caused the app to run the modified code.
Here I describe a workaround:
In main.py, between the App construction and app.run, call bugs.fixBugs()
bugs.py contains this code:
The text was updated successfully, but these errors were encountered: