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

Function SetHostingBuildingAddress

libs/map/framework.cpp:2917–2937  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2915}
2916
2917void SetHostingBuildingAddress(FeatureID const & hostingBuildingFid, DataSource const & dataSource,
2918 search::ReverseGeocoder const & coder, osm::EditableMapObject & emo)
2919{
2920 if (!hostingBuildingFid.IsValid())
2921 return;
2922
2923 FeaturesLoaderGuard g(dataSource, hostingBuildingFid.m_mwmId);
2924 auto hostingBuildingFeature = g.GetFeatureByIndex(hostingBuildingFid.m_index);
2925 if (!hostingBuildingFeature)
2926 return;
2927
2928 search::ReverseGeocoder::Address address;
2929 if (coder.GetExactAddress(*hostingBuildingFeature, address))
2930 {
2931 if (emo.GetHouseNumber().empty())
2932 emo.SetHouseNumber(address.GetHouseNumber());
2933 if (emo.GetStreet().m_defaultName.empty())
2934 // TODO(mgsergio): Localize if localization is required by UI.
2935 emo.SetStreet({address.GetStreetName(), ""});
2936 }
2937}
2938} // namespace
2939
2940bool Framework::CanEditMapForPosition(m2::PointD const & position) const

Callers 2

CreateMapObjectMethod · 0.85
GetEditableMapObjectMethod · 0.85

Calls 8

GetHouseNumberMethod · 0.80
IsValidMethod · 0.45
GetFeatureByIndexMethod · 0.45
GetExactAddressMethod · 0.45
emptyMethod · 0.45
SetHouseNumberMethod · 0.45
GetStreetMethod · 0.45
SetStreetMethod · 0.45

Tested by

no test coverage detected