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

The mini map shows the wrong area after fullscreen #131

Open
ringoswy opened this issue Sep 22, 2017 · 7 comments
Open

The mini map shows the wrong area after fullscreen #131

ringoswy opened this issue Sep 22, 2017 · 7 comments

Comments

@ringoswy
Copy link

I use http://brunob.github.com/leaflet.fullscreen/ to add the fullscreen feature on my map.

When minimize the mini map, and set the page to full screen, the mini map shows the wrong area after restore the mini map again.

@tcoupin
Copy link

tcoupin commented Oct 3, 2017

Same issue today.

@robpvn
Copy link
Contributor

robpvn commented Oct 3, 2017

Well, this sounds like some sort of bug in the interaction between the two plugins, probably that the fullscreen plugin doesn't fire some event that the minimap is waiting for to reorient itself. I assume it fixes itself if you move the main map around in fullscreen?

@tcoupin
Copy link

tcoupin commented Oct 3, 2017

No :(

@robpvn
Copy link
Contributor

robpvn commented Oct 3, 2017

That sounds more difficult to fix; without having looked at the code for the other plugin I'm guessing that it somehow swaps out the map object the the minimap is listening to for changes. Any chance you could make a quick JSFiddle or similar that reproduces the problem?

@ringoswy
Copy link
Author

Hi robpvn,

Here is the JSFiddle https://jsfiddle.net/ringoswy/tLd1vqnc/

Thanks a lot~

@robpvn
Copy link
Contributor

robpvn commented Nov 9, 2017

Wow, that's some interesting breakage - the minimap still tracks the main map, just offset with whatever distance there is between what it was looking at before being minmised.

@ReneHRich
Copy link

If anyone is still struggling with this issue in 2022, this will reset the minimap after restoring the minimap from the minimized state.

mainMap is your main map
miniMap is the minimap control

        mainMap.on('resize', function(e) {
            miniMap.once('restore', function () {
                miniMap._miniMap.invalidateSize();
            })
        });

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

4 participants