Skip to content
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

Cleanup: remove private header #95

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions MapboxNavigation/NavigationMapView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,7 @@
}
}

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

func updateCourseTrackingAfterDidFinishRenderingFrame() {
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the reason for removing the override and then calling this from elsewhere? For me the override function is more logical

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's so that we don't accidentally break the puck animation again, like what I fixed in #53.

I tried to explain the reasoning in this issue description — the method we were overriding was a private method. I patched it up in #53, but because it's still a private method it could break again. #53 has some more details which might be helpful for context.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it, thanks for linking the PR, helps a lot to understand.

guard self.shouldPositionCourseViewFrameByFrame else { return }
guard let location = userLocationForCourseTracking else { return }

Expand Down Expand Up @@ -751,7 +749,7 @@
}
}

// TODO: Change to point-based distance calculation

Check warning on line 752 in MapboxNavigation/NavigationMapView.swift

View workflow job for this annotation

GitHub Actions / Code Style

TODOs should be resolved (Change to point-based distance...) (todo)
private func waypoints(on routes: [Route], closeTo point: CGPoint) -> [Waypoint]? {
let tapCoordinate = convert(point, toCoordinateFrom: self)
let multipointRoutes = routes.filter { $0.routeOptions.waypoints.count >= 3 }
Expand Down
4 changes: 4 additions & 0 deletions MapboxNavigation/RouteMapViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
self.init()
self.routeController = routeController
self.delegate = delegate
self.automaticallyAdjustsScrollViewInsets = false

Check warning on line 137 in MapboxNavigation/RouteMapViewController.swift

View workflow job for this annotation

GitHub Actions / Build and Test

'automaticallyAdjustsScrollViewInsets' was deprecated in iOS 11.0: Use UIScrollView's contentInsetAdjustmentBehavior instead
}

deinit {
Expand Down Expand Up @@ -582,6 +582,10 @@
self.delegate?.mapViewDidFinishLoadingMap?(mapView)
}

func mapViewDidFinishRenderingFrame(_ mapView: MLNMapView, fullyRendered: Bool) {
self.mapView.updateCourseTrackingAfterDidFinishRenderingFrame()
}

// MARK: - VisualInstructionDelegate

func label(_ label: InstructionLabel, willPresent instruction: VisualInstruction, as presented: NSAttributedString) -> NSAttributedString? {
Expand Down
9 changes: 0 additions & 9 deletions MapboxNavigationObjc/MLNMapView+MLNNavigationAdditions.h

This file was deleted.

8 changes: 0 additions & 8 deletions MapboxNavigationObjc/MLNMapView+MLNNavigationAdditions.m

This file was deleted.

2 changes: 1 addition & 1 deletion MapboxNavigationObjc/include/MapboxNavigation.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ FOUNDATION_EXPORT double MapboxNavigationVersionNumber;
FOUNDATION_EXPORT const unsigned char MapboxNavigationVersionString[];

#import "../MBRouteVoiceController.h"
#import "../MLNMapView+MLNNavigationAdditions.h"
#import <MapLibre/Mapbox.h>
michaelkirk marked this conversation as resolved.
Show resolved Hide resolved
Loading