Conversation
DEFAULT_SETTINGS.maxBounds was [-180, -85.051129, 180, 85.051129], a 360-degree longitude span that triggers the singular projection matrix crash in maplibre-gl-js#6148 when _updateSettings restores it after the prop is removed. null clears the constraint, matching the library default of no bounds. Fixes visgl#2591
Omitting the prop is the _updateSettings fallback that previously called setMaxBounds with a 360° world span.
cpruijsen
force-pushed
the
fix/issue-2591
branch
from
September 14, 2026 14:34
25209d4 to
d1096aa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DEFAULT_SETTINGS.maxBoundswas[-180, -85.051129, 180, 85.051129], a full 360 degree longitudespan. When a controlled
maxBoundsprop is removed,_updateSettingsfalls back to that default andcalls
setMaxBoundswith it, and a bound that wide makes maplibre-gl-js compute a singular matrixand crash (maplibre-gl-js#6148). Passing no
maxBoundsat all is fine; it is the fallback thatinstalls the bad value, so the crash only appears after a prop goes away.
This changes the default to
nullin bothmodules/react-maplibre/src/maplibre/maplibre.tsandmodules/react-mapbox/src/mapbox/mapbox.ts, so the fallback clears the constraint rather thaninstalling a whole-world one. Both modules carry the identical fallback, which is why both are
changed together.
Filed here rather than on
visgl/react-maplibre, which is archived and points back to this repo.Fixes #2591