Пример #1
0
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();
    }
  }
}
Пример #2
0
void
DisablePan()
{
  GlueMapWindow *map = UIGlobals::GetMapIfActive();
  if (map == NULL || !map->IsPanning())
    return;

  map->SetPan(false);

  InputEvents::UpdatePan();
}
Пример #3
0
void
LeavePan()
{
  GlueMapWindow *map = UIGlobals::GetMapIfActive();
  if (map == NULL || !map->IsPanning())
    return;

  map->SetPan(false);

  InputEvents::UpdatePan();
  PageActions::Restore();
}
Пример #4
0
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();
}
Пример #5
0
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();
}
Пример #6
0
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);
}
Пример #7
0
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;
}
Пример #8
0
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;
}