Skip to content

Commit

Permalink
Cleanup: remove private header
Browse files Browse the repository at this point in the history
This header was copied in from MapLibre Native to expose a private
method.

Previously this got out of sync and caused a bug:
#53

Instead we can use the already public delegate method.

Note: The deleted header was importing Maplibre/Mapbox.h, but we are
using that elsewhere, so I moved that import up a level.
  • Loading branch information
michaelkirk committed Aug 20, 2024
1 parent e4dfc50 commit 5aa57b5
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 21 deletions.
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 @@ open class NavigationMapView: MLNMapView, UIGestureRecognizerDelegate {
}
}

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

func updateCourseTrackingAfterDidFinishRenderingFrame() {
guard self.shouldPositionCourseViewFrameByFrame else { return }
guard let location = userLocationForCourseTracking else { return }

Expand Down
4 changes: 4 additions & 0 deletions MapboxNavigation/RouteMapViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,10 @@ extension RouteMapViewController: NavigationViewDelegate {
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>

0 comments on commit 5aa57b5

Please sign in to comment.