-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
By default, snap back to "w=0" world after panning operation (i.e. "worldCopyJump") #2071
Comments
Only |
I think the only issue with that would be that it precludes setting |
I think |
Duplicate of #2879 |
worldCopyJump
option
I preferred the old implementation proposal, "Create Leaflet-like |
Ah! I misunderstood the behaviour of |
This feature is easy to implement downstream. Perhaps so easy we need not include it in core. map.on('moveend', function() {
map.setCenter(map.getCenter().wrap());
}); cc @geografa |
Any ideas with this? I have been striuggling to accomplish the same behavior as described in this thread. |
@jjb867 Did you try the code snippet from #2071 (comment)? |
Sorry but I'm not sure what you are referring to specifically. I have a 'zoomend' event that I'm using to trigger a popup after flying to a location. The basic idea is displaying fake transactions around the world in a popup. The popup is displayed properly unless I'm displaying one in Hong Kong for example, it appears in Hong Kong, but in one world to the right of where I need it. I tried
inside my zoomend function which does work but it creates a flash and a jarring user experience. Is this what you are referring to? |
Yes. Can you create a JSFiddle that shows the issue you're talking about with that approach? |
Actually just got it to work to my liking using the above snippet inside of 'zoomend' (no flash, no issue), thanks for pointing out that snippet for a second time! |
This line actually does work to bring the map to the world copy which the popup is rendered. Since the map needs to instantly be re-rendered it DOES create a quick flash which is less than desirable. I would create an example but I have too many php datapoints being read onto the page. This works for now but it would be nice to have an option to either have the popup render on ALL world copies, or only limit the world to one instance. |
I found this creates an infinite loop and needed something like
I still notice though that the second world does flash white for a fraction of a second on the moveend when the map.setCenter moves back to world zero. |
Hi guys, Inspired by the code you provided. Newbie here. I think I found a way to address the I need to fly from locations in Asia to USA, but problem is that the So the solution is to add a mechanism to calculate if the 2 locations are in different semi-sphere. If yes, then that will be the longer rough, which Here is my code, hope it is useful to you guys:D
A bump of this solution is the animation is not as smooth as directly Let me know where I can improve:D |
I've submitted #4451 which will ensure a flyTo always stays in world 0. Are there any cases where you wouldn't want this to happen? Since I haven't implemented an option for it.
This still leaves:
|
Because certain methods like
flyTo
send the user on to world copies, it would be great if there were an option to duplicate data/overlays to the other world copies as well.The text was updated successfully, but these errors were encountered: