[gnome-maps/wip/mlundblad/less-shoplike-shops] placeIcons: Refine use of shopping cart icon




commit 705e3bc06d4dfd19c73d31ccabc08cad27fd4ae0
Author: Marcus Lundblad <ml update uu se>
Date:   Mon Aug 23 23:11:45 2021 +0200

    placeIcons: Refine use of shopping cart icon
    
    Use the shopping cart icon for more supermarket-
    like place types, as covering all shop= catches
    some cases where it is not as fitting.
    Better fall back to the generic pin icon
    for other shop= tags.

 src/placeIcons.js       | 6 +++++-
 tests/placeIconsTest.js | 5 +++++
 2 files changed, 10 insertions(+), 1 deletion(-)
---
diff --git a/src/placeIcons.js b/src/placeIcons.js
index 9e171976..4ef1303f 100644
--- a/src/placeIcons.js
+++ b/src/placeIcons.js
@@ -99,7 +99,11 @@ const TYPE_ICON_MAP = {
         tram_stop:        'route-transit-tram-symbolic'
     },
     shop: {
-        _:                'shopping-cart-symbolic'
+        convenience:      'shopping-cart-symbolic',
+        department_store: 'shopping-cart-symbolic',
+        general:          'shopping-cart-symbolic',
+        mall:             'shopping-cart-symbolic',
+        supermarket:      'shopping-cart-symbolic'
     },
     tourism: {
         alpine_hut:       'bed-symbolic',
diff --git a/tests/placeIconsTest.js b/tests/placeIconsTest.js
index fb94bd53..076f1a94 100644
--- a/tests/placeIconsTest.js
+++ b/tests/placeIconsTest.js
@@ -50,10 +50,15 @@ function testKnownTypes() {
     let p1 = new MockedPlace({ osmKey: 'amenity', osmValue: 'restaurant' });
     let p2 = new MockedPlace({ osmKey: 'place', osmValue: 'city' });
     let p3 = new MockedPlace({ osmKey: 'amenity', osmValue: 'pub' });
+    let p4 = new MockedPlace({ osmKey: 'shop', osmValue: 'supermarket' });
+    let p5 = new MockedPlace({ osmKey: 'shop', osmValue: 'hairdresser' });
 
     JsUnit.assertEquals('restaurant-symbolic', PlaceIcons.getIconForPlace(p1));
     JsUnit.assertEquals('city-symbolic', PlaceIcons.getIconForPlace(p2));
     JsUnit.assertEquals('pub-symbolic', PlaceIcons.getIconForPlace(p3));
+    JsUnit.assertEquals('shopping-cart-symbolic',
+                        PlaceIcons.getIconForPlace(p4));
+    JsUnit.assertEquals('map-marker-symbolic', PlaceIcons.getIconForPlace(p5));
 }
 
 // test that some unknown type gets the default map marker icon


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]