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

Method CreateMapObject

libs/map/framework.cpp:2946–2964  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2944}
2945
2946bool Framework::CreateMapObject(m2::PointD const & mercator, uint32_t const featureType,
2947 osm::EditableMapObject & emo) const
2948{
2949 emo = {};
2950 auto const & dataSource = m_featuresFetcher.GetDataSource();
2951 MwmSet::MwmId const mwmId =
2952 dataSource.GetMwmIdByCountryFile(platform::CountryFile(m_infoGetter->GetRegionCountryId(mercator)));
2953 if (!mwmId.IsAlive())
2954 return false;
2955
2956 search::ReverseGeocoder const coder(m_featuresFetcher.GetDataSource());
2957 auto const streets = coder.GetNearbyStreets(mwmId, mercator);
2958 emo.SetNearbyStreets(TakeSomeStreetsAndLocalize(streets, m_featuresFetcher.GetDataSource()));
2959
2960 // TODO(mgsergio): Check emo is a poi. For now it is the only option.
2961 SetHostingBuildingAddress(FindBuildingAtPoint(mercator), dataSource, coder, emo);
2962
2963 return osm::Editor::Instance().CreatePoint(featureType, mercator, mwmId, emo);
2964}
2965
2966bool Framework::GetEditableMapObject(FeatureID const & fid, osm::EditableMapObject & emo) const
2967{

Calls 10

GetDataSourceMethod · 0.80
GetMwmIdByCountryFileMethod · 0.80
GetRegionCountryIdMethod · 0.80
GetNearbyStreetsMethod · 0.80
SetNearbyStreetsMethod · 0.80
CreatePointMethod · 0.80
CountryFileClass · 0.50
IsAliveMethod · 0.45

Tested by

no test coverage detected