MCPcopy Create free account
hub / github.com/comaps/comaps / OnLocationUpdate

Method OnLocationUpdate

libs/map/framework.cpp:182–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180}
181
182void Framework::OnLocationUpdate(GpsInfo const & info)
183{
184#ifdef FIXED_LOCATION
185 GpsInfo rInfo(info);
186
187 // get fixed coordinates
188 m_fixedPos.GetLon(rInfo.m_longitude);
189 m_fixedPos.GetLat(rInfo.m_latitude);
190
191 // pretend like GPS position
192 rInfo.m_horizontalAccuracy = 5.0;
193
194 if (m_fixedPos.HasNorth())
195 {
196 // pass compass value (for devices without compass)
197 CompassInfo compass;
198 m_fixedPos.GetNorth(compass.m_bearing);
199 OnCompassUpdate(compass);
200 }
201
202#else
203 GpsInfo const & rInfo = info;
204#endif
205
206 m_routingManager.OnLocationUpdate(rInfo);
207
208 bool const isRoutingActive = m_routingManager.IsRoutingActive();
209
210 if (m_wasRoutingActive != isRoutingActive)
211 {
212 m_wasRoutingActive = isRoutingActive;
213
214 /// State changed (Started OR Stopped) -> Refresh 3D Buildings
215 Refresh3dMode();
216 }
217}
218
219void Framework::OnCompassUpdate(CompassInfo const & info)
220{

Callers

nothing calls this directly

Calls 5

GetLonMethod · 0.80
GetLatMethod · 0.80
HasNorthMethod · 0.80
GetNorthMethod · 0.80
IsRoutingActiveMethod · 0.80

Tested by

no test coverage detected