]> git.openstreetmap.org Git - nominatim-ui.git/commitdiff
MapIcon: make sure title and url get updated when place changes (#131)
authormtmail <mtmail@gmx.net>
Mon, 19 Apr 2021 15:55:51 +0000 (17:55 +0200)
committerGitHub <noreply@github.com>
Mon, 19 Apr 2021 15:55:51 +0000 (17:55 +0200)
src/components/MapIcon.svelte

index 46c01a21b37be3651041a0a26c6b0ea0035e8518..3892c32f127d39411a3589337cbadd939f7aa9d1 100644 (file)
@@ -2,10 +2,9 @@
 
   export let aPlace;
 
-  let sIcon = getIcon(aPlace.category, aPlace.type);
-
-  let title = 'icon for ' + aPlace.category + ' ' + aPlace.type;
-  let url = Nominatim_Config.Images_Base_Url + sIcon + '.p.20.png';
+  $: sIcon = getIcon(aPlace.category, aPlace.type);
+  $: title = 'icon for ' + aPlace.category + ' ' + aPlace.type;
+  $: url = Nominatim_Config.Images_Base_Url + sIcon + '.p.20.png';
 
   function getIcon(category, type) {
     // equivalent to PHP Nominatim::ClassTypes::getIcon