Skip to content
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

Moving the map causes random zoom #22

Open
ocobacho opened this issue Jun 18, 2019 · 5 comments
Open

Moving the map causes random zoom #22

ocobacho opened this issue Jun 18, 2019 · 5 comments

Comments

@ocobacho
Copy link

I have the same problem on ubuntu and android I thinks is related to performance and workload because it tends to happen more on high zoom where more tiles are displayed and also if I have a lot of markers or things going on. When reducing MAX_WORKERS it tends to happen less. So it probably happens in the RPi 3b because of the low resources. Is there a way to optimize this?

Originally posted by @ocobacho in kivy-garden/garden.mapview#69 (comment)

@ocobacho ocobacho changed the title I have the same problem on ubuntu and android I thinks is related to performance and workload because it tends to happen more on high zoom where more tiles are displayed and also if I have a lot of markers or things going on. When reducing MAX_WORKERS it tends to happen less. So it probably happens in the RPi 3b because of the low resources. Is there a way to optimize this? Moving the map causes random zoom Jun 18, 2019
@KhDenys
Copy link

KhDenys commented Oct 18, 2019

@AndreMiras @tshirtman @zworkb @tito Hi. I also have this problem on ubuntu, mac os and android. I tried debug it and found some mistake in on_transform method:

def on_transform(self, *args):
        self._invalid_scale = True
        if self._transform_lock:
            return
        self._transform_lock = True
        # recalculate viewport
        map_source = self.map_source
        zoom = self._zoom
        scatter = self._scatter
        scale = scatter.scale  # here!!!
        if scale >= 2.:
            zoom += 1
            scale /= 2.
        elif scale < 1:
            zoom -= 1
            scale *= 2.
        ...

scatter.scale returns value >= 2 without any tries to change zoom. I think it is a problem in kivy.uix.scatter.Scatter

@AndreMiras AndreMiras transferred this issue from kivy-garden/garden.mapview Apr 18, 2020
@michaelu123
Copy link

The random zoom goes away if you change the two if statements above to
if (scale - 2.0) > 0.01:
and
elif (scale - 1.0) < -0.01:

@michaelu123
Copy link

Or, of course, if scale >2.01, elif scale <0.99

@KhDenys
Copy link

KhDenys commented May 19, 2020

@michaelu123 Thanks for info. I'll try it ASAP.

@michaelu123
Copy link

michaelu123 commented May 21, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants