Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorr.kuznetsov <r.kuznetsov@corp.mail.ru>2015-07-31 09:24:44 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:59:35 +0300
commit8c9f87e66ac5bc12b082493dd638aa72c70ab101 (patch)
treea4a6647bdedc0355b42f66d68fcdb038bb3838d1 /map/framework.cpp
parent6b014d1414ab893e3934cb3d1a1296621ebc0ef4 (diff)
Integration routing rendering in old engine
Diffstat (limited to 'map/framework.cpp')
-rw-r--r--map/framework.cpp39
1 files changed, 16 insertions, 23 deletions
diff --git a/map/framework.cpp b/map/framework.cpp
index c2b5ea0e44..ec9e54a153 100644
--- a/map/framework.cpp
+++ b/map/framework.cpp
@@ -145,6 +145,8 @@ void Framework::OnLocationUpdate(GpsInfo const & info)
if (state->IsModeChangeViewport())
UpdateUserViewportChanged();
+
+ m_bmManager.UpdateRouteDistanceFromBegin(hasDistanceFromBegin ? distanceFromBegin : 0.0);
}
void Framework::OnCompassUpdate(CompassInfo const & info)
@@ -2220,36 +2222,27 @@ void Framework::InsertRoute(Route const & route)
return;
}
- float const visScale = GetVisualScale();
-
- RouteTrack track(route.GetPoly());
- track.SetName(route.GetName());
- track.SetTurnsGeometry(route.GetTurnsGeometry());
+ vector<double> turns;
+ if (m_currentRouterType == RouterType::Vehicle)
+ {
+ turns::TTurnsGeom const & turnsGeom = route.GetTurnsGeometry();
+ if (!turnsGeom.empty())
+ {
+ turns.reserve(turnsGeom.size());
+ for (size_t i = 0; i < turnsGeom.size(); i++)
+ turns.push_back(turnsGeom[i].m_mercatorDistance);
+ }
+ }
/// @todo Consider a style parameter for the route color.
graphics::Color routeColor;
- graphics::Color arrowColor;
if (m_currentRouterType == RouterType::Pedestrian)
- {
- routeColor = graphics::Color(5, 105, 175, 255);
- arrowColor = graphics::Color(110, 180, 240, 255);
- }
+ routeColor = graphics::Color(5, 105, 175, 204);
else
- {
- routeColor = graphics::Color(110, 180, 240, 255);
- arrowColor = graphics::Color(40, 70, 160, 255);
- }
-
- Track::TrackOutline outlines[]
- {
- { 10.0f * visScale, routeColor }
- };
+ routeColor = graphics::Color(30, 150, 240, 204);
- track.SetArrowColor(arrowColor);
- track.AddOutline(outlines, ARRAY_SIZE(outlines));
- track.AddClosingSymbol(false, "route_to", graphics::EPosCenter, graphics::routingFinishDepth);
+ m_bmManager.SetRouteTrack(route.GetPoly(), turns, routeColor);
- m_bmManager.SetRouteTrack(track);
m_informationDisplay.ResetRouteMatchingInfo();
Invalidate();
}