<?php
+
function formatOSMType($sType, $bIncludeExternal = true)
{
if ($sType == 'N') return 'node';
if (!$bIncludeExternal) return '';
- if ($sType == 'T') return 'tiger';
+ if ($sType == 'T') return 'way';
if ($sType == 'I') return 'way';
return '';
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 '';
+}