Make resetBoundsOnResize preserve center when full-screened#482
Make resetBoundsOnResize preserve center when full-screened#482itsmichaeldiego merged 9 commits intogoogle-map-react:masterfrom
resetBoundsOnResize preserve center when full-screened#482Conversation
adding note about `resetBoundsOnResize` to readme (google-map-react#307)
itsmichaeldiego
left a comment
There was a problem hiding this comment.
Thanks for your PR! It is looking good, I left a comment that is more like a question
src/google_map.js
Outdated
| mapDom.removeEventListener('mousedown', this._onMapMouseDownNative, true); | ||
| window.removeEventListener('mouseup', this._onChildMouseUp, false); | ||
| if (this.props.resetBoundsOnResize) { | ||
| if (this.props.resetBoundsOnResize || this.props.lockCenter) { |
There was a problem hiding this comment.
Wondering if || this.props.lockCenter is really needed, as resetBoundsOnResize should be set to true if we want to lock the center, not sure if I am explaining myself, but I believe the map always should re-set the center when reseting the bounds on resize.
There was a problem hiding this comment.
Hmm, I think I see what you're saying. I hadn't used resetBoundsOnResize before, but I just tried it out on the master branch and on this PR's branch by running yarn start and visiting http://localhost:4000/resizable. On both branches, resizing by dragging the lower- the map keeps the map centered, but only with this PR does clicking the fullscreen button also keep the map centered. I think it makes sense for resetBoundsOnResize to include the lockCenter behavior, so I removed the lockCenter stuff while keeping the behavioral changes. See 692e15b
lockCenter prop to preserve center on resizeresetBoundsOnResize preserve center when full-screened
e9de437 to
692e15b
Compare
|
@josephfrazier Just to confirm, did you test latest changes? Could you upload something? |
|
Yes, I verified the fix as outlined above, by running |
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This supersedes and resolves #308,
as specified in #308 (comment)