[search][styles] Category search. Visibility. #3671

Merged
vng merged 8 commits from vng-data into master 2022-10-19 07:20:41 +00:00
31 changed files with 328 additions and 322 deletions

View file

@ -26,7 +26,7 @@ buildscript {
ext.googleFirebaseServicesEnabled = project.hasProperty('firebase') ?: googleFirebaseServicesDefault
dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
classpath 'com.android.tools.build:gradle:7.3.1'
if (googleMobileServicesEnabled) {
println("Building with Google Mobile Services")

View file

@ -82,34 +82,26 @@ jobject ToJavaResult(Result const & result, search::ProductInfo const & productI
env->ReleaseIntArrayElements(ranges.get(), rawArr, 0);
ms::LatLon ll = ms::LatLon::Zero();
string distance;
double distanceInMeters = 0.0;
if (result.HasPoint())
{
auto const center = result.GetFeatureCenter();
ll = mercator::ToLatLon(center);
if (hasPosition)
{
distanceInMeters = ms::DistanceOnEarth(lat, lon,
mercator::YToLat(center.y),
mercator::XToLon(center.x));
distance = measurement_utils::FormatDistance(distanceInMeters);
}
}
bool popularityHasHigherPriority = PopularityHasHigherPriority(hasPosition, distanceInMeters);
ll = mercator::ToLatLon(result.GetFeatureCenter());
if (result.IsSuggest())
{
jni::TScopedLocalRef name(env, jni::ToJavaString(env, result.GetString()));
jni::TScopedLocalRef suggest(env, jni::ToJavaString(env, result.GetSuggestionString()));
jobject ret = env->NewObject(g_resultClass, g_suggestConstructor, name.get(), suggest.get(), ll.m_lat, ll.m_lon, ranges.get());
ASSERT(ret, ());
return ret;
return env->NewObject(g_resultClass, g_suggestConstructor, name.get(), suggest.get(), ll.m_lat, ll.m_lon, ranges.get());
}
auto const isFeature = result.GetResultType() == Result::Type::Feature;
string distance;
double distanceInMeters = 0.0;
if (result.HasPoint() && hasPosition)
{
distanceInMeters = ms::DistanceOnEarth(lat, lon, ll.m_lat, ll.m_lon);
distance = measurement_utils::FormatDistance(distanceInMeters);
}
bool const popularityHasHigherPriority = PopularityHasHigherPriority(hasPosition, distanceInMeters);
bool const isFeature = result.GetResultType() == Result::Type::Feature;
jni::TScopedLocalRef featureId(env, usermark_helper::CreateFeatureId(env, isFeature ?
result.GetFeatureID() :
kEmptyFeatureId));
@ -137,12 +129,9 @@ jobject ToJavaResult(Result const & result, search::ProductInfo const & productI
g_popularityConstructor,
/// @todo Restore when popularity will be available
0/*static_cast<jint>(result.GetRankingInfo().m_popularity)*/));
jobject ret =
env->NewObject(g_resultClass, g_resultConstructor, name.get(), desc.get(), ll.m_lat, ll.m_lon,
ranges.get(), result.IsHotel(), result.GetStarsCount(), popularity.get());
ASSERT(ret, ());
return ret;
return env->NewObject(g_resultClass, g_resultConstructor, name.get(), desc.get(), ll.m_lat, ll.m_lon,
ranges.get(), result.IsHotel(), result.GetStarsCount(), popularity.get());
}
jobjectArray BuildSearchResults(vector<search::ProductInfo> const & productInfo,

View file

@ -25,9 +25,6 @@ import com.mapswithme.util.ThemeUtils;
import com.mapswithme.util.UiUtils;
import com.mapswithme.util.Utils;
import static com.mapswithme.maps.search.SearchResult.TYPE_RESULT;
import static com.mapswithme.maps.search.SearchResult.TYPE_SUGGEST;
class SearchAdapter extends RecyclerView.Adapter<SearchAdapter.SearchDataViewHolder>
{
private final SearchFragment mSearchFragment;
@ -123,7 +120,7 @@ class SearchAdapter extends RecyclerView.Adapter<SearchAdapter.SearchDataViewHol
@Override
void processClick(SearchResult result, int order)
{
mSearchFragment.setQuery(result.suggestion);
mSearchFragment.setQuery(result.suggestion, result.type == SearchResult.TYPE_PURE_SUGGEST);
}
}
@ -296,10 +293,11 @@ class SearchAdapter extends RecyclerView.Adapter<SearchAdapter.SearchDataViewHol
switch (viewType)
{
case TYPE_SUGGEST:
case SearchResult.TYPE_SUGGEST:
case SearchResult.TYPE_PURE_SUGGEST:
return new SuggestViewHolder(inflater.inflate(R.layout.item_search_suggest, parent, false));
case TYPE_RESULT:
case SearchResult.TYPE_RESULT:
return new ResultViewHolder(inflater.inflate(R.layout.item_search_result, parent, false));
default:

View file

@ -288,9 +288,8 @@ public class SearchFragment extends BaseMwmFragment
updateResultsPlaceholder();
if (mInitialQuery != null)
{
setQuery(mInitialQuery);
}
setQuery(mInitialQuery, false);
mToolbarController.activate();
SearchEngine.INSTANCE.addListener(this);
@ -344,7 +343,7 @@ public class SearchFragment extends BaseMwmFragment
private String getQuery() { return mToolbarController.getQuery(); }
private boolean isCategory() { return mToolbarController.isCategory(); }
void setQuery(String text) { mToolbarController.setQuery(text); }
void setQuery(String text, boolean isCategory) { mToolbarController.setQuery(text, isCategory); }
private void readArguments()
{

View file

@ -10,8 +10,9 @@ import com.mapswithme.maps.bookmarks.data.FeatureId;
@SuppressWarnings("unused")
public class SearchResult implements PopularityProvider
{
public static final int TYPE_SUGGEST = 0;
public static final int TYPE_RESULT = 1;
public static final int TYPE_PURE_SUGGEST = 0;
public static final int TYPE_SUGGEST = 1;
public static final int TYPE_RESULT = 2;
// Values should match osm::YesNoUnknown enum.
public static final int OPEN_NOW_UNKNOWN = 0;
@ -81,7 +82,11 @@ public class SearchResult implements PopularityProvider
this.stars = 0;
this.isHotel = false;
this.description = null;
this.type = TYPE_SUGGEST;
// Looks like a hack, but it's fine. Otherwise, should make one more ctor and JNI code bloat.
if (lat == 0 && lon == 0)
this.type = TYPE_PURE_SUGGEST;
else
this.type = TYPE_SUGGEST;
this.highlightRanges = highlightRanges;
mPopularity = Popularity.defaultInstance();
}

Binary file not shown.

View file

@ -2684,6 +2684,27 @@ cont {
}
cont {
name: "aeroway-aerodrome-international"
element {
scale: 7
symbol {
name: "airport-s"
priority: 10000
}
}
element {
scale: 8
symbol {
name: "airport-s"
priority: 10000
}
}
element {
scale: 9
symbol {
name: "airport-s"
priority: 10000
}
}
element {
scale: 10
area {
@ -32922,7 +32943,7 @@ cont {
scale: 13
symbol {
name: "remains-s"
priority: 16000
priority: 16600
min_distance: 12
}
caption {
@ -32932,14 +32953,14 @@ cont {
offset_y: 1
is_optional: true
}
priority: 15000
priority: 15600
}
}
element {
scale: 14
symbol {
name: "remains-s"
priority: 16000
priority: 16600
min_distance: 12
}
caption {
@ -32949,14 +32970,14 @@ cont {
offset_y: 1
is_optional: true
}
priority: 15000
priority: 15600
}
}
element {
scale: 15
symbol {
name: "remains-m"
priority: 16000
priority: 16600
min_distance: 24
}
caption {
@ -32966,14 +32987,14 @@ cont {
offset_y: 1
is_optional: true
}
priority: 15000
priority: 15600
}
}
element {
scale: 16
symbol {
name: "remains-m"
priority: 16000
priority: 16600
min_distance: 12
}
caption {
@ -32983,14 +33004,14 @@ cont {
offset_y: 1
is_optional: true
}
priority: 15000
priority: 15600
}
}
element {
scale: 17
symbol {
name: "remains-m"
priority: 16000
priority: 16600
min_distance: 12
}
caption {
@ -33000,14 +33021,14 @@ cont {
offset_y: 1
is_optional: true
}
priority: 15000
priority: 15600
}
}
element {
scale: 18
symbol {
name: "remains-m"
priority: 16000
priority: 16600
min_distance: 12
}
caption {
@ -33017,14 +33038,14 @@ cont {
offset_y: 1
is_optional: true
}
priority: 15000
priority: 15600
}
}
element {
scale: 19
symbol {
name: "remains-m"
priority: 16000
priority: 16600
min_distance: 12
}
caption {
@ -33034,7 +33055,7 @@ cont {
offset_y: 1
is_optional: true
}
priority: 15000
priority: 15600
}
}
}
@ -33045,7 +33066,7 @@ cont {
lines {
width: 2.0
color: 12763315
priority: 1466
priority: 1600
cap: BUTTCAP
}
}
@ -33054,7 +33075,7 @@ cont {
lines {
width: 2.8
color: 12763315
priority: 1466
priority: 1600
cap: BUTTCAP
}
}
@ -33069,7 +33090,7 @@ cont {
dd: 1.5
dd: 3.0
}
priority: 1466
priority: 1600
}
}
element {
@ -33083,7 +33104,7 @@ cont {
dd: 1.9
dd: 4.0
}
priority: 1466
priority: 1600
}
}
element {
@ -33097,7 +33118,7 @@ cont {
dd: 2.5
dd: 6.0
}
priority: 1466
priority: 1600
}
}
element {
@ -33111,7 +33132,7 @@ cont {
dd: 3.0
dd: 8.0
}
priority: 1466
priority: 1600
}
}
}
@ -33685,7 +33706,7 @@ cont {
scale: 17
symbol {
name: "remains-m"
priority: 16000
priority: 16609
}
caption {
primary {
@ -33694,7 +33715,7 @@ cont {
offset_y: 1
is_optional: true
}
priority: 15000
priority: 15609
}
apply_if: "name"
}
@ -33702,7 +33723,7 @@ cont {
scale: 18
symbol {
name: "remains-m"
priority: 16000
priority: 16609
}
caption {
primary {
@ -33711,7 +33732,7 @@ cont {
offset_y: 1
is_optional: true
}
priority: 15000
priority: 15609
}
apply_if: "name"
}
@ -33719,7 +33740,7 @@ cont {
scale: 19
symbol {
name: "remains-m"
priority: 16000
priority: 16609
}
caption {
primary {
@ -33728,7 +33749,7 @@ cont {
offset_y: 1
is_optional: true
}
priority: 15000
priority: 15609
}
apply_if: "name"
}
@ -33736,7 +33757,7 @@ cont {
scale: 19
symbol {
name: "remains-m"
priority: 16000
priority: 16609
}
caption {
primary {
@ -33745,7 +33766,7 @@ cont {
offset_y: 1
is_optional: true
}
priority: 15000
priority: 15609
}
apply_if: "!name"
}

Binary file not shown.

View file

@ -2684,6 +2684,27 @@ cont {
}
cont {
name: "aeroway-aerodrome-international"
element {
scale: 7
symbol {
name: "airport-s"
priority: 10000
}
}
element {
scale: 8
symbol {
name: "airport-s"
priority: 10000
}
}
element {
scale: 9
symbol {
name: "airport-s"
priority: 10000
}
}
element {
scale: 10
area {
@ -32563,7 +32584,7 @@ cont {
scale: 13
symbol {
name: "remains-s"
priority: 16000
priority: 16600
min_distance: 12
}
caption {
@ -32573,14 +32594,14 @@ cont {
offset_y: 1
is_optional: true
}
priority: 15000
priority: 15600
}
}
element {
scale: 14
symbol {
name: "remains-s"
priority: 16000
priority: 16600
min_distance: 12
}
caption {
@ -32590,14 +32611,14 @@ cont {
offset_y: 1
is_optional: true
}
priority: 15000
priority: 15600
}
}
element {
scale: 15
symbol {
name: "remains-m"
priority: 16000
priority: 16600
min_distance: 24
}
caption {
@ -32607,14 +32628,14 @@ cont {
offset_y: 1
is_optional: true
}
priority: 15000
priority: 15600
}
}
element {
scale: 16
symbol {
name: "remains-m"
priority: 16000
priority: 16600
min_distance: 12
}
caption {
@ -32624,14 +32645,14 @@ cont {
offset_y: 1
is_optional: true
}
priority: 15000
priority: 15600
}
}
element {
scale: 17
symbol {
name: "remains-m"
priority: 16000
priority: 16600
min_distance: 12
}
caption {
@ -32641,14 +32662,14 @@ cont {
offset_y: 1
is_optional: true
}
priority: 15000
priority: 15600
}
}
element {
scale: 18
symbol {
name: "remains-m"
priority: 16000
priority: 16600
min_distance: 12
}
caption {
@ -32658,14 +32679,14 @@ cont {
offset_y: 1
is_optional: true
}
priority: 15000
priority: 15600
}
}
element {
scale: 19
symbol {
name: "remains-m"
priority: 16000
priority: 16600
min_distance: 12
}
caption {
@ -32675,7 +32696,7 @@ cont {
offset_y: 1
is_optional: true
}
priority: 15000
priority: 15600
}
}
}
@ -32686,7 +32707,7 @@ cont {
lines {
width: 2.0
color: 12763315
priority: 1466
priority: 1600
cap: BUTTCAP
}
}
@ -32695,7 +32716,7 @@ cont {
lines {
width: 2.8
color: 12763315
priority: 1466
priority: 1600
cap: BUTTCAP
}
}
@ -32710,7 +32731,7 @@ cont {
dd: 1.5
dd: 3.0
}
priority: 1466
priority: 1600
}
}
element {
@ -32724,7 +32745,7 @@ cont {
dd: 1.9
dd: 4.0
}
priority: 1466
priority: 1600
}
}
element {
@ -32738,7 +32759,7 @@ cont {
dd: 2.5
dd: 6.0
}
priority: 1466
priority: 1600
}
}
element {
@ -32752,7 +32773,7 @@ cont {
dd: 3.0
dd: 8.0
}
priority: 1466
priority: 1600
}
}
}
@ -33326,7 +33347,7 @@ cont {
scale: 17
symbol {
name: "remains-m"
priority: 16000
priority: 16609
}
caption {
primary {
@ -33335,7 +33356,7 @@ cont {
offset_y: 1
is_optional: true
}
priority: 15000
priority: 15609
}
apply_if: "name"
}
@ -33343,7 +33364,7 @@ cont {
scale: 18
symbol {
name: "remains-m"
priority: 16000
priority: 16609
}
caption {
primary {
@ -33352,7 +33373,7 @@ cont {
offset_y: 1
is_optional: true
}
priority: 15000
priority: 15609
}
apply_if: "name"
}
@ -33360,7 +33381,7 @@ cont {
scale: 19
symbol {
name: "remains-m"
priority: 16000
priority: 16609
}
caption {
primary {
@ -33369,7 +33390,7 @@ cont {
offset_y: 1
is_optional: true
}
priority: 15000
priority: 15609
}
apply_if: "name"
}
@ -33377,7 +33398,7 @@ cont {
scale: 19
symbol {
name: "remains-m"
priority: 16000
priority: 16609
}
caption {
primary {
@ -33386,7 +33407,7 @@ cont {
offset_y: 1
is_optional: true
}
priority: 15000
priority: 15609
}
apply_if: "!name"
}

Binary file not shown.

View file

@ -2684,6 +2684,27 @@ cont {
}
cont {
name: "aeroway-aerodrome-international"
element {
scale: 7
symbol {
name: "airport-s"
priority: 10000
}
}
element {
scale: 8
symbol {
name: "airport-s"
priority: 10000
}
}
element {
scale: 9
symbol {
name: "airport-s"
priority: 10000
}
}
element {
scale: 10
area {
@ -32711,7 +32732,7 @@ cont {
scale: 13
symbol {
name: "remains-s"
priority: 16000
priority: 16600
min_distance: 12
}
caption {
@ -32721,14 +32742,14 @@ cont {
offset_y: 1
is_optional: true
}
priority: 15000
priority: 15600
}
}
element {
scale: 14
symbol {
name: "remains-s"
priority: 16000
priority: 16600
min_distance: 12
}
caption {
@ -32738,14 +32759,14 @@ cont {
offset_y: 1
is_optional: true
}
priority: 15000
priority: 15600
}
}
element {
scale: 15
symbol {
name: "remains-m"
priority: 16000
priority: 16600
min_distance: 24
}
caption {
@ -32755,14 +32776,14 @@ cont {
offset_y: 1
is_optional: true
}
priority: 15000
priority: 15600
}
}
element {
scale: 16
symbol {
name: "remains-m"
priority: 16000
priority: 16600
min_distance: 12
}
caption {
@ -32772,14 +32793,14 @@ cont {
offset_y: 1
is_optional: true
}
priority: 15000
priority: 15600
}
}
element {
scale: 17
symbol {
name: "remains-m"
priority: 16000
priority: 16600
min_distance: 12
}
caption {
@ -32789,14 +32810,14 @@ cont {
offset_y: 1
is_optional: true
}
priority: 15000
priority: 15600
}
}
element {
scale: 18
symbol {
name: "remains-m"
priority: 16000
priority: 16600
min_distance: 12
}
caption {
@ -32806,14 +32827,14 @@ cont {
offset_y: 1
is_optional: true
}
priority: 15000
priority: 15600
}
}
element {
scale: 19
symbol {
name: "remains-m"
priority: 16000
priority: 16600
min_distance: 12
}
caption {
@ -32823,7 +32844,7 @@ cont {
offset_y: 1
is_optional: true
}
priority: 15000
priority: 15600
}
}
}
@ -32834,7 +32855,7 @@ cont {
lines {
width: 2.0
color: 3881787
priority: 1466
priority: 1600
cap: BUTTCAP
}
}
@ -32843,7 +32864,7 @@ cont {
lines {
width: 2.8
color: 3881787
priority: 1466
priority: 1600
cap: BUTTCAP
}
}
@ -32858,7 +32879,7 @@ cont {
dd: 1.5
dd: 3.0
}
priority: 1466
priority: 1600
}
}
element {
@ -32872,7 +32893,7 @@ cont {
dd: 1.9
dd: 4.0
}
priority: 1466
priority: 1600
}
}
element {
@ -32886,7 +32907,7 @@ cont {
dd: 2.5
dd: 6.0
}
priority: 1466
priority: 1600
}
}
element {
@ -32900,7 +32921,7 @@ cont {
dd: 3.0
dd: 8.0
}
priority: 1466
priority: 1600
}
}
}
@ -33474,7 +33495,7 @@ cont {
scale: 17
symbol {
name: "remains-m"
priority: 16000
priority: 16609
}
caption {
primary {
@ -33483,7 +33504,7 @@ cont {
offset_y: 1
is_optional: true
}
priority: 15000
priority: 15609
}
apply_if: "name"
}
@ -33491,7 +33512,7 @@ cont {
scale: 18
symbol {
name: "remains-m"
priority: 16000
priority: 16609
}
caption {
primary {
@ -33500,7 +33521,7 @@ cont {
offset_y: 1
is_optional: true
}
priority: 15000
priority: 15609
}
apply_if: "name"
}
@ -33508,7 +33529,7 @@ cont {
scale: 19
symbol {
name: "remains-m"
priority: 16000
priority: 16609
}
caption {
primary {
@ -33517,7 +33538,7 @@ cont {
offset_y: 1
is_optional: true
}
priority: 15000
priority: 15609
}
apply_if: "name"
}
@ -33525,7 +33546,7 @@ cont {
scale: 19
symbol {
name: "remains-m"
priority: 16000
priority: 16609
}
caption {
primary {
@ -33534,7 +33555,7 @@ cont {
offset_y: 1
is_optional: true
}
priority: 15000
priority: 15609
}
apply_if: "!name"
}

Binary file not shown.

View file

@ -249,6 +249,27 @@ cont {
}
cont {
name: "aeroway-aerodrome-international"
element {
scale: 7
symbol {
name: "airport-s"
priority: 10000
}
}
element {
scale: 8
symbol {
name: "airport-s"
priority: 10000
}
}
element {
scale: 9
symbol {
name: "airport-s"
priority: 10000
}
}
element {
scale: 10
area {
@ -19756,7 +19777,7 @@ cont {
lines {
width: 2.0
color: 13092543
priority: 1517
priority: 1764
cap: BUTTCAP
}
}
@ -19765,7 +19786,7 @@ cont {
lines {
width: 2.8
color: 13092543
priority: 1517
priority: 1764
}
}
element {
@ -19779,7 +19800,7 @@ cont {
dd: 1.5
dd: 3.0
}
priority: 1517
priority: 1764
}
}
element {
@ -19793,7 +19814,7 @@ cont {
dd: 1.9
dd: 4.0
}
priority: 1517
priority: 1764
}
}
element {
@ -19807,7 +19828,7 @@ cont {
dd: 2.5
dd: 6.0
}
priority: 1517
priority: 1764
}
}
}

Binary file not shown.

View file

@ -249,6 +249,27 @@ cont {
}
cont {
name: "aeroway-aerodrome-international"
element {
scale: 7
symbol {
name: "airport-s"
priority: 10000
}
}
element {
scale: 8
symbol {
name: "airport-s"
priority: 10000
}
}
element {
scale: 9
symbol {
name: "airport-s"
priority: 10000
}
}
element {
scale: 10
area {
@ -20080,7 +20101,7 @@ cont {
lines {
width: 2.0
color: 1907997
priority: 1517
priority: 1764
cap: BUTTCAP
}
}
@ -20089,7 +20110,7 @@ cont {
lines {
width: 2.8
color: 1907997
priority: 1517
priority: 1764
}
}
element {
@ -20103,7 +20124,7 @@ cont {
dd: 1.5
dd: 3.0
}
priority: 1517
priority: 1764
}
}
element {
@ -20117,7 +20138,7 @@ cont {
dd: 1.9
dd: 4.0
}
priority: 1517
priority: 1764
}
}
element {
@ -20131,7 +20152,7 @@ cont {
dd: 2.5
dd: 6.0
}
priority: 1517
priority: 1764
}
}
}

View file

@ -41,9 +41,7 @@ area[natural=glacier],
area[natural=beach],
area[natural=desert],
area[leisure=beach_resort],
area[aeroway=airport][aerodrome=international],
area[aeroway=aerodrome][aerodrome=international],
area[aeroway=airport],
area[aeroway=aerodrome],
area[landuse=education],
{z-index: 1;}
@ -460,9 +458,7 @@ line[waterway][tunnel]
/* 7.LANDUSE */
area|z10-[aeroway=airport][aerodrome=international],
area|z10-[aeroway=aerodrome][aerodrome=international],
area|z10-[aeroway=airport],
area|z10-[aeroway=aerodrome],
area|z14-[amenity=hospital],
area|z14-[amenity=doctors],
@ -564,34 +560,22 @@ area|z16-[area:highway=living_street],
/* 7.6 Airports */
area|z10[aeroway=airport][aerodrome=international],
area|z10[aeroway=aerodrome][aerodrome=international],
area|z10[aeroway=aerodrome],
area|z10[aeroway=airport]
{fill-color: @aerodrome0;}
area|z11[aeroway=airport][aerodrome=international],
area|z11[aeroway=aerodrome][aerodrome=international],
area|z11[aeroway=aerodrome],
area|z11[aeroway=airport],
{fill-color: @aerodrome1;}
area|z12-[aeroway=airport][aerodrome=international],
area|z12-[aeroway=aerodrome][aerodrome=international],
area|z12-[aeroway=airport],
area|z12-[aeroway=aerodrome]
{fill-color: @aerodrome2;}
area|z13[aeroway=airport][aerodrome=international],
area|z13[aeroway=aerodrome][aerodrome=international],
area|z13[aeroway=airport],
area|z13[aeroway=aerodrome]
{fill-color: @aerodrome3;}
area|z14[aeroway=airport][aerodrome=international],
area|z14[aeroway=aerodrome][aerodrome=international],
area|z14[aeroway=airport],
area|z14[aeroway=aerodrome]
{fill-color: @aerodrome4;}
area|z15-19[aeroway=airport][aerodrome=international],
area|z15-19[aeroway=aerodrome][aerodrome=international],
area|z15-19[aeroway=airport],
area|z15-19[aeroway=aerodrome]
{fill-color: @aerodrome5;}

View file

@ -86,14 +86,8 @@ area[natural=saddle],
node[mountain_pass],
area[mountain_pass],
node[tourism=information],
node[historic=wayside_shrine],
area[historic=wayside_shrine],
node[historic=tomb],
area[historic=tomb],
node[historic=wayside_cross],
area[historic=wayside_cross],
node[historic=boundary_stone],
area[historic=boundary_stone],
node[historic],
area[historic],
node[amenity=post_box],
area[amenity=post_box],
node[amenity=telephone],
@ -130,6 +124,8 @@ area[amenity=marketplace],
node[amenity=veterinary],
area[amenity=veterinary],
node[leisure=playground],
node[historic=ruins],
area[historic=ruins],
node[historic=ship],
area[historic=ship],
node[tourism=artwork][artwork_type=sculpture],
@ -730,9 +726,7 @@ node|z14-[amenity=bus_station]::int_name,
area|z14-[amenity=bus_station]::int_name
{text: int_name;text-color: @label_dark;text-halo-radius: 1;text-halo-opacity: 0.9;text-halo-color: @label_halo_light;text-position: center;text-optional: true;}
area|z10-[aeroway=airport],
area|z10-[aeroway=aerodrome],
node|z10-[aeroway=airport],
node|z10-[aeroway=aerodrome],
node|z15-[aerialway=station],
node|z15-[aerialway=cable_car],
@ -747,9 +741,7 @@ node|z15-[aerialway=platter],
node|z15-[aerialway=rope_tow],
node|z16-[amenity=ferry_terminal]
{text: name;text-color: @label_dark;text-halo-radius: 1;text-halo-opacity: 0.7;text-halo-color: @label_halo_light;text-position: center;text-optional: true;}
area|z12-[aeroway=airport]::int_name,
area|z12-[aeroway=aerodrome]::int_name,
node|z12-[aeroway=airport]::int_name,
node|z12-[aeroway=aerodrome]::int_name,
{text: int_name;text-color: @label_dark;text-halo-radius: 1;text-halo-opacity: 0.7;text-halo-color: @label_halo_light;text-position: center;text-optional: true;}
@ -901,32 +893,25 @@ node|z17-[amenity=ferry_terminal]
/* 3.6 Airport */
area|z10[aeroway=airport][aerodrome=international],
/* Manually define priority to avoid city names displacement */
area|z7-9[aeroway=aerodrome][aerodrome=international],
node|z7-9[aeroway=aerodrome][aerodrome=international],
{ icon-image: airport-s.svg; -x-me-icon-priority: 10000 }
area|z10[aeroway=aerodrome][aerodrome=international],
node|z10[aeroway=airport][aerodrome=international],
node|z10[aeroway=aerodrome][aerodrome=international]
node|z10[aeroway=aerodrome][aerodrome=international],
{icon-image: airport-s.svg;text-offset: 1;font-size: 10;fill-opacity: 1;text-optional: true;}
area|z11-13[aeroway=airport][aerodrome=international],
area|z11-13[aeroway=aerodrome][aerodrome=international],
node|z11-13[aeroway=airport][aerodrome=international],
node|z11-13[aeroway=aerodrome][aerodrome=international],
area|z12-13[aeroway=airport][aerodrome=international],
node|z12-13[aeroway=airport][aerodrome=international],
area|z12-13[aeroway=aerodrome][aerodrome=international],
node|z12-13[aeroway=aerodrome][aerodrome=international]
{icon-image: airport-m.svg;text-offset: 1;font-size: 11;-x-me-icon-priority: 3100;text-optional: true;}
area|z12-13[aeroway=airport]::int_name,
node|z12-13[aeroway=airport]::int_name,
area|z12-13[aeroway=aerodrome]::int_name,
node|z12-13[aeroway=aerodrome]::int_name,
{font-size: 10;text-optional: true;}
area|z14-[aeroway=airport],
node|z14-[aeroway=airport],
area|z14-[aeroway=aerodrome],
node|z14-[aeroway=aerodrome]
{icon-image: airport-m.svg;text-offset: 1;font-size: 12;text-optional: true;}
area|z14-[aeroway=airport]::int_name,
node|z14-[aeroway=airport]::int_name,
area|z14-[aeroway=aerodrome]::int_name,
node|z14-[aeroway=aerodrome]::int_name,
{font-size: 11;text-optional: true;}

View file

@ -40,9 +40,7 @@ area[natural=beach],
area[natural=desert],
area[leisure=beach_resort],
area[amenity=university],
area[aeroway=airport][aerodrome=international],
area[aeroway=aerodrome][aerodrome=international],
area[aeroway=airport],
area[aeroway=aerodrome]
{z-index: 1;}
@ -233,6 +231,7 @@ line|z10-[boundary=administrative][admin_level=4]
area|z10-[landuse=forest],
area|z10-[leisure=park],
area|z10-[leisure=nature_reserve],
area|z12-[leisure=garden],
area|z14-[landuse=grass],
area|z14-[natural=grassland],
@ -248,12 +247,9 @@ area|z14-[landuse=village_green],
area|z14-[landuse=field],
{fill-position: background; fill-opacity: 1;}
area|z10-[leisure=nature_reserve]
{fill-position: background; fill-opacity: 1;}
area|z10[landuse=forest],
area|z10[leisure=nature_reserve],
{fill-color: @green1;fill-opacity: 1;}
{fill-color: @green1;}
area|z14-[landuse=grass],
area|z14-[natural=grassland],
@ -268,37 +264,37 @@ area|z14-[landuse=meadow],
area|z14-[landuse=recreation_ground],
area|z14-[landuse=village_green],
area|z14-[landuse=field],
{fill-color: @green1;fill-opacity: 1;}
{fill-color: @green1;}
area|z11-12[landuse=forest],
area|z11-12[leisure=nature_reserve],
area|z10-12[leisure=park],
area|z12[leisure=garden],
{fill-color: @green2;fill-opacity: 1;}
{fill-color: @green2;}
area|z13[landuse=forest],
area|z13[leisure=nature_reserve],
area|z13[leisure=park],
area|z13[leisure=garden]
{fill-color: @green3;fill-opacity: 1;}
{fill-color: @green3;}
area|z14[landuse=forest],
area|z14[leisure=nature_reserve],
area|z14[leisure=park],
area|z14[leisure=garden]
{fill-color: @green4;fill-opacity: 1;}
{fill-color: @green4;}
area|z15[landuse=forest],
area|z15[leisure=nature_reserve],
area|z15[leisure=park],
area|z15[leisure=garden]
{fill-color: @green5;fill-opacity: 1;}
{fill-color: @green5;}
area|z16-[landuse=forest],
area|z16-[leisure=nature_reserve],
area|z16-[leisure=park],
area|z16-[leisure=garden]
{fill-color: @forest;fill-opacity: 1;}
{fill-color: @forest;}
area|z12-[natural=bare_rock],
{fill-color: @barerock;}
@ -408,9 +404,7 @@ line[waterway][tunnel]
/* 7.LANDUSE */
area|z10-[aeroway=airport][aerodrome=international],
area|z10-[aeroway=aerodrome][aerodrome=international],
area|z10-[aeroway=airport],
area|z10-[aeroway=aerodrome],
area|z14-[amenity=hospital],
area|z14-[amenity=doctors],
@ -479,34 +473,22 @@ area|z16-[landuse=cemetery]
/* 7.6 Airports */
area|z10[aeroway=airport][aerodrome=international],
area|z10[aeroway=aerodrome][aerodrome=international],
area|z10[aeroway=aerodrome],
area|z10[aeroway=airport]
{fill-color: @aerodrome0;fill-opacity: 1;}
area|z11[aeroway=airport][aerodrome=international],
area|z11[aeroway=aerodrome][aerodrome=international],
area|z11[aeroway=aerodrome],
area|z11[aeroway=airport],
{fill-color: @aerodrome1;fill-opacity: 1;}
area|z12-[aeroway=airport][aerodrome=international],
area|z12-[aeroway=aerodrome][aerodrome=international],
area|z12-[aeroway=airport],
area|z12-[aeroway=aerodrome]
{fill-color: @aerodrome2;fill-opacity: 1;}
area|z13[aeroway=airport][aerodrome=international],
area|z13[aeroway=aerodrome][aerodrome=international],
area|z13[aeroway=airport],
area|z13[aeroway=aerodrome]
{fill-color: @aerodrome3;fill-opacity: 1;}
area|z14[aeroway=airport][aerodrome=international],
area|z14[aeroway=aerodrome][aerodrome=international],
area|z14[aeroway=airport],
area|z14[aeroway=aerodrome]
{fill-color: @aerodrome4;fill-opacity: 1;}
area|z15-19[aeroway=airport][aerodrome=international],
area|z15-19[aeroway=aerodrome][aerodrome=international],
area|z15-19[aeroway=airport],
area|z15-19[aeroway=aerodrome]
{fill-color: @aerodrome5; fill-opacity: 1;}

View file

@ -80,20 +80,8 @@ node[shop=car_repair][service=tyres],
area[shop=car_repair][service=tyres],
{z-index: 2832;}
node[historic=boundary_stone],
area[historic=boundary_stone],
node[historic=wayside_cross],
area[historic=wayside_cross],
node[historic=ship],
area[historic=ship],
node[historic=tomb],
area[historic=tomb],
node[historic=ruins],
area[historic=ruins],
node[historic=wayside_shrine],
area[historic=wayside_shrine],
node[historic=archaeological_site],
area[historic=archaeological_site],
node[historic],
area[historic],
node[amenity=arts_centre],
area[amenity=arts_centre]
{z-index: 2868;}
@ -164,9 +152,7 @@ area[amenity=bus_station],
node[tourism=viewpoint]
{z-index: 3050;}
area[aeroway=airport],
area[aeroway=aerodrome],
node[aeroway=airport],
node[aeroway=aerodrome],
node[amenity=parking],
area[amenity=parking],
@ -263,14 +249,10 @@ node|z17-[railway=tram_stop]::int_name,
area|z17-[railway=tram_stop]::int_name
{text: int_name;text-color: @label_dark;text-halo-radius: 1;text-halo-opacity: 1;text-halo-color: @label_halo_light;}
area|z10-[aeroway=airport],
area|z10-[aeroway=aerodrome],
node|z10-[aeroway=airport],
node|z10-[aeroway=aerodrome],
{text: name;text-color: @label_dark;text-halo-radius: 1;text-halo-opacity: 0.7;text-halo-color: @label_halo_light;text-position: center;}
area|z12-[aeroway=airport]::int_name,
area|z12-[aeroway=aerodrome]::int_name,
node|z12-[aeroway=airport]::int_name,
node|z12-[aeroway=aerodrome]::int_name,
{text: int_name;text-color: @label_dark;text-halo-radius: 1;text-halo-opacity: 0.7;text-halo-color: @label_halo_light;text-position: center;}
@ -333,49 +315,35 @@ area|z18-[railway=tram_stop]
/* 3.6 Airport */
area|z10[aeroway=airport][aerodrome=international],
/* Manually define priority to avoid city names displacement */
area|z7-9[aeroway=aerodrome][aerodrome=international],
node|z7-9[aeroway=aerodrome][aerodrome=international],
{ icon-image: airport-s.svg; -x-me-icon-priority: 10000 }
area|z10[aeroway=aerodrome][aerodrome=international],
node|z10[aeroway=airport][aerodrome=international],
node|z10[aeroway=aerodrome][aerodrome=international],
{icon-image: airport-s.svg;text-offset: 1;font-size: 10;fill-opacity: 1;}
area|z11-14[aeroway=airport][aerodrome=international],
area|z11-14[aeroway=aerodrome][aerodrome=international],
node|z11-14[aeroway=airport][aerodrome=international],
node|z11-14[aeroway=aerodrome][aerodrome=international],
area|z12-14[aeroway=airport],
node|z12-14[aeroway=airport],
area|z12-14[aeroway=aerodrome],
node|z12-14[aeroway=aerodrome],
{icon-image: airport-m.svg;text-offset: 1;font-size: 11;-x-me-icon-priority: 3100;}
area|z12-14[aeroway=airport]::int_name,
node|z12-14[aeroway=airport]::int_name,
area|z12-14[aeroway=aerodrome]::int_name,
node|z12-14[aeroway=aerodrome]::int_name,
{font-size: 10;}
area|z15-16[aeroway=airport],
node|z15-16[aeroway=airport],
area|z15-16[aeroway=aerodrome],
node|z15-16[aeroway=aerodrome],
{icon-image: airport-m.svg;text-offset: 1;font-size: 12;}
area|z15-16[aeroway=airport]::int_name,
node|z15-16[aeroway=airport]::int_name,
area|z15-16[aeroway=aerodrome]::int_name,
node|z15-16[aeroway=aerodrome]::int_name,
{font-size: 11;}
area|z17-[aeroway=airport],
node|z17-[aeroway=airport],
area|z17-[aeroway=aerodrome],
node|z17-[aeroway=aerodrome],
{icon-image: airport-m.svg;text-offset: 1;font-size: 13;}
area|z17-[aeroway=airport]::int_name,
node|z17-[aeroway=airport]::int_name,
area|z17-[aeroway=aerodrome]::int_name,
node|z17-[aeroway=aerodrome]::int_name,
{font-size: 12;}
area|z17-[aeroway=heliport],
node|z17-[aeroway=heliport],
{icon-image: helipad-m.svg;text-offset: 1;font-size: 11;text: name;text-color: @poi_label;}

View file

@ -14,7 +14,7 @@ world 00000000000000000000 +
{}
aeroway 00000000000000000000 +
aerodrome 00000000001111111111 +
international 00000000001111111111 -
international 00000001111111111111 -
{}
apron 00000000000000000000 -
gate 00000000000000000000 -

View file

@ -1,14 +1,10 @@
#include "drape/overlay_handle.hpp"
#include "drape/constants.hpp"
#include "base/macros.hpp"
#include "base/internal/message.hpp"
#include "base/logging.hpp"
#include <algorithm>
#include <ios>
#include <sstream>
namespace dp
@ -231,22 +227,23 @@ std::string SquareHandle::GetOverlayDebugInfo()
}
#endif
/// @param[in] minZoomLevel Minimum visible zoom level (less is better)
/// @param[in] rank Rank of the feature (bigger is better)
/// @param[in] depth Manual priority from styles (bigger is better)
uint64_t CalculateOverlayPriority(int minZoomLevel, uint8_t rank, float depth)
{
// Overlay priority consider the following:
// - Minimum visible zoom level (the less the better);
// - Manual priority from styles (equals to the depth);
// - Rank of the feature (the more the better);
// [1 byte - zoom][4 bytes - priority][1 byte - rank][2 bytes - 0xFFFF].
uint8_t const minZoom = 0xFF - static_cast<uint8_t>(std::max(minZoomLevel, 0));
// Even if minZoomLevel < 0 (-1 is not visible), we will get more consistent |minZoom| value (less is worse).
ASSERT_GREATER_OR_EQUAL(minZoomLevel, 0, ());
uint8_t const minZoom = 0xFF - static_cast<uint8_t>(minZoomLevel);
float const kMinDepth = -100000.0f;
float const kMaxDepth = 100000.0f;
float constexpr kMinDepth = -100000.0f;
float constexpr kMaxDepth = 100000.0f;
float const d = base::Clamp(depth, kMinDepth, kMaxDepth) - kMinDepth;
auto const priority = static_cast<uint32_t>(d);
// Pack into uint64_t priority value (bigger is better).
// [1 byte - zoom][4 bytes - priority][1 byte - rank][2 bytes - 0xFFFF].
return (static_cast<uint64_t>(minZoom) << 56) |
(static_cast<uint64_t>(priority) << 24) |
(static_cast<uint64_t>(d) << 24) |
(static_cast<uint64_t>(rank) << 16) |
static_cast<uint64_t>(0xFFFF);
}

View file

@ -1882,14 +1882,12 @@ void FrontendRenderer::BuildOverlayTree(ScreenBase const & modelView)
void FrontendRenderer::PrepareBucket(dp::RenderState const & state, drape_ptr<dp::RenderBucket> & bucket)
{
CHECK(m_context != nullptr, ());
auto program = m_gpuProgramManager->GetProgram(state.GetProgram<gpu::Program>());
auto program3d = m_gpuProgramManager->GetProgram(state.GetProgram3d<gpu::Program>());
bool const isPerspective = m_userEventStream.GetCurrentScreen().isPerspective();
if (isPerspective)
program3d->Bind();
else
program->Bind();
bucket->GetBuffer()->Build(m_context, isPerspective ? program3d : program);
auto program = m_gpuProgramManager->GetProgram(m_userEventStream.GetCurrentScreen().isPerspective() ?
state.GetProgram3d<gpu::Program>() : state.GetProgram<gpu::Program>());
program->Bind();
bucket->GetBuffer()->Build(m_context, program);
}
void FrontendRenderer::RenderSingleGroup(ref_ptr<dp::GraphicsContext> context,

View file

@ -171,7 +171,7 @@ public:
void SetHouseNumber(std::string const & houseNumber) { m_houseNumber = houseNumber; }
void SetStreetName(std::string_view name) { m_streetName = name; }
void SetType(uint32_t type) { m_types.assign(1 /* count */, type); }
void SetTypes(std::initializer_list<uint32_t> const & types) { m_types.assign(types); }
void SetTypes(std::initializer_list<base::StringIL> const & types);
protected:

View file

@ -114,9 +114,6 @@ namespace
return false;
}
/// Warning: Geometry of features with always existing types will be indexed in mwm on all
/// zoom levels. If you add an always existing type to drawing types, the displacement of icons
/// may work not correctly.
bool TypeAlwaysExists(uint32_t type, GeomType g = GeomType::Undefined)
{
auto const & cl = classif();
@ -189,6 +186,11 @@ namespace
/// @}
} // namespace
bool IsCategoryNondrawableType(uint32_t type)
{
return TypeAlwaysExists(type);
}
bool IsUsefulType(uint32_t type)
{
return IsUsefulNondrawableType(type) || classif().GetObject(type)->IsDrawableAny();
@ -241,7 +243,9 @@ bool IsDrawableForIndexClassifOnly(TypesHolder const & types, int level)
Classificator const & c = classif();
for (uint32_t t : types)
{
if (TypeAlwaysExists(t) || c.GetObject(t)->IsDrawable(level))
// By VNG: TypeAlwaysExists check was removed. These kind of types (internet, recycling, fee, access, etc)
// should NOT influence on draw priority and index visibility. Some fancy logic may be broken ..
if (c.GetObject(t)->IsDrawable(level))
return true;
}

View file

@ -18,6 +18,7 @@ namespace feature
{
class TypesHolder;
bool IsCategoryNondrawableType(uint32_t type);
bool IsUsefulType(uint32_t type);
bool IsDrawableForIndex(FeatureType & ft, int level);
bool IsDrawableForIndex(TypesHolder const & types, m2::RectD limitRect, int level);

View file

@ -292,9 +292,8 @@ public:
}
private:
/// @todo Print most common street tokens for each country on generator stage (OSM ground truth)
/// and compare with these synonyms.
/// For example, I have doubts about: 'gaten', 'granden', 'vagen', XXXen nordic synonyms.
/// @todo Print most common street tokens for each country on generator stage
/// (OSM ground truth) and compare with these synonyms.
StreetsSynonymsHolder()
{
char const * affics[] =
@ -365,7 +364,8 @@ private:
"मार्ग", "marg",
// Norwegian - Norsk
"vei", "veien", "vn", "gate", "gaten", "gt", "plass", "plassen", "sving", "svingen", "sv",
// Details here: https://github.com/organicmaps/organicmaps/issues/3616
"vei", "veien", "veg", "vegen", "vn", "gata", "gate", "gaten", "gt", "plass", "plassen", "sving", "sv", "allé",
// Polish - Polski
"aleja", "aleje", "aleji", "alejach", "aleją", "plac", "placu", "placem", "ulica", "ulicy",

View file

@ -174,14 +174,6 @@ using Observers = NSHashTable<Observer>;
return [MWMSearch manager]->m_productInfo[index];
}
+ (BOOL)isFeatureAt:(NSUInteger)index in:(std::vector<FeatureID> const &)array {
auto const &result = [self resultWithContainerIndex:index];
if (result.GetResultType() != search::Result::Type::Feature)
return NO;
auto const &resultFeatureID = result.GetFeatureID();
return std::binary_search(array.begin(), array.end(), resultFeatureID);
}
+ (MWMSearchItemType)resultTypeWithRow:(NSUInteger)row {
auto itemsIndex = [MWMSearch manager].itemsIndex;
return [itemsIndex resultTypeWithRow:row];

View file

@ -1,7 +1,5 @@
typedef NS_ENUM(NSUInteger, MWMSearchItemType) {
// Order == priority.
MWMSearchItemTypeRegular,
MWMSearchItemTypeMopub,
MWMSearchItemTypeFacebook,
MWMSearchItemTypeSuggestion
};

View file

@ -81,28 +81,26 @@ NSString *GetLocalizedTypeName(search::Result const &result) {
NSAssert(false, @"Invalid reload with outdated SearchIndex");
return [tableView dequeueReusableCellWithCellClass:[MWMSearchCommonCell class] indexPath:indexPath];
}
auto const row = indexPath.row;
auto const containerIndex = [MWMSearch containerIndexWithRow:row];
switch ([MWMSearch resultTypeWithRow:row]) {
case MWMSearchItemTypeRegular: {
auto cell =
static_cast<MWMSearchCommonCell *>([tableView dequeueReusableCellWithCellClass:[MWMSearchCommonCell class]
indexPath:indexPath]);
auto const &result = [MWMSearch resultWithContainerIndex:containerIndex];
auto const &productInfo = [MWMSearch productInfoWithContainerIndex:containerIndex];
auto const typeName = GetLocalizedTypeName(result);
[cell config:result productInfo:productInfo
localizedTypeName:typeName];
auto const & result = [MWMSearch resultWithContainerIndex:containerIndex];
switch ([MWMSearch resultTypeWithRow:row])
{
case MWMSearchItemTypeRegular:
{
auto cell = static_cast<MWMSearchCommonCell *>(
[tableView dequeueReusableCellWithCellClass:[MWMSearchCommonCell class] indexPath:indexPath]);
auto const & productInfo = [MWMSearch productInfoWithContainerIndex:containerIndex];
[cell config:result productInfo:productInfo localizedTypeName:GetLocalizedTypeName(result)];
return cell;
}
case MWMSearchItemTypeMopub:
case MWMSearchItemTypeFacebook: {
}
case MWMSearchItemTypeSuggestion: {
case MWMSearchItemTypeSuggestion:
{
auto cell = static_cast<MWMSearchSuggestionCell *>(
[tableView dequeueReusableCellWithCellClass:[MWMSearchSuggestionCell class] indexPath:indexPath]);
auto const &suggestion = [MWMSearch resultWithContainerIndex:containerIndex];
[cell config:suggestion localizedTypeName:@""];
[cell config:result localizedTypeName:@""];
cell.isLastCell = row == [MWMSearch suggestionsCount] - 1;
return cell;
}
@ -115,22 +113,22 @@ NSString *GetLocalizedTypeName(search::Result const &result) {
id<MWMSearchTableViewProtocol> delegate = self.delegate;
auto const row = indexPath.row;
auto const containerIndex = [MWMSearch containerIndexWithRow:row];
switch ([MWMSearch resultTypeWithRow:row]) {
case MWMSearchItemTypeRegular: {
SearchTextField *textField = delegate.searchTextField;
auto const & result = [MWMSearch resultWithContainerIndex:containerIndex];
switch ([MWMSearch resultTypeWithRow:row])
{
case MWMSearchItemTypeRegular:
{
SearchTextField const * textField = delegate.searchTextField;
[MWMSearch saveQuery:textField.text forInputLocale:textField.textInputMode.primaryLanguage];
auto const &result = [MWMSearch resultWithContainerIndex:containerIndex];
[delegate processSearchWithResult:result];
break;
}
case MWMSearchItemTypeMopub:
case MWMSearchItemTypeFacebook:
case MWMSearchItemTypeSuggestion:
{
[delegate searchText:@(result.GetSuggestionString().c_str()) forInputLocale:nil
withCategory:result.GetResultType() == search::Result::Type::PureSuggest];
break;
case MWMSearchItemTypeSuggestion: {
auto const &suggestion = [MWMSearch resultWithContainerIndex:containerIndex];
NSString *suggestionString = @(suggestion.GetSuggestionString().c_str());
/// @todo Pass withCategory:YES if we tap on category suggestion (not street or city)?
[delegate searchText:suggestionString forInputLocale:nil withCategory:NO];
}
}
}

View file

@ -3169,14 +3169,12 @@ UNIT_CLASS_TEST(ProcessorTest, PoiStreetCity_FancyMatch)
UNIT_CLASS_TEST(ProcessorTest, ComplexPoi_Rank)
{
auto const & cl = classif();
TestBuilding landuse({-1, -1, 1, 1}, "Telekom", "5", "xxx", "de");
landuse.AddType(cl.GetTypeByPath({"landuse", "commercial"}));
landuse.AddType(classif().GetTypeByPath({"landuse", "commercial"}));
TestPOI poiInMall({0, 0}, "yyy", "de");
poiInMall.SetType(cl.GetTypeByPath({"shop", "clothes"}));
poiInMall.SetTypes({{"shop", "clothes"}});
TestPOI telekom({2, 2}, "Telekom shop", "de");
telekom.SetType(cl.GetTypeByPath({"shop", "mobile_phone"}));
telekom.SetTypes({{"shop", "mobile_phone"}});
auto countryId = BuildCountry("Wonderland", [&](TestMwmBuilder & builder)
{

View file

@ -12,6 +12,7 @@
#include "indexer/classificator.hpp"
#include "indexer/feature_meta.hpp"
#include "indexer/feature_visibility.hpp"
#include "geometry/point2d.hpp"
#include "geometry/rect2d.hpp"
@ -156,7 +157,7 @@ UNIT_CLASS_TEST(SmokeTest, TypesSkipperTest)
auto const & cl = classif();
for (auto const & path : arr)
{
feature::TypesHolder types;
TypesHolder types;
types.Add(cl.GetTypeByPath(path));
TEST(!skipper.SkipAlways(types), (path));
@ -226,28 +227,32 @@ UNIT_CLASS_TEST(SmokeTest, CategoriesTest)
auto const & holder = GetDefaultCategories();
uint32_t const cafeType = cl.GetTypeByPath({"amenity", "cafe"});
auto testCategory = [&](uint32_t type, CategoriesHolder::Category const &)
{
if (invisibleTypes.find(type) != invisibleTypes.end())
if (invisibleTypes.count(type) > 0)
return;
bool categoryIsSearchable = true;
if (notSupportedTypes.find(type) != notSupportedTypes.end())
if (notSupportedTypes.count(type) > 0)
categoryIsSearchable = false;
string const countryName = "Wonderland";
TestPOI poi(m2::PointD(1.0, 1.0), "poi", "en");
poi.SetType(type);
if (IsCategoryNondrawableType(type))
poi.SetTypes({type, cafeType});
else
poi.SetTypes({type});
auto id = BuildMwm(countryName, DataHeader::MapType::Country,
[&](TestMwmBuilder & builder) { builder.AddSafe(poi); });
{
Rules rules = {ExactMatch(id, poi)};
auto const query = holder.GetReadableFeatureType(type, CategoriesHolder::kEnglishCode);
TEST(CategoryMatch(query, categoryIsSearchable ? rules : Rules{}), (query));
}
Rules rules = {ExactMatch(id, poi)};
auto const query = holder.GetReadableFeatureType(type, CategoriesHolder::kEnglishCode);
TEST(CategoryMatch(query, categoryIsSearchable ? rules : Rules{}), (query));
DeregisterMap(countryName);
};