Repository navigation
Added a 'wrapAroundWorld' option to the mapboxgl.Map constructor - #3885
Conversation
If `false`, only one copy of the world will be rendered, when zoomed out.
| roundZoom: this._source.roundZoom, | ||
| reparseOverscaled: this._source.reparseOverscaled | ||
| reparseOverscaled: this._source.reparseOverscaled, | ||
| wrapAroundWorld: this.style ? this.style.wrapAroundWorld : true |
There was a problem hiding this comment.
Can wrapAroundWorld be a property on transform (the update method parameter), so that Style doesn't have to be involved?
There was a problem hiding this comment.
Yep! That's much nicer. I'll update it.
There was a problem hiding this comment.
@jfirebaugh I've updated it -- let me know if this looks good now.
… down through the style
|
@jfirebaugh Is this good to merge now? |
|
The implementation looks good. Before merging I want to brainstorm a few other options for naming in hopes that we can find something more precise and self-descriptive than
|
|
Looks good! I can see two big picture items before we 🚢 this. Todo before merging
|
|
I think it makes more sense as a global option. I like |
|
Looks like render tests in mapbox-gl-test-suite are currently setup to just use a style.json, and pass selected data through to the map constructor via style.metadata. To support renderWrappedWorlds (which is a map constructor option), we'd have to add a renderWrappedWorlds option to style.metadata and make suite_implementation.js handle it. Let me know if you're good to go on the name and I can add in a render test. |
|
I think If you rename to |
|
@jfirebaugh Ok cool! That makes sense. I've renamed it to renderWorldCopies. |
|
Hi Guys, With this new render option, is it possible to expose an API to toggle this behaviour opposed to re-instantiating the map? Or is it necessary? I can see some problems where the lnglat of the current camera our out of bounds due to world wrapping. Just looking at adding this function to our react library react-map-gl-alt but a goal of the project is to be able to configure the map through external exposed props - which means that the developer would have the option to toggle. Thanks guys! |
|
Tried using |
|
hmm @huaruiwu that sounds like a bug -- do you want to open a fresh ticket to report? |
|
@mollymerp Sure! #4449 |
If
wrapAroundWorldis set tofalse, then only one copy of the world will be rendered, when zoomed out. This solves issue #3785.