]> git.openstreetmap.org Git - nominatim-ui.git/blobdiff - src/handlebar_helpers.js
API return absolute URLs on /search, relative on /details. Now handle both
[nominatim-ui.git] / src / handlebar_helpers.js
index 77d327e0cc9d5d23e27dde8094a8285cd66f5e75..20ecb7c132711815b073e94bc3e46ce36213adfe 100644 (file)
@@ -91,7 +91,8 @@ Handlebars.registerHelper({
     formatMapIcon: function(sIcon) {
         if (!sIcon) return;
         
-        var url = Nominatim_Config.Images_Base_Url + sIcon;
+        var url = sIcon;
+        if (!url.match(/^http/)) url = get_config_value('Images_Base_Url') + url;
 
         return new Handlebars.SafeString(
             '<img class="mapicon" src="' + url + '" alt="' + sIcon + '"/>'