Leaflet / Leaflet.fullscreen

A fullscreen control for Leaflet
http://leaflet.github.io/Leaflet.fullscreen/
ISC License
436 stars 117 forks source link

Leaflet 1.0-rc1. After escaping full screen all layers invisible #53

Closed pszafer closed 7 years ago

pszafer commented 8 years ago

Hello, Issue only occurs with Chrome/Chromium. I don't know if this is my bug, plugin bug or leaflet bug. I have map with fullscreen plugin and geojson layers added.

When I escaping from fullscreen I have gray bar in the bottom of the map and all layers not visible. After resizing web browser window everything is ok. This is normal view: zrzut ekranu z 2016-07-07 21-56-57

This is fullscreen: zrzut ekranu z 2016-07-07 21-57-14

This is after escaping from fullscreen: zrzut ekranu z 2016-07-07 21-57-21

When I resize window, everything is ok.

Can you help me with that? Maybe there is some function that I can invoke in javascript so chrome will rerender window...

yohanboniface commented 8 years ago

Try calling map.invalidateSize. And try setting up a fiddle in http://playground-leaflet.rhcloud.com/ that reproduce the issue without any other plugin nor framework.

pszafer commented 8 years ago

Hello, Thanks for your help. I cannot reproduce this in playground, so this is propably my bug :/

after escaping fullscreen I call invalidateSize:

  map.on('fullscreenchange', function () {
  if (!map.isFullscreen()) {
        map.invalidateSize();
    }});

You can close issue or if you want to make sure by yourself that everything is ok and this is my bug I can publish this today evening (in ~10-14 hours). @yohanboniface Edit: If you want to see site: http://velomelon.com/our-route/

a1an77 commented 8 years ago

I have the same issue, which can be reproduced with the demo site: http://leaflet.github.io/Leaflet.fullscreen/

If the layer do not disappear by themselves, it is sufficient to pan the map up to show tiles in the South direction. Below a certain point no more tiles are loaded.

Confirmed on Chrome Not happening in FF and IE

a1an77 commented 8 years ago

The invalidateSize workaround seems to work but with the really ugly effect of briefly showing a zero-height map, which in turn, briefly messes up the page layout.

jfirebaugh commented 7 years ago

Should be fixed by #61.