-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Content insets should be added when setting camera with custom edge padding #12818
Comments
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions. |
This is definitely still a bug. Nice try, stalebot. |
There is discrepancy in code and documentation between the methods, when it comes to interpretation of edgePadding/insets. Documentation "could" be interpreted as inline with the implementation - setVisiblecoordinates and "fitting" methods documentation uses wording "additional padding" while setcamera doesn't:
@param edgePadding The minimum padding (in screen points) that would be visible around the returned camera object if it were set as the receiver’s camera.
Changes the receiver’s viewport to fit all of the given coordinates and optionally some additional padding on each side. However, documentation doesn't specify additional to I would suggest changing the implementation so that: |
To me, the
Agreed. The current behavior is clearly a bug, but it has been present for a while, and some clients such as the iOS navigation SDK have been working around it. So can we make the change in place, or do we have to create new methods, deprecating the old ones, to get around semver requirements? |
Technically this is a bug. What happens if we treat it as such? and specify the proper functionality in the docs? We shouldn't have to wait for a semver to fix this problem nor complicate the api further. From a bug perspective (and even tho it has been this way for a while, and devs work around this issue) I'm in favor to release it as part of a "minor" version. cc @mapbox/maps-ios |
If we fix this bug, we need to fix it in time for v5.1.0 (release-oolong). That release will also include a significant change to vanishing point behavior (#14664), essentially a fix for an even older bug. The navigation SDK is currently working around both bugs. (mapbox/mapbox-navigation-ios#2134 tracks removing the vanishing point workaround.) The navigation SDK is pinning to v5.x of the map SDK. If the map SDK team commits to fixing this bug in v5.1.0, then I’ll modify today’s release of the navigation SDK to pin to v5.0.x, and we can relax the dependency the next time around once v5.1.0 is out. Otherwise, developers on a current version of the navigation SDK will wind up with a broken application when they routinely run |
Please ignore - it seems fine #15232 (comment) |
The
-[MGLMapView setCamera:withDuration:animationTimingFunction:edgePadding:completionHandler:]
method added in #9651 uses theedgePadding
parameter verbatim. By contrast,-setVisibleCoordinates:count:edgePadding:direction:duration:animationTimingFunction:completionHandler:
,-cameraThatFitsCoordinateBounds:edgePadding:
, and other camera-related methods all add theMGLMapView.contentInset
property to the passed-in edge padding:mapbox-gl-native/platform/ios/src/MGLMapView.mm
Line 3175 in 372611d
This inconsistency forces callers of
-setCamera:withDuration:animationTimingFunction:edgePadding:completionHandler:
to manually add the content insets./cc @frederoni @JThramer
The text was updated successfully, but these errors were encountered: