MCPcopy Create free account
hub / github.com/OpenOrienteering/mapper / alignMapWithNorth

Method alignMapWithNorth

src/gui/map/map_editor.cpp:3692–3715  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3690}
3691
3692void MapEditorController::alignMapWithNorth(bool enable)
3693{
3694 const int update_interval = 1000; // milliseconds
3695
3696 if (enable)
3697 {
3698 Compass::getInstance().startUsage();
3699 gps_display->enableHeadingIndicator(true);
3700
3701 connect(&align_map_with_north_timer, &QTimer::timeout, this, &MapEditorController::alignMapWithNorthUpdate);
3702 align_map_with_north_timer.start(update_interval);
3703 alignMapWithNorthUpdate();
3704 }
3705 else
3706 {
3707 align_map_with_north_timer.disconnect();
3708 align_map_with_north_timer.stop();
3709
3710 gps_display->enableHeadingIndicator(false);
3711 Compass::getInstance().stopUsage();
3712
3713 main_view->setRotation(0);
3714 }
3715}
3716
3717void MapEditorController::alignMapWithNorthUpdate()
3718{

Callers

nothing calls this directly

Calls 6

startUsageMethod · 0.80
startMethod · 0.80
stopMethod · 0.80
stopUsageMethod · 0.80
setRotationMethod · 0.45

Tested by

no test coverage detected