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

Tiles disappear after zooming in on Chrome on Android #2078

Closed
thordursigurdsson opened this issue Oct 7, 2013 · 24 comments · Fixed by #2152
Closed

Tiles disappear after zooming in on Chrome on Android #2078

thordursigurdsson opened this issue Oct 7, 2013 · 24 comments · Fixed by #2152
Assignees
Labels
blocker Critical issue or PR that must be resolved before the next release
Milestone

Comments

@thordursigurdsson
Copy link

Noticed this after updating to Chrome 30.0.1599.82 for Android (4.1.2 and 4.2.2).
When zooming in the tiles seem to disappear, but will reappear when you move the map.
Tested on 0.6.4. The map on mapbox.com/tour (0.6.2) is also showing this behaviour.

http://jsfiddle.net/YZE6e/

@adrianrego
Copy link

seeing the same behavior on Android 4.3, same chrome version, and Leaflet master.

@cub
Copy link

cub commented Oct 9, 2013

I have the same problem. After a zoom (pinch or controller) I see 0.5second the loaded tile and them disappear. I have to pan once the map to see it. No problem until next zoom. I tried to do a layer.redraw() on zoomend with a timeout, the layer/tiles blink but still have to pan to view the map.
Chrome 30.0.1599.82, Leaflet 0.6.4 master, Android 4.1+

@mourner
Copy link
Member

mourner commented Oct 9, 2013

Thats quite weird... I'll try to check it out. Do you know if there's a known Leaflet version that works on the same browser version?

@cub
Copy link

cub commented Oct 9, 2013

Just found http://www.mycoursewalk.com/mobile_course_walk/course_view/752 from old issue #1182 and it work quite well with the lastest Chrome version. My map use osm format like (png) and his use google (jpg). I'm converting my tiles to .jpg to test [...] ok its not an issue of png/jpg. I tried to include his leaflet js+css, it didnt solve the problem (quite normal it's 0.6.4 too).

@mourner
Copy link
Member

mourner commented Oct 9, 2013

Hope it's reproducible on the emulator too... Need to try git bisect on the issue.

@ghost ghost assigned mourner Oct 9, 2013
@cub
Copy link

cub commented Oct 9, 2013

http://jsfiddle.net/89WBd/12/
Native TileLayer blinks. The Google layer has no problem. Same version of Leaflet.

Reproducible on emulator (genymotion) but you have to install manually Chrome via the Google Play.

@cub
Copy link

cub commented Oct 11, 2013

Found a fix :
.leaflet-tile-container img {
-webkit-backface-visibility: hidden;
}

@mourner
Copy link
Member

mourner commented Oct 11, 2013

@cub that's surprising, given that we have this chunk of code in place: https://github.com/Leaflet/Leaflet/blob/master/src/dom/DomUtil.js#L205-L208

Can you check out why doesn't the existing workaround get executed?

@cub
Copy link

cub commented Oct 11, 2013

if (L.Browser.mobileWebkit3d) { // return TRUE it's ok
el.style.WebkitBackfaceVisibility = 'hidden';
}
but the el refer to div (see below) and not img
leaflet-tile-pane
leaflet-objects-pane
leaflet-shadow-pane
leaflet-overlay-pane
leaflet-marker-pane
leaflet-popup-pane

@mourner
Copy link
Member

mourner commented Oct 11, 2013

@danzel so, it seems that although tiles are positioned with top/left in Chrome as per your past improvements, they still need the backface visibility hack in some cases to work properly. Oh well...

@danzel
Copy link
Member

danzel commented Oct 11, 2013

lol :(

@auxbuss
Copy link

auxbuss commented Oct 11, 2013

Looks like you have this cracked, but I just wanted to add that, as well as the above case, I also see behaviour when switching a map's lat/lng. For example:

  $('#locations').on('click', '.go-to-btn', function() {
    lat = $(this).data('lat')
    lng = $(this).data('lng')
    var latlng = new L.LatLng(lat, lng)
    marker.setLatLng(latlng)
    this_map.setView(latlng, 16)
  })

Chrome 30.0.1599.82, Android 4.3 (Nexus 4 & 7)

@auxbuss
Copy link

auxbuss commented Oct 12, 2013

I needed to upgrade to 0.6.4 so I couldn't confirm before, but I can confirm that @cub's fix works here.

@mourner
Copy link
Member

mourner commented Oct 14, 2013

OK, thanks for looking into this guys. We surely want to put this fix before the next stable release.

@cub
Copy link

cub commented Oct 14, 2013

No problem, I'm happy to help. Keep up the good work ;)
I remain available for Android testing.

@mourner
Copy link
Member

mourner commented Oct 21, 2013

@danzel so, should we just include the CSS fix above, or add some more fishy logic to setPos in TileLayer - what do you think?

@ghost ghost assigned danzel Oct 21, 2013
@danzel
Copy link
Member

danzel commented Oct 21, 2013

Leaning towards the css, we could set a class just for android if required.

@mourner
Copy link
Member

mourner commented Nov 4, 2013

@danzel lets do this.

@danzel
Copy link
Member

danzel commented Nov 4, 2013

The CSS fixes it for me, sent a PR

@mourner
Copy link
Member

mourner commented Nov 11, 2013

@danzel had to revert the CSS fix and put the hack in the JS instead, as that commit made all tiles a bit blurry in Chrome for OS X for me. Try comparing two pages (0.6.4 vs your commit) and you'll see the difference.

@danzel
Copy link
Member

danzel commented Nov 11, 2013

Weird, that makes no sense :(

@mourner
Copy link
Member

mourner commented Nov 11, 2013

That's the cruel reality with browsers, most of the issues are like that.

@danzel
Copy link
Member

danzel commented Nov 14, 2013

The css version caused gaps between tiles when zooming in chrome on windows desktop too by the looks.

@mourner
Copy link
Member

mourner commented Nov 14, 2013

@danzel the gaps still appear in Safari on OS X btw it seems. :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker Critical issue or PR that must be resolved before the next release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants