-
Notifications
You must be signed in to change notification settings - Fork 15.4k
feat(legacy-plugin-chart-map-box): Add fixed initial viewport settings option #26736
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
base: master
Are you sure you want to change the base?
feat(legacy-plugin-chart-map-box): Add fixed initial viewport settings option #26736
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last commit fixes an issue where the plots do not load until the map is dragged. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #26736 +/- ##
==========================================
+ Coverage 69.07% 69.62% +0.54%
==========================================
Files 1930 1909 -21
Lines 75279 74770 -509
Branches 8429 8350 -79
==========================================
+ Hits 51999 52058 +59
+ Misses 21133 20661 -472
+ Partials 2147 2051 -96
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jseparovic, thank you for your contribution to the mapbox options. I've left some comments on the PR that might be of assistance. Your efforts are greatly appreciated!
superset-frontend/plugins/legacy-plugin-chart-map-box/src/MapBox.jsx
Outdated
Show resolved
Hide resolved
superset-frontend/plugins/legacy-plugin-chart-map-box/src/MapBox.jsx
Outdated
Show resolved
Hide resolved
superset-frontend/plugins/legacy-plugin-chart-map-box/src/MapBox.jsx
Outdated
Show resolved
Hide resolved
superset-frontend/plugins/legacy-plugin-chart-map-box/src/MapBox.jsx
Outdated
Show resolved
Hide resolved
…ox.jsx Co-authored-by: JUST.in DO IT <[email protected]>
…ox.jsx Co-authored-by: JUST.in DO IT <[email protected]>
…ox.jsx Co-authored-by: JUST.in DO IT <[email protected]>
@justinpark Thanks for the review! I updated the PR to use useMemo as per your suggestion, but unfortunately it broke the fix for when the plots do not load until the map is dragged. The latest commit I pushed shows the working code where i added |
This reverts commit c1a28d1.
a8ad9b8
to
9433499
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks OK to me, but might like a second pair of eyes from @michael-s-molina who is uniquely aware of the risks of upgrading/migrating form data schemas from version to version.
@jseparovic I think this just needs the [precommit hooks] run - one of the linters (prettier, specifically) is not happy with the changelog file. |
Marking this as draft until it can be made mergeable via pre-commit fixes and a rebase. Please feel free to mark it as ready for review when it's lookin' good, otherwise it may be closed in time if it doesn't get any love. |
SUMMARY
It's currently not possible to fix the initial map box view. The current settings are not used when setting up the initial view.
The initial is auto calculated from bounds, and in some cases doesn't seem to place all the points on the screen.
This PR adds a drop down to enable a "fixed" initial view option which will use the user entered settings as the initial view instead of the calculation from bounds.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
By default, the MapBox chart will still auto calculate the initial view from the bounds.
To test the fixed option, set the Initial Viewport settings dropdown to fixed and update the default lat/long/zoom
ADDITIONAL INFORMATION
Fixes Cannot set default latitude/longitude in MapBox chart #17269