diff --git a/android/jni/com/mapswithme/maps/Framework.cpp b/android/jni/com/mapswithme/maps/Framework.cpp index 2067ac32df..6c3b9d6f33 100644 --- a/android/jni/com/mapswithme/maps/Framework.cpp +++ b/android/jni/com/mapswithme/maps/Framework.cpp @@ -801,7 +801,7 @@ namespace android void Framework::OnAcitvateApiPoint(gui::Element * e, url_scheme::ApiPoint const & apiPoint) { - LOG(LERROR, ("POINT on api point listener", apiPoint.m_title, apiPoint.m_url)); + LOG(LERROR, ("POINT on api point listener", apiPoint.m_title, apiPoint.m_id)); m_apiPointActivatedListener(apiPoint); } @@ -880,7 +880,7 @@ extern "C" "(DDLjava/lang/String;Ljava/lang/String;)V"); jstring j_name = jni::ToJavaString(jniEnv, apiPoint.m_title); - jstring j_id = jni::ToJavaString(jniEnv, apiPoint.m_url); + jstring j_id = jni::ToJavaString(jniEnv, apiPoint.m_id); jniEnv->CallVoidMethod(*obj.get(), methodID, apiPoint.m_lat, apiPoint.m_lon, j_name, j_id); } diff --git a/api/android/lib/src/com/mapswithme/maps/api/MapsWithMeApi.java b/api/android/lib/src/com/mapswithme/maps/api/MapsWithMeApi.java index b324165854..8f379f3ad2 100644 --- a/api/android/lib/src/com/mapswithme/maps/api/MapsWithMeApi.java +++ b/api/android/lib/src/com/mapswithme/maps/api/MapsWithMeApi.java @@ -138,7 +138,7 @@ public final class MapsWithMeApi .append(String.format(Locale.US, "%f,%f&", point.getLat(), point.getLon())); appendIfNotNull(urlBuilder, "n", point.getName()); - appendIfNotNull(urlBuilder, "u", point.getId()); + appendIfNotNull(urlBuilder, "id", point.getId()); } } diff --git a/map/framework.cpp b/map/framework.cpp index 0bb715380f..1821375f95 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -1469,7 +1469,8 @@ bool Framework::SetViewportByURL(string const & url, url_api::Request & request) request.m_viewportLat = point.m_lat = apiPoint.m_lat; request.m_viewportLon = point.m_lon = apiPoint.m_lon; - point.m_name = apiPoint.m_title; point.m_id = apiPoint.m_url; + point.m_name = apiPoint.m_title; + point.m_id = apiPoint.m_id; request.m_points.push_back(point); } diff --git a/map/map_tests/mwm_url_tests.cpp b/map/map_tests/mwm_url_tests.cpp index d2b339c503..cb619de1fa 100644 --- a/map/map_tests/mwm_url_tests.cpp +++ b/map/map_tests/mwm_url_tests.cpp @@ -20,7 +20,7 @@ UNIT_TEST(MapApiSmoke) TEST_EQUAL(api.GetPoints()[0].m_lat, 38.970559, ()); TEST_EQUAL(api.GetPoints()[0].m_lon, -9.419289, ()); TEST_EQUAL(api.GetPoints()[0].m_title, "Point Name", ()); - TEST_EQUAL(api.GetPoints()[0].m_url, "", ()); + TEST_EQUAL(api.GetPoints()[0].m_id, "", ()); TEST_EQUAL(api.GetGlobalBackUrl(), "", ()); } @@ -86,11 +86,11 @@ UNIT_TEST(MapApiInvalidPointLatLonButValidOtherParts) UNIT_TEST(MapApiPointURLEncoded) { - ParsedMapApi api(Uri("mwm://map?ll=1,2&n=%D0%9C%D0%B8%D0%BD%D1%81%D0%BA&u=http%3A%2F%2Fmap%3Fll%3D1%2C2%26n%3Dtest")); + ParsedMapApi api(Uri("mwm://map?ll=1,2&n=%D0%9C%D0%B8%D0%BD%D1%81%D0%BA&id=http%3A%2F%2Fmap%3Fll%3D1%2C2%26n%3Dtest")); TEST(api.IsValid(), ()); TEST_EQUAL(api.GetPoints().size(), 1, ()); TEST_EQUAL(api.GetPoints()[0].m_title, "\xd0\x9c\xd0\xb8\xd0\xbd\xd1\x81\xd0\xba", ()); - TEST_EQUAL(api.GetPoints()[0].m_url, "http://map?ll=1,2&n=test", ()); + TEST_EQUAL(api.GetPoints()[0].m_id, "http://map?ll=1,2&n=test", ()); } UNIT_TEST(GlobalBackUrl) @@ -217,7 +217,7 @@ string generatePartOfUrl(url_scheme::ApiPoint const & point) stringstream stream; stream << "&ll=" << strings::ToString(point.m_lat) << "," << strings::ToString(point.m_lon) << "&n=" << point.m_title - << "&u=" << point.m_title; + << "&id=" << point.m_id; return stream.str(); } @@ -242,7 +242,7 @@ void generateRandomTest(size_t numberOfPoints, size_t stringLength) point.m_lon = random.Generate() % 180; point.m_lon *= random.Generate() % 2 == 0 ? 1 : -1; point.m_title = randomString(stringLength, i); - point.m_url = randomString(stringLength, i); + point.m_id = randomString(stringLength, i); vect[i] = point; } string result = "mapswithme://map?v=1"; @@ -257,7 +257,7 @@ void generateRandomTest(size_t numberOfPoints, size_t stringLength) TEST_EQUAL(points[i].m_lat, vect[i].m_lat, ()); TEST_EQUAL(points[i].m_lon, vect[i].m_lon, ()); TEST_EQUAL(points[i].m_title, vect[i].m_title, ()); - TEST_EQUAL(points[i].m_url, vect[i].m_url, ()); + TEST_EQUAL(points[i].m_id, vect[i].m_id, ()); } TEST_EQUAL(api.GetApiVersion(), 1, ()); } diff --git a/map/mwm_url.cpp b/map/mwm_url.cpp index 306b7f7686..a50391e8c0 100644 --- a/map/mwm_url.cpp +++ b/map/mwm_url.cpp @@ -107,10 +107,10 @@ void ParsedMapApi::AddKeyValue(string key, string const & value) else LOG(LWARNING, ("Map API: Point name with no point. 'll' should come first!")); } - else if (key == "u") + else if (key == "id") { if (!m_points.empty()) - m_points.back().m_url = value; + m_points.back().m_id = value; else LOG(LWARNING, ("Map API: Point url with no point. 'll' should come first!")); } diff --git a/map/mwm_url.hpp b/map/mwm_url.hpp index 1e999daed8..a427e93f5e 100644 --- a/map/mwm_url.hpp +++ b/map/mwm_url.hpp @@ -11,7 +11,7 @@ struct ApiPoint double m_lat; double m_lon; string m_title; - string m_url; + string m_id; }; /// Handles [mapswithme|mwm]://map?params - everything related to displaying info on a map