Skip to content

Commit

Permalink
Fix maplibre#27: navigation puck falls off route when panning
Browse files Browse the repository at this point in the history
The bug was especially noticeable when panning quickly or zooming in
while navigating.

The issue is that the upstream method signature changed in
76469a0c2227927f03a15fb95b3a20f34becc78c and then again in
8ad5f9c1fd58c60b93d26c2819637fd8f2144fd1, which first appeared in the
ios-v6.0.0 tag.

So our "overridden method" wasn't actually being called.

It's not the commit authors fault that it broke - this is a private
method we're calling.

A longer term fix might be to include some kind of public stable
delegate method rather than an override.
  • Loading branch information
michaelkirk committed Jun 3, 2024
1 parent 0c7a0f6 commit 5ea0910
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions MapboxNavigation/NavigationMapView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,9 @@ open class NavigationMapView: MLNMapView, UIGestureRecognizerDelegate {
super.anchorPoint(forGesture: gesture)
}
}
override open func mapViewDidFinishRenderingFrameFullyRendered(_ fullyRendered: Bool) {
super.mapViewDidFinishRenderingFrameFullyRendered(fullyRendered)

override open func mapViewDidFinishRenderingFrameFullyRendered(_ fullyRendered: Bool, frameEncodingTime: Double, frameRenderingTime: Double) {
super.mapViewDidFinishRenderingFrameFullyRendered(fullyRendered, frameEncodingTime: frameEncodingTime, frameRenderingTime: frameRenderingTime)

guard self.shouldPositionCourseViewFrameByFrame else { return }
guard let location = userLocationForCourseTracking else { return }
Expand Down
4 changes: 3 additions & 1 deletion MapboxNavigationObjc/MLNMapView+MLNNavigationAdditions.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

@interface MLNMapView (MLNNavigationAdditions)

- (void)mapViewDidFinishRenderingFrameFullyRendered:(BOOL)fullyRendered;
- (void)mapViewDidFinishRenderingFrameFullyRendered:(BOOL)fullyRendered
frameEncodingTime:(double)frameEncodingTime
frameRenderingTime:(double)frameRenderingTime;

@end

0 comments on commit 5ea0910

Please sign in to comment.