| 953 | } |
| 954 | |
| 955 | bool Editor::CreatePoint(uint32_t type, m2::PointD const & mercator, MwmId const & id, |
| 956 | EditableMapObject & outFeature) const |
| 957 | { |
| 958 | ASSERT(id.IsAlive(), ("Please check that feature is created in valid MWM file before calling this method.")); |
| 959 | if (!id.GetInfo()->m_bordersRect.IsPointInside(mercator)) |
| 960 | { |
| 961 | LOG(LERROR, ("Attempt to create a feature outside of the MWM's bounding box.")); |
| 962 | return false; |
| 963 | } |
| 964 | |
| 965 | outFeature.SetMercator(mercator); |
| 966 | outFeature.SetID(GenerateNewFeatureId(*(m_features.Get()), id)); |
| 967 | outFeature.SetType(type); |
| 968 | outFeature.SetEditableProperties(GetEditablePropertiesForTypes(outFeature.GetTypes())); |
| 969 | // Only point type features can be created at the moment. |
| 970 | outFeature.SetPointType(); |
| 971 | outFeature.MarkAsCreated(type, feature::GeomType::Point, mercator); |
| 972 | return true; |
| 973 | } |
| 974 | |
| 975 | void Editor::CreateNote(ms::LatLon const & latLon, FeatureID const & fid, feature::TypesHolder const & holder, |
| 976 | std::string_view defaultName, NoteProblemType type, std::string_view note) |