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

Method FormatNewBookmarkName

libs/map/place_page_info.cpp:311–334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

309}
310
311kml::LocalizableString Info::FormatNewBookmarkName() const
312{
313 kml::LocalizableString bookmarkName;
314 if (IsFeature())
315 {
316 m_name.ForEach([&bookmarkName](int8_t langCode, std::string_view localName)
317 {
318 if (!localName.empty())
319 bookmarkName[langCode] = localName;
320 });
321
322 if (bookmarkName.empty() && IsBuilding() && !m_address.empty())
323 kml::SetDefaultStr(bookmarkName, m_address);
324 }
325 else if (!m_uiTitle.empty())
326 {
327 if (IsMyPosition())
328 kml::SetDefaultStr(bookmarkName, platform::GetLocalizedMyPositionBookmarkName());
329 else
330 kml::SetDefaultStr(bookmarkName, m_uiTitle);
331 }
332
333 return bookmarkName;
334}
335
336std::string Info::GetFormattedCoordinate(CoordinatesFormat coordsFormat) const
337{

Calls 4

SetDefaultStrFunction · 0.85
ForEachMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected