Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Add padding to MGLMapCamera #323

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mfazekas
Copy link

@mfazekas mfazekas commented Jun 19, 2020

<changelog>Fixed assymetric edgePadding in MGMapView.camera:....</changelog>

Fixes: #198

mapbox-gl-native changed how cameraForLatLngs handles edgePadding. Before #16067 the edgePadding caused the center of CameraOptions to be changed. After
#16067 the padding in CameraOptions was used.

The MGLMapCamera in iOS layer did not have a padding and therefore in 5.7.0 and later this padding got lost.

This PR adds a padding to MGLMapCamera and also adjust conversion between CameraOptions and MGLMapCamera to use this padding.

@maxmamis
Copy link

Can anyone give an update on what's blocking this PR? Would love to see it get merged!

@@ -4045,6 +4052,9 @@ - (MGLMapCamera *)cameraForCameraOptions:(const mbgl::CameraOptions &)cameraOpti
{
options.pitch = camera.pitch;
}
if (! MGLEdgeInsetsEqual(camera.padding, MGLEdgeInsetsZero)) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is correct, as there is edgePadding as argument as well as in padding in MGLMapCamera. The padding in MGLMapCamera overwrites the param here.

@hunterlindsay
Copy link

This bug is currently preventing us from updating our app past Mapbox 5.6.0 (iOS), waiting on this fix to be merged in order to do so.

@Alaa-Ben
Copy link

Any news on this ? I'm blocked by this one too

@Ferylouk
Copy link

👍

@india2sarthak
Copy link

@1ec5 @julianrex Any updates on this? It's still broken in 6.2.0.

@Ogerets
Copy link

Ogerets commented Mar 18, 2021

Also waiting for this to get merged

@ts95
Copy link

ts95 commented May 6, 2021

Is there any particular reason why this hasn't been merged almost a year after the PR was submitted? This is a rather glaring bug in my book and it's actively preventing me from properly implementing essential features. I implore the maintainers to please review this PR

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MGLMapCamera doesn't respect edgePadding on SDK 5.6.0+
8 participants