void PageActions::RestoreMapZoom() { const PagesState &state = CommonInterface::SetUIState().pages; if (state.special_page.IsDefined()) return; const PageState &page = state.pages[state.current_index]; const PageSettings &settings = CommonInterface::GetUISettings().pages; if (settings.distinct_zoom) { MapSettings &map_settings = CommonInterface::SetMapSettings(); if (positive(page.cruise_scale)) map_settings.cruise_scale = page.cruise_scale; if (positive(page.circling_scale)) map_settings.circling_scale = page.circling_scale; GlueMapWindow *map = UIGlobals::GetMapIfActive(); if (map != nullptr) { map->RestoreMapScale(); map->QuickRedraw(); } } }
void DisablePan() { GlueMapWindow *map = UIGlobals::GetMapIfActive(); if (map == NULL || !map->IsPanning()) return; map->SetPan(false); InputEvents::UpdatePan(); }
void LeavePan() { GlueMapWindow *map = UIGlobals::GetMapIfActive(); if (map == NULL || !map->IsPanning()) return; map->SetPan(false); InputEvents::UpdatePan(); PageActions::Restore(); }
void EnterPan() { assert(CommonInterface::main_window != NULL); GlueMapWindow *map = PageActions::ShowOnlyMap(); if (map == NULL || map->IsPanning()) return; map->SetPan(true); InputEvents::setMode(InputEvents::MODE_DEFAULT); InputEvents::UpdatePan(); }
void LeavePan() { assert(CommonInterface::main_window != NULL); GlueMapWindow *map = CommonInterface::main_window->GetMapIfActive(); if (map == NULL || !map->IsPanning()) return; map->SetPan(false); setMode(InputEvents::MODE_DEFAULT); Pages::Update(); }
void EnterPan() { assert(CommonInterface::main_window != NULL); GlueMapWindow *map = CommonInterface::main_window->ActivateMap(); if (map == NULL || map->IsPanning()) return; map->SetPan(true); InputEvents::setMode(InputEvents::MODE_PAN); CommonInterface::main_window->SetFullScreen(true); }
bool PanTo(const GeoPoint &location) { assert(CommonInterface::main_window != NULL); GlueMapWindow *map = PageActions::ShowOnlyMap(); if (map == NULL) return false; map->PanTo(location); InputEvents::setMode(InputEvents::MODE_DEFAULT); InputEvents::UpdatePan(); return true; }
bool PanTo(const GeoPoint &location) { assert(CommonInterface::main_window != NULL); GlueMapWindow *map = CommonInterface::main_window->ActivateMap(); if (map == NULL) return false; map->PanTo(location); InputEvents::setMode(InputEvents::MODE_PAN); CommonInterface::main_window->SetFullScreen(true); return true; }