mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 21:33:59 +00:00
make sure to use the correct myPositionMode terminology
This commit is contained in:
@@ -632,23 +632,23 @@ extension CarPlayService: LocationModeListener {
|
|||||||
// exit if we're navigating
|
// exit if we're navigating
|
||||||
guard let info = rootMapTemplate.userInfo as? MapInfo,
|
guard let info = rootMapTemplate.userInfo as? MapInfo,
|
||||||
info.type == CPConstants.TemplateType.main else {
|
info.type == CPConstants.TemplateType.main else {
|
||||||
MapTemplateBuilder.updatePositionModeButton(mapTemplate: rootMapTemplate, newMode: mode)
|
MapTemplateBuilder.updateMyPositionModeButton(mapTemplate: rootMapTemplate, newMode: mode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
switch mode {
|
switch mode {
|
||||||
case .follow, .followAndRotate:
|
case .follow, .followAndRotate:
|
||||||
if !rootMapTemplate.isPanningInterfaceVisible {
|
if !rootMapTemplate.isPanningInterfaceVisible {
|
||||||
MapTemplateBuilder.setupDestinationButton(mapTemplate: rootMapTemplate)
|
MapTemplateBuilder.setupDestinationButton(mapTemplate: rootMapTemplate)
|
||||||
MapTemplateBuilder.updatePositionModeButton(mapTemplate: rootMapTemplate, newMode: mode)
|
MapTemplateBuilder.updateMyPositionModeButton(mapTemplate: rootMapTemplate, newMode: mode)
|
||||||
}
|
}
|
||||||
case .notFollow:
|
case .notFollow:
|
||||||
if !rootMapTemplate.isPanningInterfaceVisible {
|
if !rootMapTemplate.isPanningInterfaceVisible {
|
||||||
MapTemplateBuilder.setupRecenterButton(mapTemplate: rootMapTemplate)
|
MapTemplateBuilder.setupRecenterButton(mapTemplate: rootMapTemplate)
|
||||||
MapTemplateBuilder.updatePositionModeButton(mapTemplate: rootMapTemplate, newMode: mode)
|
MapTemplateBuilder.updateMyPositionModeButton(mapTemplate: rootMapTemplate, newMode: mode)
|
||||||
}
|
}
|
||||||
case .pendingPosition, .notFollowNoPosition:
|
case .pendingPosition, .notFollowNoPosition:
|
||||||
rootMapTemplate.leadingNavigationBarButtons = []
|
rootMapTemplate.leadingNavigationBarButtons = []
|
||||||
MapTemplateBuilder.updatePositionModeButton(mapTemplate: rootMapTemplate, newMode: mode)
|
MapTemplateBuilder.updateMyPositionModeButton(mapTemplate: rootMapTemplate, newMode: mode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ final class MapTemplateBuilder {
|
|||||||
case startPanning
|
case startPanning
|
||||||
case zoomIn
|
case zoomIn
|
||||||
case zoomOut
|
case zoomOut
|
||||||
case positionMode
|
case myPositionMode
|
||||||
}
|
}
|
||||||
enum BarButtonType {
|
enum BarButtonType {
|
||||||
case dismissPaning
|
case dismissPaning
|
||||||
@@ -70,10 +70,10 @@ final class MapTemplateBuilder {
|
|||||||
let zoomOutButton = buildMapButton(type: .zoomOut) { _ in
|
let zoomOutButton = buildMapButton(type: .zoomOut) { _ in
|
||||||
FrameworkHelper.zoomMap(.out)
|
FrameworkHelper.zoomMap(.out)
|
||||||
}
|
}
|
||||||
let positionModeButton = buildMapButton(type: .positionMode) { _ in
|
let myPositionModeButton = buildMapButton(type: .myPositionMode) { _ in
|
||||||
FrameworkHelper.switchMyPositionMode()
|
FrameworkHelper.switchMyPositionMode()
|
||||||
}
|
}
|
||||||
mapTemplate.mapButtons = [positionModeButton, panningButton, zoomInButton, zoomOutButton]
|
mapTemplate.mapButtons = [myPositionModeButton, panningButton, zoomInButton, zoomOutButton]
|
||||||
|
|
||||||
let settingsButton = buildBarButton(type: .settings) { _ in
|
let settingsButton = buildBarButton(type: .settings) { _ in
|
||||||
let gridTemplate = SettingsTemplateBuilder.buildGridTemplate()
|
let gridTemplate = SettingsTemplateBuilder.buildGridTemplate()
|
||||||
@@ -103,10 +103,10 @@ final class MapTemplateBuilder {
|
|||||||
let panningButton = buildMapButton(type: .startPanning) { _ in
|
let panningButton = buildMapButton(type: .startPanning) { _ in
|
||||||
mapTemplate.showPanningInterface(animated: true)
|
mapTemplate.showPanningInterface(animated: true)
|
||||||
}
|
}
|
||||||
let positionModeButton = buildMapButton(type: .positionMode) { _ in
|
let myPositionModeButton = buildMapButton(type: .myPositionMode) { _ in
|
||||||
FrameworkHelper.switchMyPositionMode()
|
FrameworkHelper.switchMyPositionMode()
|
||||||
}
|
}
|
||||||
mapTemplate.mapButtons = [positionModeButton, panningButton]
|
mapTemplate.mapButtons = [myPositionModeButton, panningButton]
|
||||||
setupMuteAndRedirectButtons(template: mapTemplate)
|
setupMuteAndRedirectButtons(template: mapTemplate)
|
||||||
let endButton = buildBarButton(type: .endRoute) { _ in
|
let endButton = buildBarButton(type: .endRoute) { _ in
|
||||||
CarPlayService.shared.cancelCurrentTrip()
|
CarPlayService.shared.cancelCurrentTrip()
|
||||||
@@ -124,7 +124,7 @@ final class MapTemplateBuilder {
|
|||||||
mapTemplate.leadingNavigationBarButtons = [destinationButton]
|
mapTemplate.leadingNavigationBarButtons = [destinationButton]
|
||||||
}
|
}
|
||||||
|
|
||||||
class func updatePositionModeButton(mapTemplate: CPMapTemplate, newMode: MWMMyPositionMode) {
|
class func updateMyPositionModeButton(mapTemplate: CPMapTemplate, newMode: MWMMyPositionMode) {
|
||||||
let button = CPMapButton(handler: { _ in
|
let button = CPMapButton(handler: { _ in
|
||||||
FrameworkHelper.switchMyPositionMode()
|
FrameworkHelper.switchMyPositionMode()
|
||||||
})
|
})
|
||||||
@@ -195,7 +195,7 @@ final class MapTemplateBuilder {
|
|||||||
button.image = UIImage(systemName: "plus")
|
button.image = UIImage(systemName: "plus")
|
||||||
case .zoomOut:
|
case .zoomOut:
|
||||||
button.image = UIImage(systemName: "minus")
|
button.image = UIImage(systemName: "minus")
|
||||||
case .positionMode:
|
case .myPositionMode:
|
||||||
button.image = UIImage(named: "btn_pending_light")
|
button.image = UIImage(named: "btn_pending_light")
|
||||||
}
|
}
|
||||||
// Remove code below once Apple has fixed its issue with the button background
|
// Remove code below once Apple has fixed its issue with the button background
|
||||||
|
|||||||
Reference in New Issue
Block a user