X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/e1be3d9f48b51a927c26d1ac0035b50b82423916..c61b5219f9eeb48b09d5e74e1f5afc5a955682b9:/lib/output.php
diff --git a/lib/output.php b/lib/output.php
index 58f00091..823a6631 100644
--- a/lib/output.php
+++ b/lib/output.php
@@ -9,9 +9,11 @@ function formatOSMType($sType, $bIncludeExternal = true)
if (!$bIncludeExternal) return '';
- if ($sType == 'T') return 'tiger';
+ if ($sType == 'T') return 'way';
if ($sType == 'I') return 'way';
+ // not handled: P, L
+
return '';
}
@@ -33,9 +35,39 @@ function wikipediaLink($aFeature)
return '';
}
-function detailsLink($aFeature, $sTitle = false)
+function detailsLink($aFeature, $sTitle = false, $sExtraProperties = false)
{
if (!$aFeature['place_id']) return '';
- return ''.($sTitle?$sTitle:$aFeature['place_id']).'';
+ $sHtml = ''.($sTitle?$sTitle:$aFeature['place_id']).'';
+
+ return $sHtml;
+}
+
+function detailsPermaLink($aFeature, $sRefText = false, $sExtraProperties = false)
+{
+ $sOSMType = formatOSMType($aFeature['osm_type'], false);
+
+ if ($sOSMType) {
+ $sHtml = '';
+
+ if ($sRefText) {
+ $sHtml .= $sRefText.'';
+ } else {
+ $sHtml .= $sOSMType.' '.$aFeature['osm_id'].'';
+ }
+
+ return $sHtml;
+ }
+ return detailsLink($aFeature, $sRefText, $sExtraProperties);
}