From 1aea7a228a6f5ff06ac617144e1fbf3b08168ad4 Mon Sep 17 00:00:00 2001 From: Rapinchuk Igor Date: Mon, 28 Oct 2024 13:25:10 +0300 Subject: [PATCH 1/3] Enable HD maps, Enable 3D SuperPOI --- navikit-demo/NavikitDemo/ViewModels/MapViewModel.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/navikit-demo/NavikitDemo/ViewModels/MapViewModel.swift b/navikit-demo/NavikitDemo/ViewModels/MapViewModel.swift index 9b6a6aa..8cadfcd 100644 --- a/navikit-demo/NavikitDemo/ViewModels/MapViewModel.swift +++ b/navikit-demo/NavikitDemo/ViewModels/MapViewModel.swift @@ -40,6 +40,8 @@ final class MapViewModel { self.controller = controller map = mapWindow.map + map.isAwesomeModelsEnabled = true + map.isHdModeEnabled = true } func setController(with controller: UIViewController) { From baf753d7bce77bdf61d875ea67da2f0ec7b00f42 Mon Sep 17 00:00:00 2001 From: Rapinchuk Igor Date: Fri, 1 Nov 2024 15:10:27 +0300 Subject: [PATCH 2/3] =?UTF-8?q?=D0=94=D0=B8=D0=BD=D0=B0=D0=BC=D0=B8=D1=87?= =?UTF-8?q?=D0=BD=D0=B0=D1=8F=20=D0=BD=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B9?= =?UTF-8?q?=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- navikit-demo/NavikitDemo/API/SettingsRepository.swift | 2 ++ .../NavikitDemo/Impl/SettingsRepositoryImpl.swift | 2 ++ .../NavikitDemo/UI/Settings/SettingsScreensSections.swift | 8 ++++++++ navikit-demo/NavikitDemo/ViewModels/MapViewModel.swift | 4 ++-- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/navikit-demo/NavikitDemo/API/SettingsRepository.swift b/navikit-demo/NavikitDemo/API/SettingsRepository.swift index 380cc22..feb2818 100644 --- a/navikit-demo/NavikitDemo/API/SettingsRepository.swift +++ b/navikit-demo/NavikitDemo/API/SettingsRepository.swift @@ -197,6 +197,8 @@ protocol SettingsRepository { var jamsMode: CurrentValueSubject { get } var balloons: CurrentValueSubject { get } var trafficLights: CurrentValueSubject { get } + var mapsHD: CurrentValueSubject { get } + var maps3D: CurrentValueSubject { get } var showPredicted: CurrentValueSubject { get } var balloonsGeometry: CurrentValueSubject { get } diff --git a/navikit-demo/NavikitDemo/Impl/SettingsRepositoryImpl.swift b/navikit-demo/NavikitDemo/Impl/SettingsRepositoryImpl.swift index a6a7c92..5d5516b 100644 --- a/navikit-demo/NavikitDemo/Impl/SettingsRepositoryImpl.swift +++ b/navikit-demo/NavikitDemo/Impl/SettingsRepositoryImpl.swift @@ -73,6 +73,8 @@ class SettingsRepositoryImpl: SettingsRepository { var jamsMode: CurrentValueSubject = setting("jamsMode", .enabledForCurrentRoute) var balloons: CurrentValueSubject = setting("balloons", true) var trafficLights: CurrentValueSubject = setting("trafficLights", true) + var mapsHD: CurrentValueSubject = setting("mapsHD", true) + var maps3D: CurrentValueSubject = setting("map3D", true) var showPredicted: CurrentValueSubject = setting("showPredicted", false) var balloonsGeometry: CurrentValueSubject = setting("balloonsGeometry", false) diff --git a/navikit-demo/NavikitDemo/UI/Settings/SettingsScreensSections.swift b/navikit-demo/NavikitDemo/UI/Settings/SettingsScreensSections.swift index f1a9df7..503e631 100644 --- a/navikit-demo/NavikitDemo/UI/Settings/SettingsScreensSections.swift +++ b/navikit-demo/NavikitDemo/UI/Settings/SettingsScreensSections.swift @@ -57,6 +57,14 @@ enum SettingsScreensSections { title: "Traffic Lights", value: .toggle(settingsRepository.trafficLights) ), + SettingItem( + title: "HD maps", + value: .toggle(settingsRepository.mapsHD) + ), + SettingItem( + title: "3D SuperPOI", + value: .toggle(settingsRepository.maps3D) + ), SettingItem( title: "Show Predicted", value: .toggle(settingsRepository.showPredicted) diff --git a/navikit-demo/NavikitDemo/ViewModels/MapViewModel.swift b/navikit-demo/NavikitDemo/ViewModels/MapViewModel.swift index 8cadfcd..ee11454 100644 --- a/navikit-demo/NavikitDemo/ViewModels/MapViewModel.swift +++ b/navikit-demo/NavikitDemo/ViewModels/MapViewModel.swift @@ -40,8 +40,8 @@ final class MapViewModel { self.controller = controller map = mapWindow.map - map.isAwesomeModelsEnabled = true - map.isHdModeEnabled = true + map.isAwesomeModelsEnabled = settingsRepository.maps3D.value + map.isHdModeEnabled = settingsRepository.mapsHD.value } func setController(with controller: UIViewController) { From d9f462cdb9948b18fd4db589a2b508044f6c6e9d Mon Sep 17 00:00:00 2001 From: Rapinchuk Igor Date: Mon, 4 Nov 2024 14:10:17 +0300 Subject: [PATCH 3/3] =?UTF-8?q?=D0=9F=D1=80=D0=BE=D0=B1=D1=80=D0=BE=D1=81?= =?UTF-8?q?=D0=B8=D0=BB=20=D0=BD=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B9=D0=BA?= =?UTF-8?q?=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NavikitDemo/ViewModels/MapViewModel.swift | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/navikit-demo/NavikitDemo/ViewModels/MapViewModel.swift b/navikit-demo/NavikitDemo/ViewModels/MapViewModel.swift index ee11454..eed763e 100644 --- a/navikit-demo/NavikitDemo/ViewModels/MapViewModel.swift +++ b/navikit-demo/NavikitDemo/ViewModels/MapViewModel.swift @@ -112,6 +112,8 @@ extension MapViewModel { start() setupNightModeSubscription() + setupMapsHDSubscription() + setupMaps3DSubscription() setupBackground() setupSerialization() @@ -231,6 +233,22 @@ extension MapViewModel { .store(in: &cancellablesBag) } + private func setupMapsHDSubscription() { + settingsRepository.mapsHD + .sink { [weak self] _ in + self?.map.isHdModeEnabled = self?.settingsRepository.mapsHD.value ?? true + } + .store(in: &cancellablesBag) + } + + private func setupMaps3DSubscription() { + settingsRepository.maps3D + .sink { [weak self] _ in + self?.map.isAwesomeModelsEnabled = self?.settingsRepository.maps3D.value ?? true + } + .store(in: &cancellablesBag) + } + private func setupBackground() { NotificationCenter.default.addObserver( self,