| 749 | } |
| 750 | |
| 751 | void Framework::FillInfoFromFeatureType(FeatureType & ft, place_page::Info & info) const |
| 752 | { |
| 753 | auto const featureStatus = osm::Editor::Instance().GetFeatureStatus(ft.GetID()); |
| 754 | ASSERT_NOT_EQUAL(featureStatus, FeatureStatus::Deleted, ("Deleted features cannot be selected from UI.")); |
| 755 | info.SetFeatureStatus(featureStatus); |
| 756 | |
| 757 | if (ftypes::IsAddressObjectChecker::Instance()(ft)) |
| 758 | info.SetAddress(GetAddressAtPoint(feature::GetCenter(ft)).FormatAddress()); |
| 759 | |
| 760 | info.SetFromFeatureType(ft); |
| 761 | |
| 762 | FillDescriptions(ft, info); |
| 763 | |
| 764 | auto const mwmInfo = ft.GetID().m_mwmId.GetInfo(); |
| 765 | bool const isMapVersionEditable = CanEditMapForPosition(info.GetMercator()); |
| 766 | bool const canEditOrAdd = featureStatus != FeatureStatus::Obsolete && isMapVersionEditable; |
| 767 | info.SetCanEditOrAdd(canEditOrAdd); |
| 768 | |
| 769 | // Fill countryId for place page info |
| 770 | auto const & types = info.GetTypes(); |
| 771 | bool const isState = ftypes::IsStateChecker::Instance()(types); |
| 772 | if (isState || ftypes::IsCountryChecker::Instance()(types)) |
| 773 | { |
| 774 | size_t const level = isState ? 1 : 0; |
| 775 | CountriesVec countries; |
| 776 | CountryId countryId = m_infoGetter->GetRegionCountryId(info.GetMercator()); |
| 777 | GetStorage().GetTopmostNodesFor(countryId, countries, level); |
| 778 | if (countries.size() == 1) |
| 779 | countryId = countries.front(); |
| 780 | |
| 781 | info.SetCountryId(countryId); |
| 782 | info.SetTopmostCountryIds(std::move(countries)); |
| 783 | } |
| 784 | } |
| 785 | |
| 786 | void Framework::FillApiMarkInfo(ApiMarkPoint const & api, place_page::Info & info) const |
| 787 | { |
nothing calls this directly
no test coverage detected