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

Method LoadMapsAsync

libs/map/framework.cpp:538–560  ·  view source on GitHub ↗

Small copy-paste with LoadMapsSync, but I don't have a better solution.

Source from the content-addressed store, hash-verified

536
537// Small copy-paste with LoadMapsSync, but I don't have a better solution.
538void Framework::LoadMapsAsync(std::function<void()> && callback)
539{
540 osm::Editor & editor = osm::Editor::Instance();
541 threads::SimpleThread([this, &editor, callback = std::move(callback)]()
542 {
543 RegisterAllMaps();
544 LOG(LDEBUG, ("Maps initialized"));
545
546 GetSearchAPI().InitAfterWorldLoaded();
547 LOG(LDEBUG, ("Search API initialized, part 2, after World was loaded"));
548
549 GetPlatform().RunTask(Platform::Thread::Gui, [this, &editor, callback = std::move(callback)]()
550 {
551 editor.LoadEdits();
552 m_featuresFetcher.GetDataSource().AddObserver(editor);
553 LOG(LDEBUG, ("Editor initialized"));
554
555 GetStorage().RestoreDownloadQueue();
556
557 callback();
558 });
559 }).detach();
560}
561
562void Framework::RegisterAllMaps()
563{

Callers 1

FrameworkMethod · 0.80

Calls 8

SimpleThreadClass · 0.85
InitAfterWorldLoadedMethod · 0.80
RunTaskMethod · 0.80
LoadEditsMethod · 0.80
AddObserverMethod · 0.80
GetDataSourceMethod · 0.80
RestoreDownloadQueueMethod · 0.80
detachMethod · 0.45

Tested by

no test coverage detected