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

chore: updated MapLibre Native dependency to use the ios-v6.0.0 versi… #23

Merged
merged 3 commits into from
Feb 7, 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- Allow to customize rerouting logic by implementing RouteControllerDelegate#routeControllerGetDirections
- Add option to overwrite camera update via NavigationMapViewCourseTrackingDelegate#updateCamera
- Remove MapboxVoiceController and Mapbox Speech dependency. If you would like to use MapboxSpeech, you can copy the deleted MapboxVoiceController into your project.
- Updated MapLibre Native dependency to ios-v6.0.0 (https://github.com/maplibre/maplibre-native/releases/tag/ios-v6.0.0). Implementers need to change the prefix MGL to MLN for all MapLibre Native classes that are referenced.

## v2.0.0 (May 23, 2023)
- Upgrade minimum iOS version from 11.0 to 12.0.
Expand Down
2 changes: 1 addition & 1 deletion Examples/Objective-C/AppDelegate.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#import "AppDelegate.h"

@import Mapbox;
@import MapLibre;

@interface AppDelegate ()

Expand Down
14 changes: 6 additions & 8 deletions Examples/Objective-C/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14313.13.2" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.9"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand All @@ -21,10 +19,10 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="A3N-JT-loC" customClass="MGLMapView">
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="A3N-JT-loC" customClass="MLNMapView">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<subviews>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8Sl-bV-xyU">
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8Sl-bV-xyU">
<rect key="frame" x="132" y="615" width="111" height="30"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="0.75" colorSpace="calibratedRGB"/>
<state key="normal" title="Start Navigation"/>
Expand All @@ -33,7 +31,7 @@
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Long press map to select a route" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Hk0-SM-2Wl">
<rect key="frame" x="62" y="619" width="251" height="21"/>
<rect key="frame" x="63" y="619" width="249" height="21"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="0.75" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
Expand Down
8 changes: 4 additions & 4 deletions Examples/Objective-C/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
@import MapboxCoreNavigation;
@import MapboxDirections;
@import MapboxNavigation;
@import Mapbox;
@import MapLibre;

@interface ViewController () <AVSpeechSynthesizerDelegate>
@property (nonatomic, weak) IBOutlet MGLMapView *mapView;
@property (nonatomic, weak) IBOutlet MLNMapView *mapView;
@property (weak, nonatomic) IBOutlet UIButton *toggleNavigationButton;
@property (weak, nonatomic) IBOutlet UILabel *howToBeginLabel;
@property (nonatomic, assign) CLLocationCoordinate2D destination;
Expand All @@ -22,7 +22,7 @@ @implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
self.mapView.userTrackingMode = MGLUserTrackingModeFollow;
self.mapView.userTrackingMode = MLNUserTrackingModeFollow;

self.lengthFormatter = [[NSLengthFormatter alloc] init];
self.lengthFormatter.unitStyle = NSFormattingUnitStyleShort;
Expand Down Expand Up @@ -94,7 +94,7 @@ - (void)getRoute {
CLLocationCoordinate2D *routeCoordinates = malloc(route.coordinateCount * sizeof(CLLocationCoordinate2D));
[route getCoordinates:routeCoordinates];

MGLPolyline *polyline = [MGLPolyline polylineWithCoordinates:routeCoordinates count:route.coordinateCount];
MLNPolyline *polyline = [MLNPolyline polylineWithCoordinates:routeCoordinates count:route.coordinateCount];

[self.mapView addAnnotation:polyline];
[self.mapView setVisibleCoordinates:routeCoordinates count:route.coordinateCount edgePadding:UIEdgeInsetsZero animated:YES];
Expand Down
10 changes: 5 additions & 5 deletions Examples/Swift/CustomViewController.swift
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import UIKit
import MapboxCoreNavigation
import MapboxNavigation
import Mapbox
import MapLibre
import CoreLocation
import AVFoundation
import MapboxDirections
import Turf

class CustomViewController: UIViewController, MGLMapViewDelegate {
class CustomViewController: UIViewController, MLNMapViewDelegate {

var destination: MGLPointAnnotation!
var destination: MLNPointAnnotation!
let directions = Directions.shared
var routeController: RouteController!
var simulateLocation = false
Expand Down Expand Up @@ -69,7 +69,7 @@ class CustomViewController: UIViewController, MGLMapViewDelegate {
NotificationCenter.default.removeObserver(self, name: .routeControllerDidPassVisualInstructionPoint, object: nil)
}

func mapView(_ mapView: MGLMapView, didFinishLoading style: MGLStyle) {
func mapView(_ mapView: MLNMapView, didFinishLoading style: MLNStyle) {
self.mapView.showRoutes([routeController.routeProgress.route])
}

Expand Down Expand Up @@ -167,7 +167,7 @@ extension CustomViewController: NavigationMapViewCourseTrackingDelegate {

func updateCamera(_ mapView: NavigationMapView, location: CLLocation, routeProgress: RouteProgress) -> Bool{

let newCamera = MGLMapCamera(lookingAtCenter: location.coordinate, acrossDistance: 750, pitch: 5, heading: location.course)
let newCamera = MLNMapCamera(lookingAtCenter: location.coordinate, acrossDistance: 750, pitch: 5, heading: location.course)
let function: CAMediaTimingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.linear)
mapView.setCamera(newCamera, withDuration: 1, animationTimingFunction: function, edgePadding: UIEdgeInsets.zero, completionHandler: nil)

Expand Down
9 changes: 5 additions & 4 deletions Examples/Swift/ViewController.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import UIKit
import MapLibre
import MapboxCoreNavigation
import MapboxNavigation
import MapboxDirections
Expand All @@ -9,7 +10,7 @@ private typealias RouteRequestSuccess = (([Route]) -> Void)
private typealias RouteRequestFailure = ((NSError) -> Void)


class ViewController: UIViewController, MGLMapViewDelegate {
class ViewController: UIViewController, MLNMapViewDelegate {

// MARK: - IBOutlets
@IBOutlet weak var longPressHintView: UIView!
Expand Down Expand Up @@ -229,7 +230,7 @@ class ViewController: UIViewController, MGLMapViewDelegate {

customViewController.userRoute = route

let destination = MGLPointAnnotation()
let destination = MLNPointAnnotation()
destination.coordinate = route.coordinates!.last!
customViewController.destination = destination
customViewController.simulateLocation = simulationButton.isSelected
Expand Down Expand Up @@ -274,11 +275,11 @@ class ViewController: UIViewController, MGLMapViewDelegate {
mapView.addGestureRecognizer(singleTap)
}

func mapView(_ mapView: MGLMapView, didFinishLoading style: MGLStyle) {
func mapView(_ mapView: MLNMapView, didFinishLoading style: MLNStyle) {
self.mapView?.localizeLabels()

if let routes = routes, let currentRoute = routes.first, let coords = currentRoute.coordinates {
mapView.setVisibleCoordinateBounds(MGLPolygon(coordinates: coords, count: currentRoute.coordinateCount).overlayBounds, animated: false)
mapView.setVisibleCoordinateBounds(MLNPolygon(coordinates: coords, count: currentRoute.coordinateCount).overlayBounds, animated: false)
self.mapView?.showRoutes(routes)
self.mapView?.showWaypoints(currentRoute)
}
Expand Down
2 changes: 1 addition & 1 deletion MapboxCoreNavigationTests/BridgingTests.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#import <XCTest/XCTest.h>
#import "MapboxCoreNavigationTests-Swift.h"
@import Mapbox;
@import MapLibre;
@import MapboxCoreNavigation;
@import MapboxDirections;

Expand Down
Loading
Loading