-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 canvas sizing broken when contained in a transform scale container in v2.5.0 #11085
Comments
Might be introduced by #10936 |
Confirmed that this is caused by #10936, this occurs after that PR was merged but not before. |
@SnailBones .getBoundingClientRect() replaced clientWidth and clientHeight in favor of getting more precise calculations. However, .getBoundingClientRect() takes in CSS transforms before returning its values. Replacing getBoundingClientRect here to clientWidth and clientHeight or offsetWidth and offsetHeight would fix the transform issue. |
Thank you for reporting this issue and working on a fix. It's very convenient to be able to apply |
@avpeery any idea when this will be released? Feels like this should be cherry-picked into a 2.6.2 release (and 2.5.2) |
I also am wondering when we might be able to see this fixed. Thank you. |
@treehousetim @felix-ht @chrisgervang @jrohland
The fix is included in the recent 2.7.0 release! |
@avpeery I just tried out 2.7.0 and while it looks like the sizing is fixed when using a single container with a transform: scale() style, I'm still seeing sizing issues when scaling is used in conjunction with transform: translate(). We have a use case where we have an outer container which is scaled down and our map container is positioned via translate(). I have created a jsfiddle using 2.7.0 to showcase this bug. https://jsfiddle.net/jesserohland/40kzeg7x/2/ This use case was previous working with 2.4.1 as visible here: https://jsfiddle.net/jesserohland/40kzeg7x/1/ Thanks for the initial fix! |
@ryanhamley @avpeery Should I open up a new issue to track this since this original issue was resolved? |
I opened a new bug ticket #11492 |
After updating to v2.5.0 we've noticed that maps we have contained inside of a container that has a transform scale css set are no longer updating their canvas height and width to fill the container size properly.
mapbox-gl-js version: 2.5.0
browser: Firefox
Steps to Trigger Behavior
Link to Demonstration
I've created a jsfiddle to showcase this issue: https://jsfiddle.net/jesserohland/hLkoys52/5/
This is a regression from v2.4.1 where this previously worked. https://jsfiddle.net/jesserohland/hLkoys52/6/
The text was updated successfully, but these errors were encountered: