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

iOS 10 MobileSafari zoom problems #266

Open
c00ni opened this issue Sep 29, 2016 · 18 comments
Open

iOS 10 MobileSafari zoom problems #266

c00ni opened this issue Sep 29, 2016 · 18 comments

Comments

@c00ni
Copy link
Contributor

c00ni commented Sep 29, 2016

Sometimes (frequently) the map glitches out and the Pokémon icon size doesn't maintain their size and refuse to get smaller again. Map tiles at different zoom levels also stop loading.
Markers remain functional but are also massive.

I believe this happens when you try to zoom in whilst new data is being fetched, or something related to that. EDIT: See near the bottom of comments to see the real cause

Page must be reloaded (not refreshed) to fix.

http://m.imgur.com/atIAc4G
Ignore that %, I'm just mucking around with stuff.

@seikur0
Copy link
Owner

seikur0 commented Sep 29, 2016

I'm not sure, this might be fixed with the new server now.

@c00ni
Copy link
Contributor Author

c00ni commented Sep 29, 2016

It is not =/

@seikur0 seikur0 added the bug label Sep 29, 2016
@seikur0
Copy link
Owner

seikur0 commented Sep 29, 2016

It's more a problem with the zooming putting too much graphical strain on your mobile, I'm not sure, how to help you with this.

@c00ni
Copy link
Contributor Author

c00ni commented Sep 29, 2016

Hmmm
I would have imagined it may lag but eventually load properly... but it just doesn't.
I guess we can leave this open until someone figures it out?

@seikur0
Copy link
Owner

seikur0 commented Sep 29, 2016

I remember that from earlier, when the icons weren't optimized yet and I still used the simpleHTTPServer, that this happened, but it hasn't happened to me in a long time. I'll keep an eye on it

@seikur0 seikur0 closed this as completed Sep 29, 2016
@seikur0 seikur0 reopened this Sep 29, 2016
@seikur0
Copy link
Owner

seikur0 commented Sep 29, 2016

And he accidentally closed it :D

@c00ni
Copy link
Contributor Author

c00ni commented Sep 29, 2016

It happens even when there's almost no pokemon on the map, and happens on an iPhone 7 as well so I don't think it's gfx strain.

Actually, I think it may have started after the icons were merged into the one file to reduce load?

is there a quick way of temp. reverting it?

@seikur0
Copy link
Owner

seikur0 commented Sep 29, 2016

A quick way? Split the sprite into single icons and change the code in mapscan.js.

@c00ni
Copy link
Contributor Author

c00ni commented Sep 29, 2016

I've half figured it out,

If you pinch to zoom with both fingers on a pokemon icon each, it zooms in/out the whole page's visible layer instead of adjusting the zoom level of the map tiles.

Once the icons are massive, you can "fix" it by zooming out with both fingers on a pokemon icon.

Zooming with one finger on a pokemon and the other on empty map space works properly.

Still unsure how to fix but at least the cause has been found.

@seikur0
Copy link
Owner

seikur0 commented Sep 30, 2016

Mkay, interesting cause.

I guess there are two things, you can try.

First, in the constructor for the markers, line 172 of mapscan.js, try setting it to optimized=true, that should probably be changed anyway and may change that behavior.

Second, you could add code like this to mapscan.js:

google.maps.event.addListener(map, 'zoom_changed', function() {
  for (var i = 0; i < markers.length; i++) {
    markers[i].setIcon(markers[i].getIcon());
  }
});

Or instead of resetting the icon, set it to invisible and then visible or anything else, that comes to mind. See this.

@c00ni
Copy link
Contributor Author

c00ni commented Sep 30, 2016

Nothing worked
I wouldn't imagine it's to do with the map's zoom level - the map thinks the zoom level hasn't changed, the layer/canvas/whatever you call it that the map is drawn on is changing zoom level.
Hmmm, will look around for other solutions...

@seikur0
Copy link
Owner

seikur0 commented Sep 30, 2016

Okay then rather than changing the icon of the markers unbind them from the map with .setMap(null) and rebind them with .setMap(map), maybe like that?

@seikur0
Copy link
Owner

seikur0 commented Sep 30, 2016

Or you listen to the dragstart event of the map, I think that should be fire, when you start the zoom. In that use map.setClickableIcons(false) and then in the dragend event map.setClickableIcons(true). If these events don't fire, try the bounds_changed and idle events instead.

@c00ni
Copy link
Contributor Author

c00ni commented Sep 30, 2016

Am trying to implement possible solutions you suggest.
Am inexperienced cry

but I don't think dragstart will fire because the issue is that you're not actually dragging / tapping the map at all, just the markers? (because normally the zoom/drag events are properly handled to change the map tiles instead of dragging/zooming the whole page)

@seikur0
Copy link
Owner

seikur0 commented Sep 30, 2016

That's why I said I wasn't sure, about that being the correct event, add a listener and put console.log('hey') in it. I can't be the only one, who uses 'hey' as the check word, right? :D

@dikkedeur
Copy link

i can confirm this, this was not happening on ios 9.x, it came with ios10, so the new safari has some problems with zooming in and then out and then icons of the pokemons stay big, so cluthering the screen.

@seikur0
Copy link
Owner

seikur0 commented Sep 30, 2016

That's funny, because yesterday I saw an old post about the same thing happening in ios 6.0, when it didn't happen in ios 5.0 before. I think it was 6 and 5 anyways. Did they reintroduce an ancient bug?

@dikkedeur
Copy link

no idea if it is a bug re-introduced.. all i know that on safari on ios 9.x it didnt happen.

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

No branches or pull requests

3 participants