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

Show current way name #155

Merged
merged 28 commits into from
Apr 28, 2017
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
binary "https://www.mapbox.com/ios-sdk/Mapbox-iOS-SDK.json" "3.5.2"
github "52inc/Pulley" "1.3.1"
github "52inc/Pulley" "1.4"
github "Project-OSRM/osrm-text-instructions.swift" "v0.1.1"
github "frederoni/aws-sdk-ios" "1a8432b03c22326fb7ed86fac978212106e2d465"
github "mapbox/MapboxDirections.swift" "v0.9.0"
Expand Down
2 changes: 1 addition & 1 deletion Examples/Swift/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class ViewController: UIViewController, MGLMapViewDelegate, NavigationViewContro

navigationViewController.simulatesLocationUpdates = simulatesLocationUpdates
navigationViewController.routeController.snapsUserLocationAnnotationToRoute = true
navigationViewController.voiceController?.volume = 0.5
navigationViewController.voiceController?.volume = 0
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you mean to check this in?

navigationViewController.navigationDelegate = self

// Uncomment to apply custom styles
Expand Down
4 changes: 4 additions & 0 deletions MapboxNavigation.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
C52D09CE1DEF5E5100BE3C5C /* route.json in Resources */ = {isa = PBXBuildFile; fileRef = C52D09CD1DEF5E5100BE3C5C /* route.json */; };
C52D09D31DEF636C00BE3C5C /* Fixture.swift in Sources */ = {isa = PBXBuildFile; fileRef = C52D09D21DEF636C00BE3C5C /* Fixture.swift */; };
C53208AB1E81FFB900910266 /* NavigationMapView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C53208AA1E81FFB900910266 /* NavigationMapView.swift */; };
C58159011EA6D02700FC6C3D /* MGLVectorSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C58159001EA6D02700FC6C3D /* MGLVectorSource.swift */; };
C58D6BAD1DDCF2AE00387F53 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = C58D6BAC1DDCF2AE00387F53 /* Constants.swift */; };
C5ADFBD81DDCC7840011824B /* MapboxCoreNavigationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5ADFBD71DDCC7840011824B /* MapboxCoreNavigationTests.swift */; };
C5C94C1B1DDCD22B0097296A /* MapboxCoreNavigation.h in Headers */ = {isa = PBXBuildFile; fileRef = C5ADFBCC1DDCC7840011824B /* MapboxCoreNavigation.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand Down Expand Up @@ -303,6 +304,7 @@
C52D09CD1DEF5E5100BE3C5C /* route.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = route.json; sourceTree = "<group>"; };
C52D09D21DEF636C00BE3C5C /* Fixture.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Fixture.swift; sourceTree = "<group>"; };
C53208AA1E81FFB900910266 /* NavigationMapView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NavigationMapView.swift; sourceTree = "<group>"; };
C58159001EA6D02700FC6C3D /* MGLVectorSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MGLVectorSource.swift; sourceTree = "<group>"; };
C58D6BAC1DDCF2AE00387F53 /* Constants.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
C5ADFBC91DDCC7840011824B /* MapboxCoreNavigation.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MapboxCoreNavigation.framework; sourceTree = BUILT_PRODUCTS_DIR; };
C5ADFBCC1DDCC7840011824B /* MapboxCoreNavigation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MapboxCoreNavigation.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -554,6 +556,7 @@
35D825FA1E6A2DBE0088F83B /* MGLMapView+MGLNavigationAdditions.m */,
351BEBEB1E5BCC63006FE110 /* String.swift */,
351BEBF01E5BCC63006FE110 /* UIView.swift */,
C58159001EA6D02700FC6C3D /* MGLVectorSource.swift */,
);
name = Extensions;
sourceTree = "<group>";
Expand Down Expand Up @@ -1058,6 +1061,7 @@
35EC316D1EA64057004280F5 /* SimulatedRoute.swift in Sources */,
C53208AB1E81FFB900910266 /* NavigationMapView.swift in Sources */,
351BEBF61E5BCC63006FE110 /* RouteMapViewController.swift in Sources */,
C58159011EA6D02700FC6C3D /* MGLVectorSource.swift in Sources */,
351BEBF51E5BCC63006FE110 /* RouteManeuverViewController.swift in Sources */,
351BEC011E5BCC63006FE110 /* TurnArrowView.swift in Sources */,
351BEBFA1E5BCC63006FE110 /* RouteTableViewController.swift in Sources */,
Expand Down
11 changes: 11 additions & 0 deletions MapboxNavigation/MGLVectorSource.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Foundation
import Mapbox

