Repository navigation
fix: fetch sandbox editor map data in z18 tiles to avoid OSM API node… - #184
Merged
Merged
Conversation
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.
What type of PR is this? (check all applicable)
Describe this PR
The @osm-sandbox/sandbox-id editor hardcodes its data-fetch tile size to zoom 16 (_tileZoom = 16), so every /api/0.6/map.json request covers a single ~605m-wide z16 tile. In densely mapped sandbox areas (e.g. the seagrass project), one z16 tile exceeds the OSM API's 50,000-node limit and requests fail with 400 "You requested too many nodes" and features never load in the editor.
This PR calls the editor's public runtime setter connection().tileZoom(18) immediately after connection().switch(...) in sandboxEditor.js. Data is then fetched in z18 tiles (1/16th the area of the default z16), keeping per-request node counts under the 50k limit.
No viewport/extent changes and no changes to the regular (non-sandbox) OSM editor.
Result: When opening a sandbox task, /api/0.6/map.json requests now use bbox widths of ~0.00137° (360/2¹⁸) instead of ~0.00549° (360/2¹⁶) and return 200.