]> git.openstreetmap.org Git - nominatim-ui.git/blobdiff - src/handlebar_helpers.js
detailpage: add warning if too many child address lines
[nominatim-ui.git] / src / handlebar_helpers.js
index f7997818c516c0ae7d407628b4735e76ff97b323..c86196660daa94ad302691076ba03ba8dd7f8459 100644 (file)
@@ -100,6 +100,19 @@ Handlebars.registerHelper({
             return capitalize(aPlace.type.replace(/_/g, ' '));
         }
     },
+    tooManyParentLinesWarning: function(aPlace) {
+        if (!aPlace.parentof_lines) return;
+
+        var c = 0;
+        for (var type in aPlace.parentof_lines) {
+            c = c + type.length+1;
+        }
+        if (c < 500) return;
+
+        return new Handlebars.SafeString(
+            '<p>There are more child objects which are not shown.</p>'
+        );
+    },
     zoomLevels: function(iSelectedZoom) {
         var aZoomLevels = [
             /*  0 */ 'Continent / Sea',