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

Function SetBookmarksMinZoom

libs/kml/types.cpp:13–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11namespace kml
12{
13void SetBookmarksMinZoom(FileData & fileData, double countPerTile, int maxZoom)
14{
15 using ValueType = std::pair<BookmarkData *, int /* score */>;
16 auto const scoreLess = base::LessBy(&ValueType::second);
17 MinZoomQuadtree<ValueType, decltype(scoreLess)> minZoomQuadtree{scoreLess};
18 for (auto & bm : fileData.m_bookmarksData)
19 {
20 auto const & properties = bm.m_properties;
21 int score = 0;
22 if (auto const s = properties.find("score"); s != properties.end())
23 UNUSED_VALUE(strings::to_int(s->second, score));
24 minZoomQuadtree.Add(bm.m_point, ValueType{&bm, score});
25 }
26 auto const setMinZoom = [](ValueType & valueType, int minZoom) { valueType.first->m_minZoom = minZoom; };
27 minZoomQuadtree.SetMinZoom(countPerTile, maxZoom, setMinZoom);
28}
29
30bool MultiGeometry::IsValid() const
31{

Callers

nothing calls this directly

Calls 6

LessByFunction · 0.85
to_intFunction · 0.85
findMethod · 0.45
endMethod · 0.45
AddMethod · 0.45
SetMinZoomMethod · 0.45

Tested by

no test coverage detected