extension MGLVectorSource {
var isMapboxStreets: Bool {
guard let configurationURL = configurationURL else {
return false
}
return configurationURL.scheme == "mapbox" && configurationURL.host!.components(separatedBy: ",").contains("mapbox.mapbox-streets-v7")
}
}
38 changes: 33 additions & 5 deletions MapboxNavigation/Resources/Navigation.storyboard
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12120" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="2bw-kK-8r6">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12118" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="2bw-kK-8r6">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12088"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12086"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand Down Expand Up @@ -68,15 +68,41 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" restorationIdentifier="mapView" translatesAutoresizingMaskIntoConstraints="NO" id="nNr-30-cGD" customClass="MBNavigationMapView">
<rect key="frame" x="0.0" y="0.0" width="375" height="324"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="323.5"/>
<subviews>
<view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="drb-do-FoT" userLabel="Way Name View">
<rect key="frame" x="141" y="208.5" width="94.5" height="25"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Street Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bcm-ca-nGv" customClass="MBStyleLabel">
<rect key="frame" x="8" y="2" width="78.5" height="21"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="bcm-ca-nGv" secondAttribute="trailing" constant="8" id="16w-UW-7Y7"/>
<constraint firstAttribute="height" constant="25" id="3NJ-aK-aiH"/>
<constraint firstAttribute="bottom" secondItem="bcm-ca-nGv" secondAttribute="bottom" constant="2" id="Hs4-ZE-bmP"/>
<constraint firstItem="bcm-ca-nGv" firstAttribute="top" secondItem="drb-do-FoT" secondAttribute="top" constant="2" id="N8i-oQ-85J"/>
<constraint firstItem="bcm-ca-nGv" firstAttribute="leading" secondItem="drb-do-FoT" secondAttribute="leading" constant="8" id="gei-Oh-7XJ"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" red="0.90196078430000004" green="0.89019607840000003" blue="0.87450980389999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="drb-do-FoT" secondAttribute="bottom" constant="90" id="0ay-99-AQJ"/>
<constraint firstItem="drb-do-FoT" firstAttribute="centerX" secondItem="nNr-30-cGD" secondAttribute="centerX" id="TCg-jZ-7G3"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="showsUserLocation" value="YES"/>
<userDefinedRuntimeAttribute type="string" keyPath="styleURL__" value="mapbox://styles/mapbox/streets-v10"/>
</userDefinedRuntimeAttributes>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="5HY-QD-dBq" customClass="MBButton">
<rect key="frame" x="165" y="179.5" width="44" height="44"/>
<rect key="frame" x="165" y="180" width="44" height="44"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="width" constant="44" id="Cby-DX-AvF"/>
Expand Down Expand Up @@ -114,11 +140,13 @@
<connections>
<outlet property="mapView" destination="nNr-30-cGD" id="Znv-B1-wdj"/>
<outlet property="recenterButton" destination="5HY-QD-dBq" id="6ev-zD-MJ9"/>
<outlet property="wayNameLabel" destination="bcm-ca-nGv" id="8Sy-Pk-fQZ"/>
<outlet property="wayNameView" destination="drb-do-FoT" id="oby-w9-mC3"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="VoA-f6-EWh" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="4007" y="-112"/>
<point key="canvasLocation" x="4005.5999999999999" y="-112.44377811094454"/>
</scene>
<!--Route Page View Controller-->
<scene sceneID="MEC-Rr-Kca">
Expand Down