Repository navigation
Conversation
fabian-guerra
left a comment
There was a problem hiding this comment.
I made a minor comment. Just make sure everything works correctly in:
cameraThatFitsShape:direction:edgePadding:
| } | ||
|
|
||
| - (MGLMapCamera *)cameraThatFitsShape:(MGLShape *)shape direction:(CLLocationDirection)direction edgePadding:(UIEdgeInsets)insets { | ||
| return [self cameraThatFitsShape:shape direction:direction pitch:0 edgePadding:insets]; |
There was a problem hiding this comment.
I may be wrong but if you pass 0 in this method it will ignore the current transformation state and calculate a 0 based pitch. Could you please test and confirm that this is not the case.
There was a problem hiding this comment.
That would be true. I'll fix that
| padding += MGLEdgeInsetsFromNSEdgeInsets(self.contentInsets); | ||
|
|
||
| mbgl::CameraOptions cameraOptions = _mbglMap->cameraForGeometry([shape geometryObject], padding, direction); | ||
| return [self cameraThatFitsShape:shape direction:direction pitch:0 edgePadding:insets]; |
There was a problem hiding this comment.
Same as above:
I may be wrong but if you pass
0in this method it will ignore the current transformation state and calculate a 0 based pitch. Could you please test and confirm that this is not the case.
|
@fabian-guerra Thanks for catching those issues. I've updated the files. |
1ec5
left a comment
There was a problem hiding this comment.
Before this PR can be merged, I think there would need to be a test or at least screenshots demonstrating that the returned camera actually fits the given shape snugly. I don’t see how this method accomplishes that task given that #2259 is still outstanding.
|
@1ec5 This will behave the same way as the current |
|
So... there's already a method called |
|
Aha! I thought I remembered @bsudekum implemented that but couldn’t find #12213 for some reason. Thanks for digging it up. If I recall correctly, we gave it that awkward name in part because it doesn’t necessarily fit all the parameters that are passed in – it just tries to fit as many as possible. We felt that #2259 wouldn’t be a blocker because it makes no guarantees about actually fitting anything precisely. It sounds like this PR is unnecessary given #12213. |
|
Closed in favor of using the existing |
Fixes #13005
The current implementation uses the current pitch of the map to calculate the altitude. This addition allows for getting the proper altitude of the camera for an upcoming pitch change which allows for a smooth animation to the new pitch and altitude.
/cc @1ec5 @fabian-guerra @friedbunny @julianrex