Skip to content

Commit

Permalink
Merge branch 'maplibre:main' into user-puck-positioning
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick-Kladek authored Jul 14, 2024
2 parents 62f8f45 + be19416 commit 089dfb9
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 34 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ jobs:
uses: actions/checkout@v4

- name: Build
run: set -o pipefail && xcodebuild build -scheme maplibre-navigation-ios -destination 'platform=iOS Simulator,OS=17.0.1,name=iPhone 15 Pro' | xcbeautify --renderer github-actions
run: set -o pipefail && xcodebuild build -scheme maplibre-navigation-ios -destination 'generic/platform=iOS' | xcbeautify --renderer github-actions

- name: Test
run: set -o pipefail && xcodebuild test -scheme maplibre-navigation-ios -destination 'platform=iOS Simulator,OS=17.0.1,name=iPhone 15 Pro' | xcbeautify --renderer github-actions
run: set -o pipefail && xcodebuild test -scheme maplibre-navigation-ios -destination 'platform=iOS Simulator,OS=17.0.1,name=iPhone 15 Pro' | xcbeautify --renderer github-actions

- name: Build Example Project
run: set -o pipefail && xcodebuild build -project Example/Example.xcodeproj -scheme Example -destination 'generic/platform=iOS' CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY="" | xcbeautify --renderer github-actions
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/* Inform developer an update is available */
/* Inform developer an update is available */
"UPDATE_AVAILABLE" = "Mapbox Navigation SDK for iOS version %@ is now available.";

