Skip to content

Commit

Permalink
Add signals for stop sign and yield sign.
Browse files Browse the repository at this point in the history
  • Loading branch information
ShanMa1991 committed Oct 25, 2022
1 parent 5fe5f65 commit e3aa974
Show file tree
Hide file tree
Showing 10 changed files with 84 additions and 3 deletions.
21 changes: 18 additions & 3 deletions Sources/MapboxNavigation/NavigationMapView+Annotations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -419,19 +419,28 @@ extension NavigationMapView {
if let trafficSignlaDay = Bundle.mapboxNavigation.image(named: "TrafficSignalDay") {
try style.addImage(trafficSignlaDay, id: ImageIdentifier.trafficSignal)
}

if let railroadCrossingDay = Bundle.mapboxNavigation.image(named: "RailroadCrossingDay") {
try style.addImage(railroadCrossingDay, id: ImageIdentifier.railroadCrossing)
}

if let yieldSignDay = Bundle.mapboxNavigation.image(named: "YieldSignDay") {
try style.addImage(yieldSignDay, id: ImageIdentifier.yieldSign)
}
if let stopSignDay = Bundle.mapboxNavigation.image(named: "StopSignDay") {
try style.addImage(stopSignDay, id: ImageIdentifier.stopSign)
}
} else {
if let trafficSignalNight = Bundle.mapboxNavigation.image(named: "TrafficSignalNight") {
try style.addImage(trafficSignalNight, id: ImageIdentifier.trafficSignal)
}

if let railroadCrossingNight = Bundle.mapboxNavigation.image(named: "RailroadCrossingNight") {
try style.addImage(railroadCrossingNight, id: ImageIdentifier.railroadCrossing)
}
if let yieldSignNight = Bundle.mapboxNavigation.image(named: "YieldSignNight") {
try style.addImage(yieldSignNight, id: ImageIdentifier.yieldSign)
}
if let stopSignNight = Bundle.mapboxNavigation.image(named: "StopSignNight") {
try style.addImage(stopSignNight, id: ImageIdentifier.stopSign)
}
}

} catch {
Expand Down Expand Up @@ -492,6 +501,12 @@ extension NavigationMapView {
if intersection.railroadCrossing == true {
properties = ["imageName": .string(ImageIdentifier.railroadCrossing)]
}
if intersection.yieldSign == true {
properties = ["imageName": .string(ImageIdentifier.yieldSign)]
}
if intersection.stopSign == true {
properties = ["imageName": .string(ImageIdentifier.stopSign)]
}
if intersection.trafficSignal == true {
properties = ["imageName": .string(ImageIdentifier.trafficSignal)]
}
Expand Down
2 changes: 2 additions & 0 deletions Sources/MapboxNavigation/NavigationMapViewIdentifiers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ extension NavigationMapView {
static let routeAnnotationRightHanded = "RouteInfoAnnotationRightHanded"
static let trafficSignal = "traffic_signal"
static let railroadCrossing = "railroad_crossing"
static let yieldSign = "yield_sign"
static let stopSign = "stop_sign"
}

struct ModelKeyIdentifier {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "StopSignDay.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"template-rendering-intent" : "template",
"preserves-vector-representation" : true
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "StopSignNight.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"template-rendering-intent" : "template",
"preserves-vector-representation" : true
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "YieldSignDay.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"template-rendering-intent" : "template",
"preserves-vector-representation" : true
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "YieldSignNight.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"template-rendering-intent" : "template",
"preserves-vector-representation" : true
}
}
Binary file not shown.

0 comments on commit e3aa974

Please sign in to comment.