diff options
-rw-r--r-- | android/gradle.properties | 4 | ||||
-rw-r--r-- | android/jni/com/mapswithme/maps/editor/Editor.cpp | 9 | ||||
-rw-r--r-- | drape/shaders/route_dash_fragment_shader.fsh | 2 | ||||
-rw-r--r-- | drape_frontend/route_shape.cpp | 4 | ||||
-rw-r--r-- | indexer/indexer_tests/osm_editor_test.cpp | 12 | ||||
-rw-r--r-- | indexer/osm_editor.cpp | 29 | ||||
-rw-r--r-- | indexer/osm_editor.hpp | 1 | ||||
-rw-r--r-- | iphone/Maps/UI/Editor/MWMEditorViewController.mm | 4 | ||||
-rw-r--r-- | map/framework.cpp | 8 | ||||
-rw-r--r-- | map/framework.hpp | 4 |
10 files changed, 51 insertions, 26 deletions
diff --git a/android/gradle.properties b/android/gradle.properties index 65e3bc559f..a2c764c52a 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -4,8 +4,8 @@ propMinSdkVersion=15 propTargetSdkVersion=22 propCompileSdkVersion=23 propBuildToolsVersion=25.0.2 -propVersionCode=730 -propVersionName=7.3.0 +propVersionCode=731 +propVersionName=7.3.1 propDebugNdkFlags=V=1 NDK_DEBUG=1 DEBUG=1 propReleaseNdkFlags=V=1 NDK_DEBUG=0 PRODUCTION=1 org.gradle.daemon=true diff --git a/android/jni/com/mapswithme/maps/editor/Editor.cpp b/android/jni/com/mapswithme/maps/editor/Editor.cpp index a7b868b4c7..22a3af0597 100644 --- a/android/jni/com/mapswithme/maps/editor/Editor.cpp +++ b/android/jni/com/mapswithme/maps/editor/Editor.cpp @@ -443,16 +443,17 @@ Java_com_mapswithme_maps_editor_Editor_nativeCreateMapObject(JNIEnv *, jclass, j JNIEXPORT void JNICALL Java_com_mapswithme_maps_editor_Editor_nativeCreateNote(JNIEnv * env, jclass clazz, jstring text) { - g_framework->NativeFramework()->CreateNote(g_editableMapObject.GetLatLon(), g_editableMapObject.GetID(), - osm::Editor::NoteProblemType::General, jni::ToNativeString(env, text)); + g_framework->NativeFramework()->CreateNote( + g_editableMapObject, osm::Editor::NoteProblemType::General, jni::ToNativeString(env, text)); } // static void nativePlaceDoesNotExist(String comment); JNIEXPORT void JNICALL Java_com_mapswithme_maps_editor_Editor_nativePlaceDoesNotExist(JNIEnv * env, jclass clazz, jstring comment) { - g_framework->NativeFramework()->CreateNote(g_editableMapObject.GetLatLon(), g_editableMapObject.GetID(), - osm::Editor::NoteProblemType::PlaceDoesNotExist, jni::ToNativeString(env, comment)); + g_framework->NativeFramework()->CreateNote(g_editableMapObject, + osm::Editor::NoteProblemType::PlaceDoesNotExist, + jni::ToNativeString(env, comment)); } JNIEXPORT void JNICALL diff --git a/drape/shaders/route_dash_fragment_shader.fsh b/drape/shaders/route_dash_fragment_shader.fsh index 25a8768f8f..756c5a6c72 100644 --- a/drape/shaders/route_dash_fragment_shader.fsh +++ b/drape/shaders/route_dash_fragment_shader.fsh @@ -25,7 +25,7 @@ void main(void) lowp vec4 fakeColor = texture2D(u_colorTex, vec2(0.0, 0.0)) * kFakeColorScalar; #endif - vec4 color = u_color; + vec4 color = u_color + v_color; if (v_length.x < v_length.z) color.a = 0.0; else diff --git a/drape_frontend/route_shape.cpp b/drape_frontend/route_shape.cpp index 836586f4c5..b273e89694 100644 --- a/drape_frontend/route_shape.cpp +++ b/drape_frontend/route_shape.cpp @@ -440,7 +440,9 @@ void RouteShape::CacheRoute(ref_ptr<dp::TextureManager> textures, RouteData & ro PrepareGeometry(routeData.m_sourcePolyline.GetPoints(), routeData.m_pivot, segmentsColors, geometry, joinsGeometry, routeData.m_length); - dp::GLState state = dp::GLState(gpu::ROUTE_PROGRAM, dp::GLState::GeometryLayer); + dp::GLState state = + dp::GLState(routeData.m_pattern.m_isDashed ? gpu::ROUTE_DASH_PROGRAM : gpu::ROUTE_PROGRAM, + dp::GLState::GeometryLayer); state.SetColorTexture(textures->GetSymbolsTexture()); BatchGeometry(state, make_ref(geometry.data()), static_cast<uint32_t>(geometry.size()), make_ref(joinsGeometry.data()), static_cast<uint32_t>(joinsGeometry.size()), diff --git a/indexer/indexer_tests/osm_editor_test.cpp b/indexer/indexer_tests/osm_editor_test.cpp index b0df3afaa9..32790b9d58 100644 --- a/indexer/indexer_tests/osm_editor_test.cpp +++ b/indexer/indexer_tests/osm_editor_test.cpp @@ -655,7 +655,10 @@ void EditorTest::HaveMapEditsOrNotesToUploadTest() ForEachCafeAtPoint(m_index, m2::PointD(1.0, 1.0), [&editor](FeatureType & ft) { using NoteType = osm::Editor::NoteProblemType; - editor.CreateNote({1.0, 1.0}, ft.GetID(), NoteType::PlaceDoesNotExist, "exploded"); + feature::TypesHolder typesHolder; + string defaultName; + editor.CreateNote({1.0, 1.0}, ft.GetID(), typesHolder, defaultName, NoteType::PlaceDoesNotExist, + "exploded"); }); TEST(editor.HaveMapEditsOrNotesToUpload(), ()); @@ -828,13 +831,18 @@ void EditorTest::CreateNoteTest() { platform::tests_support::ScopedFile sf("test_notes.xml"); editor.m_notes = Notes::MakeNotes(sf.GetFullPath(), true); - editor.CreateNote(pos, fId, noteType, "with comment"); + feature::TypesHolder holder; + holder.Assign(classif().GetTypeByPath({"amenity", "restaurant"})); + string defaultName = "Test name"; + editor.CreateNote(pos, fId, holder, defaultName, noteType, "with comment"); auto notes = editor.m_notes->GetNotes(); TEST_EQUAL(notes.size(), 1, ()); TEST(notes.front().m_point.EqualDxDy(pos, 1e-10), ()); TEST_NOT_EQUAL(notes.front().m_note.find("with comment"), string::npos, ()); TEST_NOT_EQUAL(notes.front().m_note.find("OSM data version"), string::npos, ()); + TEST_NOT_EQUAL(notes.front().m_note.find("restaurant"), string::npos, ()); + TEST_NOT_EQUAL(notes.front().m_note.find("Test name"), string::npos, ()); }; ForEachCafeAtPoint(m_index, m2::PointD(1.0, 1.0), [&editor, &createAndCheckNote](FeatureType & ft) diff --git a/indexer/osm_editor.cpp b/indexer/osm_editor.cpp index db2059c20e..b3d1e0d0c7 100644 --- a/indexer/osm_editor.cpp +++ b/indexer/osm_editor.cpp @@ -1073,6 +1073,7 @@ bool Editor::CreatePoint(uint32_t type, m2::PointD const & mercator, MwmSet::Mwm } void Editor::CreateNote(ms::LatLon const & latLon, FeatureID const & fid, + feature::TypesHolder const & holder, string const & defaultName, NoteProblemType const type, string const & note) { auto const version = GetMwmCreationTimeByMwmId(fid.m_mwmId); @@ -1080,13 +1081,14 @@ void Editor::CreateNote(ms::LatLon const & latLon, FeatureID const & fid, ostringstream sstr; auto canCreate = true; + if (!note.empty()) + sstr << "\"" << note << "\"" << endl; + switch (type) { case NoteProblemType::PlaceDoesNotExist: { - sstr << kPlaceDoesNotExistMessage; - if (!note.empty()) - sstr << " User comments: \"" << note << '\"'; + sstr << kPlaceDoesNotExistMessage << endl; auto const isCreated = GetFeatureStatus(fid) == FeatureStatus::Created; auto const createdAndUploaded = (isCreated && IsFeatureUploaded(fid.m_mwmId, fid.m_index)); CHECK(!isCreated || createdAndUploaded, ()); @@ -1098,13 +1100,22 @@ void Editor::CreateNote(ms::LatLon const & latLon, FeatureID const & fid, break; } - case NoteProblemType::General: - { - sstr << note; - break; - } + case NoteProblemType::General: break; + } + + if (defaultName.empty()) + sstr << "POI has no name" << endl; + else + sstr << "POI name: " << defaultName << endl; + + sstr << "POI types:"; + for (auto const & type : holder.ToObjectNames()) + { + sstr << ' ' << type; } - sstr << " (OSM data version: " << stringVersion << ')'; + sstr << endl; + + sstr << "OSM data version: " << stringVersion << endl; if (canCreate) m_notes->CreateNote(latLon, sstr.str()); diff --git a/indexer/osm_editor.hpp b/indexer/osm_editor.hpp index 2042727ec8..daa620dd4e 100644 --- a/indexer/osm_editor.hpp +++ b/indexer/osm_editor.hpp @@ -180,6 +180,7 @@ public: }; void CreateNote(ms::LatLon const & latLon, FeatureID const & fid, + feature::TypesHolder const & holder, string const & defaultName, NoteProblemType const type, string const & note); void UploadNotes(string const & key, string const & secret); diff --git a/iphone/Maps/UI/Editor/MWMEditorViewController.mm b/iphone/Maps/UI/Editor/MWMEditorViewController.mm index dfb80bd2ac..0804ff6f7d 100644 --- a/iphone/Maps/UI/Editor/MWMEditorViewController.mm +++ b/iphone/Maps/UI/Editor/MWMEditorViewController.mm @@ -282,7 +282,7 @@ void registerCellsForTableView(vector<MWMPlacePageCellType> const & cells, UITab noteInfo[kStatProblem] = self.note; CLLocation * location = [[CLLocation alloc] initWithLatitude:latLon.lat longitude:latLon.lon]; [Statistics logEvent:kStatEditorProblemReport withParameters:noteInfo atLocation:location]; - f.CreateNote(latLon, featureID, osm::Editor::NoteProblemType::General, self.note.UTF8String); + f.CreateNote(m_mapObject, osm::Editor::NoteProblemType::General, self.note.UTF8String); } switch (f.SaveEditedMapObject(m_mapObject)) @@ -968,7 +968,7 @@ void registerCellsForTableView(vector<MWMPlacePageCellType> const & cells, UITab kStatProblem : @(osm::Editor::kPlaceDoesNotExistMessage) } atLocation:location]; - GetFramework().CreateNote(latLon, fid, osm::Editor::NoteProblemType::PlaceDoesNotExist, + GetFramework().CreateNote(m_mapObject, osm::Editor::NoteProblemType::PlaceDoesNotExist, additional); [self backTap]; [self showDropDown]; diff --git a/map/framework.cpp b/map/framework.cpp index bfbb9d5bc1..4820d0df5f 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -3433,7 +3433,8 @@ osm::Editor::SaveResult Framework::SaveEditedMapObject(osm::EditableMapObject em if (shouldNotify) { // TODO @mgsergio fill with correct NoteProblemType - editor.CreateNote(issueLatLon, emo.GetID(), osm::Editor::NoteProblemType::General, + editor.CreateNote(emo.GetLatLon(), emo.GetID(), emo.GetTypes(), emo.GetDefaultName(), + osm::Editor::NoteProblemType::General, "The address on this POI is different from the building address." " It is either a user's mistake, or an issue in the data. Please" " check this and fix if needed. (This note was created automatically" @@ -3474,10 +3475,11 @@ bool Framework::RollBackChanges(FeatureID const & fid) return rolledBack; } -void Framework::CreateNote(ms::LatLon const & latLon, FeatureID const & fid, +void Framework::CreateNote(osm::MapObject const & mapObject, osm::Editor::NoteProblemType const type, string const & note) { - osm::Editor::Instance().CreateNote(latLon, fid, type, note); + osm::Editor::Instance().CreateNote(mapObject.GetLatLon(), mapObject.GetID(), mapObject.GetTypes(), + mapObject.GetDefaultName(), type, note); if (type == osm::Editor::NoteProblemType::PlaceDoesNotExist) DeactivateMapSelection(true /* notifyUI */); } diff --git a/map/framework.hpp b/map/framework.hpp index 72ab924b8d..c56390780a 100644 --- a/map/framework.hpp +++ b/map/framework.hpp @@ -865,8 +865,8 @@ public: void DeleteFeature(FeatureID const & fid) const; osm::NewFeatureCategories GetEditorCategories() const; bool RollBackChanges(FeatureID const & fid); - void CreateNote(ms::LatLon const & latLon, FeatureID const & fid, - osm::Editor::NoteProblemType const type, string const & note); + void CreateNote(osm::MapObject const & mapObject, osm::Editor::NoteProblemType const type, + string const & note); //@} |