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

Method OnViewportChanged

libs/map/framework.cpp:284–306  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

282}
283
284void Framework::OnViewportChanged(ScreenBase const & screen)
285{
286 // Drape engine may spuriously call OnViewportChanged. Filter out the calls that
287 // change the viewport from the drape engine's point of view but leave it almost
288 // the same from the point of view of the framework and all its subsystems such as search api.
289 // Additional filtering may be done by each subsystem.
290 auto const isSameViewport =
291 m2::IsEqual(screen.ClipRect(), m_currentModelView.ClipRect(), kMwmPointAccuracy, kMwmPointAccuracy);
292 if (isSameViewport)
293 return;
294
295 m_currentModelView = screen;
296
297 GetSearchAPI().OnViewportChanged(GetCurrentViewport());
298
299 GetBookmarkManager().UpdateViewport(m_currentModelView);
300 m_trafficManager.UpdateViewport(m_currentModelView);
301 m_transitManager.UpdateViewport(m_currentModelView);
302 m_isolinesManager.UpdateViewport(m_currentModelView);
303
304 if (m_viewportChangedFn != nullptr)
305 m_viewportChangedFn(screen);
306}
307
308Framework::Framework(FrameworkParams const & params, bool loadMaps)
309 : m_enabledDiffs(params.m_enableDiffs)

Calls 2

IsEqualFunction · 0.50
UpdateViewportMethod · 0.45

Tested by 1

UNIT_CLASS_TESTFunction · 0.36