3 function formatOSMType($sType, $bIncludeExternal = true)
5 if ($sType == 'N') return 'node';
6 if ($sType == 'W') return 'way';
7 if ($sType == 'R') return 'relation';
9 if (!$bIncludeExternal) return '';
11 if ($sType == 'T') return 'tiger';
12 if ($sType == 'I') return 'way';
17 function osmLink($aFeature, $sRefText = false)
19 $sOSMType = formatOSMType($aFeature['osm_type'], false);
21 return '<a href="//www.openstreetmap.org/'.$sOSMType.'/'.$aFeature['osm_id'].'">'.$sOSMType.' '.($sRefText?$sRefText:$aFeature['osm_id']).'</a>';
26 function wikipediaLink($aFeature)
28 if ($aFeature['wikipedia']) {
29 list($sLanguage, $sArticle) = explode(':', $aFeature['wikipedia']);
30 return '<a href="https://'.$sLanguage.'.wikipedia.org/wiki/'.urlencode($sArticle).'" target="_blank">'.$aFeature['wikipedia'].'</a>';
35 function detailsLink($aFeature, $sTitle = false)
37 if (!$aFeature['place_id']) return '';
39 return '<a href="details.php?place_id='.$aFeature['place_id'].'">'.($sTitle?$sTitle:$aFeature['place_id']).'</a>';