From 505a5c20deaafbcebf57f1e3caff31cf213dde1e Mon Sep 17 00:00:00 2001 From: matheusgomesms Date: Sat, 3 Jan 2026 14:27:47 -0300 Subject: [PATCH] Update core to better remove 3D buildings only in navigation Signed-off-by: matheusgomesms --- libs/map/framework.cpp | 25 +++++++++++++++++++++---- libs/map/framework.hpp | 4 ++++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/libs/map/framework.cpp b/libs/map/framework.cpp index 50bf6a34f..7549e952a 100644 --- a/libs/map/framework.cpp +++ b/libs/map/framework.cpp @@ -175,6 +175,16 @@ void Framework::OnLocationUpdate(GpsInfo const & info) #endif m_routingManager.OnLocationUpdate(rInfo); + + bool const isRoutingActive = m_routingManager.IsRoutingActive(); + + if (m_wasRoutingActive != isRoutingActive) + { + m_wasRoutingActive = isRoutingActive; + + /// State changed (Started OR Stopped) -> Refresh 3D Buildings + Refresh3dMode(); + } } void Framework::OnCompassUpdate(CompassInfo const & info) @@ -3228,10 +3238,7 @@ void Framework::OnRouteFollow(routing::RouterType type) // GetRoutingSettings(type).m_matchRoute to the FollowRoute() instead of |isPedestrianRoute|. // |isArrowGlued| parameter fully corresponds to |m_matchRoute| in RoutingSettings. m_drapeEngine->FollowRoute(scale, scale3d, enableAutoZoom, !isPedestrianRoute /* isArrowGlued */); - - bool allow3d, allow3dBuildings; - Load3dMode(allow3d, allow3dBuildings); - Allow3dMode(allow3d, allow3dBuildings); + Refresh3dMode(); } // RoutingManager::Delegate @@ -3312,3 +3319,13 @@ void Framework::SetCarScreenMode(bool enabled) Load3dMode(allow3d, allow3dBuildings); Allow3dMode(allow3d, allow3dBuildings); } + +void Framework::Refresh3dMode() +{ + bool allow3d = true; + bool allow3dBuildings = true; + + /// Load User Preferences and apply logic + Load3dMode(allow3d, allow3dBuildings); + Allow3dMode(allow3d, allow3dBuildings); +} diff --git a/libs/map/framework.hpp b/libs/map/framework.hpp index 9be575566..7f90d0134 100644 --- a/libs/map/framework.hpp +++ b/libs/map/framework.hpp @@ -774,4 +774,8 @@ public: /// Call this from iOS/Android when CarPlay/AA session starts/ends void SetCarScreenMode(bool enabled); bool m_isCarScreenMode = false; + +private: + void Refresh3dMode(); + bool m_wasRoutingActive = false; };