X-Git-Url: https://git.openstreetmap.org./nominatim-ui.git/blobdiff_plain/c9687b102bb6f544a034dc4d508bf0ae4a5fc221..235fd934dad866eee7c6c1a2428360b6c8d94696:/src/components/MapIcon.svelte

diff --git a/src/components/MapIcon.svelte b/src/components/MapIcon.svelte
index 6a505ff..3892c32 100644
--- a/src/components/MapIcon.svelte
+++ b/src/components/MapIcon.svelte
@@ -1,14 +1,12 @@
 <script>
 
   export let aPlace;
-  import { get_config_value } from '../lib/config_reader.js'
 
-  let sIcon = getIcon(aPlace);
+  $: sIcon = getIcon(aPlace.category, aPlace.type);
+  $: title = 'icon for ' + aPlace.category + ' ' + aPlace.type;
+  $: url = Nominatim_Config.Images_Base_Url + sIcon + '.p.20.png';
 
-  let title = 'icon for ' + aPlace.category + ' ' + aPlace.type;
-  let url = get_config_value('Images_Base_Url') + sIcon + '.p.20.png';
-
-  function getIcon(aPlace) {
+  function getIcon(category, type) {
     // equivalent to PHP Nominatim::ClassTypes::getIcon
     // covers 83 of 214 available icon filenames, e.g. transport_roundabout_anticlockwise
     // transport_rental_bicycle or place_of_worship_christian would need more data from
@@ -99,9 +97,7 @@
       'highway:bus_stop': 'transport_bus_stop2'
     };
 
-    var sCategoryPlace = aPlace.category + ':' + aPlace.type;
-
-    return aIcons[sCategoryPlace];
+    return aIcons[category + ':' + type];
   }
 
 </script>
