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

Wrapping around globe - Missing Popup #2780

Closed
stackTom opened this issue Jun 23, 2016 · 3 comments
Closed

Wrapping around globe - Missing Popup #2780

stackTom opened this issue Jun 23, 2016 · 3 comments

Comments

@stackTom
Copy link

mapbox-gl-js version:

Steps to Trigger Behavior

  1. create a popup
  2. pan the map around the world, until you are back at the starting position
  3. the popup is gone, until you pan back around the world an equal number of times in the opposite direction

Expected Behavior

Popup remains on map

Actual Behavior

Popup disappears until one "undos" the panning around the world by panning in the opposite direction.

The above causes issues with my popups after I use the flyTo method. Is this by design, or is this a bug?

@indus
Copy link
Contributor

indus commented Jun 23, 2016

@stackTom what I did to make this less annoying, is to reset the map after a move, like so

map.on('moveend', (evt) => {
  var cntr = map.getCenter();
  if (cntr.lng < -180 || cntr.lng > 180)
    map.setCenter([(cntr.lng + 540) % 360 - 180, cntr.lat]);
})

it is not a real fix but helps with

until you pan back around the world an equal number of times in the opposite direction

@stackTom
Copy link
Author

I will have to use that fix until this is fixed in mapbox gl. Is this confirmed to be a bug? I will leave this open in case it is, but someone with greater knowledge feel free to close it if it's not a bug.

@jfirebaugh
Copy link
Contributor

Duplicate of #2071.

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