diff --git a/kml/kml_tests/serdes_tests.cpp b/kml/kml_tests/serdes_tests.cpp
index 4a0a208a51..cc21049120 100644
--- a/kml/kml_tests/serdes_tests.cpp
+++ b/kml/kml_tests/serdes_tests.cpp
@@ -166,6 +166,62 @@ char const * kGeneratedKml =
" \n"
" \n"
" \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
" Test category\n"
" Test description\n"
" 1\n"
diff --git a/kml/kml_tests/tests_data.hpp b/kml/kml_tests/tests_data.hpp
index fc0be10061..b81b5f8a8e 100644
--- a/kml/kml_tests/tests_data.hpp
+++ b/kml/kml_tests/tests_data.hpp
@@ -59,7 +59,7 @@ char const * kTextKml =
""
"Nebraska"
""
- "#placemark-red"
+ "#placemark-lime"
""
"-99.901810,41.492538,0.000000"
""
@@ -1364,12 +1364,12 @@ std::vector const kBinKmlV4 = {
};
std::vector const kBinKml = {
- 0x04, 0x00, 0x00, 0x1E, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4D, 0x00, 0x00, 0x00,
+ 0x05, 0x00, 0x00, 0x1E, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4D, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x74, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x01, 0x00,
0x01, 0x00, 0x01, 0x00, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x04, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x04, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x8D, 0xB7, 0xF5, 0x71, 0xFC, 0x8C, 0xFC, 0xC0, 0x02, 0x00, 0x01, 0x05,
0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x01, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF3, 0xC2, 0xFB, 0xF9,
diff --git a/kml/serdes.cpp b/kml/serdes.cpp
index 6726df4b42..747d0e3813 100644
--- a/kml/serdes.cpp
+++ b/kml/serdes.cpp
@@ -101,6 +101,22 @@ PredefinedColor ExtractPlacemarkPredefinedColor(std::string const & s)
return PredefinedColor::Green;
if (s == "#placemark-orange")
return PredefinedColor::Orange;
+ if (s == "#placemark-deeppurple")
+ return PredefinedColor::DeepPurple;
+ if (s == "#placemark-lightblue")
+ return PredefinedColor::LightBlue;
+ if (s == "#placemark-cyan")
+ return PredefinedColor::Cyan;
+ if (s == "#placemark-teal")
+ return PredefinedColor::Teal;
+ if (s == "#placemark-lime")
+ return PredefinedColor::Lime;
+ if (s == "#placemark-deeporange")
+ return PredefinedColor::DeepOrange;
+ if (s == "#placemark-gray")
+ return PredefinedColor::Gray;
+ if (s == "#placemark-bluegray")
+ return PredefinedColor::BlueGray;
// Default color.
return PredefinedColor::Red;
@@ -118,6 +134,14 @@ std::string GetStyleForPredefinedColor(PredefinedColor color)
case PredefinedColor::Brown: return "placemark-brown";
case PredefinedColor::Green: return "placemark-green";
case PredefinedColor::Orange: return "placemark-orange";
+ case PredefinedColor::DeepPurple: return "placemark-deeppurple";
+ case PredefinedColor::LightBlue: return "placemark-lightblue";
+ case PredefinedColor::Cyan: return "placemark-cyan";
+ case PredefinedColor::Teal: return "placemark-teal";
+ case PredefinedColor::Lime: return "placemark-lime";
+ case PredefinedColor::DeepOrange: return "placemark-deeporange";
+ case PredefinedColor::Gray: return "placemark-gray";
+ case PredefinedColor::BlueGray: return "placemark-bluegray";
case PredefinedColor::None:
case PredefinedColor::Count:
return {};
diff --git a/kml/serdes_binary.hpp b/kml/serdes_binary.hpp
index d1e78e551c..a9e45e1984 100644
--- a/kml/serdes_binary.hpp
+++ b/kml/serdes_binary.hpp
@@ -24,8 +24,9 @@ enum class Version : uint8_t
V1 = 1, // 11th April 2018 (new Point2D storage, added deviceId, feature name -> custom name).
V2 = 2, // 25th April 2018 (added serverId).
V3 = 3, // 7th May 2018 (persistent feature types).
- V4 = 4, // 26th August 2019 (key-value properties and nearestToponym for bookmarks and tracks, cities -> toponyms)
- Latest = V4
+ V4 = 4, // 26th August 2019 (key-value properties and nearestToponym for bookmarks and tracks, cities -> toponyms).
+ V5 = 5, // 21st November 2019 (extended color palette).
+ Latest = V5
};
class SerializerKml
@@ -137,7 +138,7 @@ public:
NonOwningReaderSource source(reader);
auto const v = ReadPrimitiveFromSource(source);
- if (v != Version::Latest && v != Version::V2 && v != Version::V3)
+ if (v != Version::Latest && v != Version::V2 && v != Version::V3 && v != Version::V4)
MYTHROW(DeserializeException, ("Incorrect file version."));
ReadDeviceId(source);
@@ -147,8 +148,9 @@ public:
auto subReader = reader.CreateSubReader(source.Pos(), source.Size());
InitializeIfNeeded(*subReader);
- if (v == Version::V4)
+ if (v == Version::V5 || v == Version::V4)
{
+ // NOTE: v.4 and v.5 are binary compatible.
DeserializeCategory(subReader, m_data);
DeserializeBookmarks(subReader, m_data);
DeserializeTracks(subReader, m_data);
diff --git a/kml/types.hpp b/kml/types.hpp
index bf8e25a696..d4e94eb5e1 100644
--- a/kml/types.hpp
+++ b/kml/types.hpp
@@ -26,6 +26,16 @@ enum class PredefinedColor : uint8_t
Green,
Orange,
+ // Extended colors.
+ DeepPurple,
+ LightBlue,
+ Cyan,
+ Teal,
+ Lime,
+ DeepOrange,
+ Gray,
+ BlueGray,
+
Count
};
@@ -42,6 +52,14 @@ inline std::string DebugPrint(PredefinedColor color)
case PredefinedColor::Brown: return "Brown";
case PredefinedColor::Green: return "Green";
case PredefinedColor::Orange: return "Orange";
+ case PredefinedColor::DeepPurple: return "DeepPurple";
+ case PredefinedColor::LightBlue: return "LightBlue";
+ case PredefinedColor::Cyan: return "Cyan";
+ case PredefinedColor::Teal: return "Teal";
+ case PredefinedColor::Lime: return "Lime";
+ case PredefinedColor::DeepOrange: return "DeepOrange";
+ case PredefinedColor::Gray: return "Gray";
+ case PredefinedColor::BlueGray: return "BlueGray";
case PredefinedColor::Count: return {};
}
UNREACHABLE();
diff --git a/map/api_mark_point.cpp b/map/api_mark_point.cpp
index 86763184f8..5793a6f30e 100644
--- a/map/api_mark_point.cpp
+++ b/map/api_mark_point.cpp
@@ -14,7 +14,15 @@ std::map kStyleToColor = {
{"placemark-pink", "BookmarkPink"},
{"placemark-brown", "BookmarkBrown"},
{"placemark-green", "BookmarkGreen"},
- {"placemark-orange", "BookmarkOrange"}
+ {"placemark-orange", "BookmarkOrange"},
+ {"placemark-deeppurple", "BookmarkDeepPurple"},
+ {"placemark-lightblue", "BookmarkLightBlue"},
+ {"placemark-cyan", "BookmarkCyan"},
+ {"placemark-teal", "BookmarkTeal"},
+ {"placemark-lime", "BookmarkLime"},
+ {"placemark-deeporange", "BookmarkDeepOrange"},
+ {"placemark-gray", "BookmarkGray"},
+ {"placemark-bluegray", "BookmarkBlueGray"}
};
std::string GetSupportedStyle(std::string const & style)
diff --git a/map/bookmark.cpp b/map/bookmark.cpp
index f0ae29f18b..ca0c02463d 100644
--- a/map/bookmark.cpp
+++ b/map/bookmark.cpp
@@ -150,6 +150,22 @@ df::ColorConstant Bookmark::GetColorConstant() const
return "BookmarkGreen";
case kml::PredefinedColor::Orange:
return "BookmarkOrange";
+ case kml::PredefinedColor::DeepPurple:
+ return "BookmarkDeepPurple";
+ case kml::PredefinedColor::LightBlue:
+ return "BookmarkLightBlue";
+ case kml::PredefinedColor::Cyan:
+ return "BookmarkCyan";
+ case kml::PredefinedColor::Teal:
+ return "BookmarkTeal";
+ case kml::PredefinedColor::Lime:
+ return "BookmarkLime";
+ case kml::PredefinedColor::DeepOrange:
+ return "BookmarkDeepOrange";
+ case kml::PredefinedColor::Gray:
+ return "BookmarkGray";
+ case kml::PredefinedColor::BlueGray:
+ return "BookmarkBlueGray";
case kml::PredefinedColor::None:
case kml::PredefinedColor::Count:
return "BookmarkRed";