]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/output.php
move checkModilePresence to class, delete own debug echo
[nominatim.git] / lib / output.php
index 983e34406e0f3f6502562ff5f8121546ee8a8ee2..9d4b7502c855044c6859bae36f1d291897ab20c7 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 
+
 function formatOSMType($sType, $bIncludeExternal = true)
 {
     if ($sType == 'N') return 'node';
@@ -8,7 +9,7 @@ function formatOSMType($sType, $bIncludeExternal = true)
 
     if (!$bIncludeExternal) return '';
 
-    if ($sType == 'T') return 'tiger';
+    if ($sType == 'T') return 'way';
     if ($sType == 'I') return 'way';
 
     return '';
@@ -39,3 +40,13 @@ function detailsLink($aFeature, $sTitle = false)
     return '<a href="details.php?place_id='.$aFeature['place_id'].'">'.($sTitle?$sTitle:$aFeature['place_id']).'</a>';
 }
 
+function detailsPermaLink($aFeature, $sRefText = false)
+{
+    $sOSMType = formatOSMType($aFeature['osm_type'], false);
+
+    if ($sOSMType) {
+        $sLabel = $sRefText ? $sRefText : $sOSMType.' '.$aFeature['osm_id'];
+        return '<a href="details.php?osmtype='.$aFeature['osm_type'].'&osmid='.$aFeature['osm_id'].'&class='.$aFeature['class'].'">'.$sLabel.'</a>';
+    }
+    return '';
+}