From d5d86ffd36c06da814b1e96b07e1fa557cb22de0 Mon Sep 17 00:00:00 2001 From: David Martinez <47610359+dvdmrtnz@users.noreply.github.com> Date: Mon, 30 Jun 2025 18:20:30 +0200 Subject: [PATCH] [styles] Add charging_station search result icon & bookmark icon Signed-off-by: David Martinez <47610359+dvdmrtnz@users.noreply.github.com> --- .../organicmaps/sdk/bookmarks/data/Icon.java | 52 +++++++------------ .../symbols/bookmark-charging_station-m.svg | 12 +++++ .../search-result-charging_station.svg | 15 ++++++ .../symbols/bookmark-charging_station-m.svg | 12 +++++ .../search-result-charging_station.svg | 15 ++++++ .../Contents.json | 12 +++++ .../ic_bm_chargingstation.svg | 4 ++ kml/types.hpp | 2 + map/bookmark.cpp | 1 + map/bookmark_helpers.cpp | 4 +- map/search_mark.cpp | 5 ++ 11 files changed, 100 insertions(+), 34 deletions(-) create mode 100644 data/styles/default/dark/symbols/bookmark-charging_station-m.svg create mode 100644 data/styles/default/dark/symbols/search-result-charging_station.svg create mode 100644 data/styles/default/light/symbols/bookmark-charging_station-m.svg create mode 100644 data/styles/default/light/symbols/search-result-charging_station.svg create mode 100644 iphone/Maps/Images.xcassets/Bookmarks/ic_bm_chargingstation.imageset/Contents.json create mode 100644 iphone/Maps/Images.xcassets/Bookmarks/ic_bm_chargingstation.imageset/ic_bm_chargingstation.svg diff --git a/android/app/src/main/java/app/organicmaps/sdk/bookmarks/data/Icon.java b/android/app/src/main/java/app/organicmaps/sdk/bookmarks/data/Icon.java index e631dfbdd..c6d9c73d2 100644 --- a/android/app/src/main/java/app/organicmaps/sdk/bookmarks/data/Icon.java +++ b/android/app/src/main/java/app/organicmaps/sdk/bookmarks/data/Icon.java @@ -74,39 +74,25 @@ public class Icon implements Parcelable /// @todo Can make better: take name-by-type from Core and make a concat: "R.drawable.ic_bookmark_" + name. // First icon should be "none" <-> BOOKMARK_ICON_TYPE_NONE. @DrawableRes - private static final int[] TYPE_ICONS = { R.drawable.ic_bookmark_none, - R.drawable.ic_bookmark_hotel, - R.drawable.ic_bookmark_animals, - R.drawable.ic_bookmark_buddhism, - R.drawable.ic_bookmark_building, - R.drawable.ic_bookmark_christianity, - R.drawable.ic_bookmark_entertainment, - R.drawable.ic_bookmark_money, - R.drawable.ic_bookmark_food, - R.drawable.ic_bookmark_gas, - R.drawable.ic_bookmark_judaism, - R.drawable.ic_bookmark_medicine, - R.drawable.ic_bookmark_mountain, - R.drawable.ic_bookmark_museum, - R.drawable.ic_bookmark_islam, - R.drawable.ic_bookmark_park, - R.drawable.ic_bookmark_parking, - R.drawable.ic_bookmark_shop, - R.drawable.ic_bookmark_sights, - R.drawable.ic_bookmark_swim, - R.drawable.ic_bookmark_water, - R.drawable.ic_bookmark_bar, - R.drawable.ic_bookmark_transport, - R.drawable.ic_bookmark_viewpoint, - R.drawable.ic_bookmark_sport, - R.drawable.ic_bookmark_none, // pub - R.drawable.ic_bookmark_none, // art - R.drawable.ic_bookmark_none, // bank - R.drawable.ic_bookmark_none, // cafe - R.drawable.ic_bookmark_none, // pharmacy - R.drawable.ic_bookmark_none, // stadium - R.drawable.ic_bookmark_none, // theatre - R.drawable.ic_bookmark_none // information + private static final int[] TYPE_ICONS = { + R.drawable.ic_bookmark_none, R.drawable.ic_bookmark_hotel, R.drawable.ic_bookmark_animals, + R.drawable.ic_bookmark_buddhism, R.drawable.ic_bookmark_building, R.drawable.ic_bookmark_christianity, + R.drawable.ic_bookmark_entertainment, R.drawable.ic_bookmark_money, R.drawable.ic_bookmark_food, + R.drawable.ic_bookmark_gas, R.drawable.ic_bookmark_judaism, R.drawable.ic_bookmark_medicine, + R.drawable.ic_bookmark_mountain, R.drawable.ic_bookmark_museum, R.drawable.ic_bookmark_islam, + R.drawable.ic_bookmark_park, R.drawable.ic_bookmark_parking, R.drawable.ic_bookmark_shop, + R.drawable.ic_bookmark_sights, R.drawable.ic_bookmark_swim, R.drawable.ic_bookmark_water, + R.drawable.ic_bookmark_bar, R.drawable.ic_bookmark_transport, R.drawable.ic_bookmark_viewpoint, + R.drawable.ic_bookmark_sport, + R.drawable.ic_bookmark_none, // pub + R.drawable.ic_bookmark_none, // art + R.drawable.ic_bookmark_none, // bank + R.drawable.ic_bookmark_none, // cafe + R.drawable.ic_bookmark_none, // pharmacy + R.drawable.ic_bookmark_none, // stadium + R.drawable.ic_bookmark_none, // theatre + R.drawable.ic_bookmark_none, // information + R.drawable.ic_bookmark_none // ChargingStation }; @PredefinedColor diff --git a/data/styles/default/dark/symbols/bookmark-charging_station-m.svg b/data/styles/default/dark/symbols/bookmark-charging_station-m.svg new file mode 100644 index 000000000..8bce2d92b --- /dev/null +++ b/data/styles/default/dark/symbols/bookmark-charging_station-m.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/data/styles/default/dark/symbols/search-result-charging_station.svg b/data/styles/default/dark/symbols/search-result-charging_station.svg new file mode 100644 index 000000000..c448742ca --- /dev/null +++ b/data/styles/default/dark/symbols/search-result-charging_station.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/data/styles/default/light/symbols/bookmark-charging_station-m.svg b/data/styles/default/light/symbols/bookmark-charging_station-m.svg new file mode 100644 index 000000000..d4f47d342 --- /dev/null +++ b/data/styles/default/light/symbols/bookmark-charging_station-m.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/data/styles/default/light/symbols/search-result-charging_station.svg b/data/styles/default/light/symbols/search-result-charging_station.svg new file mode 100644 index 000000000..c448742ca --- /dev/null +++ b/data/styles/default/light/symbols/search-result-charging_station.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/iphone/Maps/Images.xcassets/Bookmarks/ic_bm_chargingstation.imageset/Contents.json b/iphone/Maps/Images.xcassets/Bookmarks/ic_bm_chargingstation.imageset/Contents.json new file mode 100644 index 000000000..717672d43 --- /dev/null +++ b/iphone/Maps/Images.xcassets/Bookmarks/ic_bm_chargingstation.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "ic_bm_chargingstation.svg" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/iphone/Maps/Images.xcassets/Bookmarks/ic_bm_chargingstation.imageset/ic_bm_chargingstation.svg b/iphone/Maps/Images.xcassets/Bookmarks/ic_bm_chargingstation.imageset/ic_bm_chargingstation.svg new file mode 100644 index 000000000..e2d1d649a --- /dev/null +++ b/iphone/Maps/Images.xcassets/Bookmarks/ic_bm_chargingstation.imageset/ic_bm_chargingstation.svg @@ -0,0 +1,4 @@ + + + + diff --git a/kml/types.hpp b/kml/types.hpp index 6a682cce8..dba079ac4 100644 --- a/kml/types.hpp +++ b/kml/types.hpp @@ -184,6 +184,7 @@ enum class BookmarkIcon : uint16_t Stadium, Theatre, Information, + ChargingStation, Count }; @@ -226,6 +227,7 @@ inline std::string ToString(BookmarkIcon icon) case Stadium: return "Stadium"; case Theatre: return "Theatre"; case Information: return "Information"; + case ChargingStation: return "ChargingStation"; case Count: return {}; } UNREACHABLE(); diff --git a/map/bookmark.cpp b/map/bookmark.cpp index 18f84303b..5b03e3cec 100644 --- a/map/bookmark.cpp +++ b/map/bookmark.cpp @@ -47,6 +47,7 @@ std::string GetBookmarkIconType(kml::BookmarkIcon const & icon) case kml::BookmarkIcon::Stadium: return "stadium"; case kml::BookmarkIcon::Theatre: return "theatre"; case kml::BookmarkIcon::Information: return "information"; + case kml::BookmarkIcon::ChargingStation: return "charging_station"; case kml::BookmarkIcon::Count: ASSERT(false, ("Invalid bookmark icon type")); return {}; diff --git a/map/bookmark_helpers.cpp b/map/bookmark_helpers.cpp index 73b12e7d0..4f126c842 100644 --- a/map/bookmark_helpers.cpp +++ b/map/bookmark_helpers.cpp @@ -88,7 +88,9 @@ std::map const kFeatureTypeToBookmarkMatchInfo = {"leisure-picnic_table", {kml::BookmarkIcon::Food, BookmarkBaseType::Food}}, {"tourism-picnic_site", {kml::BookmarkIcon::Food, BookmarkBaseType::Food}}, - {"amenity-charging_station", {kml::BookmarkIcon::Gas, BookmarkBaseType::Gas}}, + {"amenity-charging_station", {kml::BookmarkIcon::ChargingStation, BookmarkBaseType::Gas}}, + {"amenity-charging_station-bicycle", {kml::BookmarkIcon::ChargingStation, BookmarkBaseType::Gas}}, + {"amenity-charging_station-motorcar", {kml::BookmarkIcon::ChargingStation, BookmarkBaseType::Gas}}, {"amenity-fuel", {kml::BookmarkIcon::Gas, BookmarkBaseType::Gas}}, {"tourism-alpine_hut", {kml::BookmarkIcon::Hotel, BookmarkBaseType::Hotel}}, diff --git a/map/search_mark.cpp b/map/search_mark.cpp index db60fd95b..2454eefb4 100644 --- a/map/search_mark.cpp +++ b/map/search_mark.cpp @@ -47,6 +47,7 @@ enum SearchMarkPoint::SearchMarkType : uint8_t Playground, Bank, Fuel, + ChargingStation, ShopAlcohol, ShopButcher, ShopClothes, @@ -116,6 +117,7 @@ std::array const kSymbols = { "search-result-playground", // Playground. "search-result-bank", // Bank. "search-result-fuel", // Fuel. + "search-result-charging_station", // ChargingStation. "search-result-shop-alcohol", // ShopAlcohol. "search-result-shop-butcher", // ShopButcher. "search-result-shop-clothes", // ShopClothes. @@ -221,6 +223,9 @@ private: {{"amenity", "bank"}, SearchMarkType::Bank}, {{"shop", "money_lender"}, SearchMarkType::Bank}, {{"amenity", "fuel"}, SearchMarkType::Fuel}, + {{"amenity", "charging_station"}, SearchMarkType::ChargingStation}, + {{"amenity", "charging_station", "bicycle"}, SearchMarkType::ChargingStation}, + {{"amenity", "charging_station", "motorcar"}, SearchMarkType::ChargingStation}, {{"shop", "alcohol"}, SearchMarkType::ShopAlcohol}, {{"shop", "beverages"}, SearchMarkType::ShopAlcohol}, {{"shop", "wine"}, SearchMarkType::ShopAlcohol},