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);
22 return '<a href="//www.openstreetmap.org/'.$sOSMType.'/'.$aFeature['osm_id'].'">'.$sOSMType.' '.($sRefText?$sRefText:$aFeature['osm_id']).'</a>';
27 function wikipediaLink($aFeature)
29 if ($aFeature['wikipedia'])
31 list($sLanguage, $sArticle) = explode(':',$aFeature['wikipedia']);
32 return '<a href="https://'.$sLanguage.'.wikipedia.org/wiki/'.urlencode($sArticle).'" target="_blank">'.$aFeature['wikipedia'].'</a>';
37 function detailsLink($aFeature, $sTitle=false)
39 if (!$aFeature['place_id']) return '';
41 return '<a href="details.php?place_id='.$aFeature['place_id'].'">'.($sTitle?$sTitle:$aFeature['place_id']).'</a>';