Add resorts to accommodation category, add icon #95
@@ -160,6 +160,7 @@ export const POI_ICON_RULES = [
|
||||
{ tags: { tourism: 'hostel' }, icon: 'person-sleeping-in-bed' },
|
||||
{ tags: { tourism: 'motel' }, icon: 'person-sleeping-in-bed' },
|
||||
{ tags: { tourism: 'guest_house' }, icon: 'person-sleeping-in-bed' },
|
||||
{ tags: { leisure: 'resort' }, icon: 'person-sleeping-in-bed' },
|
||||
|
||||
// Sports / Motorsports
|
||||
{ tags: { sport: 'motor' }, icon: 'flag-checkered' },
|
||||
|
||||
@@ -55,7 +55,10 @@ export const POI_CATEGORIES = [
|
||||
id: 'accommodation',
|
||||
label: 'Hotels',
|
||||
icon: 'person-sleeping-in-bed',
|
||||
filter: ['["tourism"~"^(hotel|hostel|motel|chalet|guest_house)$"]'],
|
||||
filter: [
|
||||
'["tourism"~"^(hotel|hostel|motel|chalet|guest_house)$"]',
|
||||
'["leisure"="resort"]',
|
||||
],
|
||||
types: ['node', 'way', 'relation'],
|
||||
},
|
||||
];
|
||||
|
||||
@@ -38,6 +38,11 @@ module('Unit | Utility | osm-icons', function () {
|
||||
assert.strictEqual(result, null);
|
||||
});
|
||||
|
||||
test('it returns person-sleeping-in-bed for leisure=resort', function (assert) {
|
||||
let result = getIconNameForTags({ leisure: 'resort' });
|
||||
assert.strictEqual(result, 'person-sleeping-in-bed');
|
||||
});
|
||||
|
||||
test('all icons used in POI_ICON_RULES exist in the icons utility', function (assert) {
|
||||
for (let rule of POI_ICON_RULES) {
|
||||
let icon = getIcon(rule.icon);
|
||||
|
||||
@@ -35,4 +35,11 @@ module('Unit | Utility | poi-category-matcher', function () {
|
||||
|
||||
assert.ok(categoryIds.includes('things-to-do'));
|
||||
});
|
||||
|
||||
test('leisure=resort matches accommodation category', function (assert) {
|
||||
const tags = { leisure: 'resort' };
|
||||
const categoryIds = getMatchingPoiCategoryIds(tags, POI_CATEGORIES);
|
||||
|
||||
assert.ok(categoryIds.includes('accommodation'));
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user