6 changes: 2 additions & 4 deletions MapboxNavigation/NavigationViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -435,10 +435,8 @@ open class NavigationViewController: UIViewController {

// MARK: - NavigationViewController

public func startNavigation(with route: Route, animated: Bool, routeController: RouteController? = nil, locationManager: NavigationLocationManager? = nil) {
if let locationManager {
self.locationManager = locationManager
}
public func startNavigation(with route: Route, animated: Bool, routeController: RouteController? = nil, locationManager: NavigationLocationManager = NavigationLocationManager()) {
self.locationManager = locationManager
if let routeController {
self.routeController = routeController
}
Expand Down
15 changes: 0 additions & 15 deletions MapboxNavigation/Resources/Base.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,12 @@
/* Name of the waypoint associated with the current location */
"CARPLAY_CURRENT_LOCATION" = "Current Location";

/* Title for dismiss button */
"CARPLAY_DISMISS" = "Dismiss";

/* Title for end navigation button */
"CARPLAY_END" = "End";

/* Title on the exit button in the arrival form */
"CARPLAY_EXIT_NAVIGATION" = "Exit navigation";

/* Title for feedback template in CarPlay */
"CARPLAY_FEEDBACK" = "Feedback";

/* Title for start button in CPTripPreviewTextConfiguration */
"CARPLAY_GO" = "Go";

Expand Down Expand Up @@ -52,9 +46,6 @@
/* Title in search template when search is unimplemented */
"CARPLAY_SEARCH_NOT_IMPLEMENTED" = "Search not implemented";

/* Alert title that shows when feedback has been submitted */
"CARPLAY_SUBMITTED_FEEDBACK" = "Submitted";

/* Title for unmute button */
"CARPLAY_UNMUTE" = "Unmute";

Expand All @@ -73,9 +64,6 @@
/* Comment Placeholder Text */
"END_OF_ROUTE_TITLE" = "How can we improve?";

/* Error message when the SDK is unable to read a spoken instruction. */
"FAILED_INSTRUCTION" = "Unable to read instruction aloud.";

/* Indicates a faster route was found */
"FASTER_ROUTE_FOUND" = "Faster Route Found";

Expand Down Expand Up @@ -106,9 +94,6 @@
/* Message confirming that the user has successfully sent feedback */
"FEEDBACK_THANK_YOU" = "Thank you for your report!";

/* Title of view controller for sending feedback */
"FEEDBACK_TITLE" = "Report Problem";

/* Format for displaying the first two major ways */
"LEG_MAJOR_WAYS_FORMAT" = "%1$@ and %2$@";

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ All issues are covered with this SDK.
- Transitioned from the [Mapbox SDK](https://github.com/mapbox/mapbox-gl-native-ios) (version 4.3) to [Maplibre Maps SDK](https://github.com/maplibre/maplibre-gl-native) (version 6.0.0)
- Added optional config parameter in NavigationMapView constructor to customize certain properties like route line color

# Migrating from v2 to v3
# Migrating from version 3 to version 4

MaplibreNavigation v3 allows you to start a navigation in an existing Map, so no modal ViewController needs to be presented over an existing map as before. This results in some breaking changes.
MaplibreNavigation version 4 allows you to start a navigation in an existing Map, so no modal ViewController needs to be presented over an existing map as before. This results in some breaking changes.

### Step 1:

Replace your ViewController that hosts the mapView with a `NavigationViewController`. We suggest to create a subclass of `NavigationViewController` and override init & call `super.init(dayStyle:)` or `super.init(dayStyleURL:)`. With v3, NavigationViewController will not start navigation until you request it.
Replace your ViewController that hosts the mapView with a `NavigationViewController`. We suggest to create a subclass of `NavigationViewController` and override init & call `super.init(dayStyle:)` or `super.init(dayStyleURL:)`. With version 3, NavigationViewController will not start navigation until you request it.

### Step 2:

Expand Down Expand Up @@ -107,4 +107,4 @@ Read the [CONTRIBUTING.md](CONTRIBUTING.md) guide in order to get familiar with
Code is [licensed](LICENSE.md) under MIT and ISC.
ISC is meant to be functionally equivalent to the MIT license.

Copyright (c) 2022 MapLibre contributors
Copyright (c) 2022 MapLibre contributors
12 changes: 5 additions & 7 deletions scripts/extract_localizable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,25 @@ CORE="${DIR}/../MapboxCoreNavigation"

LANGUAGES=( "Base" )

source "${DIR}/file_conversion.sh"

for lang in ${LANGUAGES[@]}
do
echo "Extracting ${lang} strings"

# Extract localizable strings from .swift files
find ${NAVIGATION} -name "*.swift" -print0 | xargs -0 xcrun extractLocStrings -o "${NAVIGATION}/Resources/${lang}.lproj"
STRINGS_FILE="${NAVIGATION}/Resources/${lang}.lproj/Localizable.strings"
convertIfNeeded "$STRINGS_FILE"

# Extract localizable strings from .swift files
find ${CORE} -name "*.swift" -print0 | xargs -0 xcrun extractLocStrings -o "${CORE}/Resources/${lang}.lproj"
STRINGS_FILE="${CORE}/Resources/${lang}.lproj/Localizable.strings"
convertIfNeeded "$STRINGS_FILE"

# Extract localizable strings from storyboard
ibtool ${NAVIGATION}/Resources/${lang}.lproj/Navigation.storyboard --generate-strings-file ${NAVIGATION}/Resources/${lang}.lproj/Navigation.strings

# Remove strings that should not be translated
source "${DIR}/file_conversion.sh"
convertIfNeeded "${NAVIGATION}/Resources/${lang}.lproj/Navigation.strings"
# Remove strings that should not be translated
sed -i '' -e '/DO NOT TRANSLATE/{N;N;d;}' "${NAVIGATION}/Resources/${lang}.lproj/Navigation.strings"

# Convert UTF-16LE generated files to UTF-8
iconv -f UTF-16LE -t UTF-8 ${STRINGS_FILE} > ${STRINGS_FILE}.new
mv -f ${STRINGS_FILE}.new ${STRINGS_FILE}
done
2 changes: 1 addition & 1 deletion scripts/file_conversion.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env/bash
#!/usr/bin/env bash

function convertIfNeeded {
# Convert from UTF-16LE to UTF-8
Expand Down

0 comments on commit 089dfb9

Please sign in to comment.