-
Notifications
You must be signed in to change notification settings - Fork 805
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
Map Block: Persist Center Point #14417
Conversation
…en map loads. allows centering the map without adding any pins.
Caution: This PR has changes that must be merged to WordPress.com |
This is an automated check which relies on |
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.
This works great and is an awesome improvement over the previous behaviour!
I've left a couple of minor comments, but the PR is pretty much good to go! ✨
jeffersonrabb, Your synced wpcom patch D37943-code has been updated. |
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.
This tests well for me! 🚢
r202023-wpcom |
* [not verified] Remove empty readme section * Initial changelog for 8.2 * Changelog: add #14220 * Changelog: add #14252 * Changelog: add #14291 * Changelog: add #14309 * Changelog: add #14304 * Changelog: add general connection log. * Changelog: add #14275 * Changelog: add #14313 * Changelog: add #14213 * Changelog: add #14357 * Add sync testing instructions * Add 8.1.1 changelog back See eeaafab and 61757eb * Changelog: add #14371 * Changelog: add #14386 * Changelog: add #14471 * Changelog: add #14325 * Changelog: add #14194 * Changelog: add #14340 * Changelog: add #14418 * Changelog: add #14417 * Changelog: add #14075 * Changelog: add #14467 * Changelog: add #14307 * Changelog: add #14326
Changes proposed in this Pull Request:
This PR makes a few changes to the calculation and persistence of the Map block center point. The block determines the center point based on the map points that have been set. When the block initializes, the map "travels" to correct position and zoom, which causes a dramatic and unnecessary animation. This PR persists the true center point of the map, allowing the map to initialize in that position, avoiding the animation.
This PR also adds a bonus feature: in a map with no points defined, the editor can determine the center point by dragging, and this position will be respected when the map renders.
If any points have been chosen, dragging is disabled. This is done to avoid the false expectation that the new position will be respected, since the block will replace it with the calculated center point based on the available points.
Based on Automattic/wp-calypso#28811.
Testing instructions:
master
, add three Map blocks to a page with 0 points, 1 point, and 2 points.fix/map-block-center-point
, verify that the blocks remain valid and work as expected.