-<?php
- if ($sQuery || sizeof($aSearchResults))
- {
-?>
- <div id="searchresultsfade1"></div><div id="searchresultsfade2"></div><div id="searchresultsfade3"></div><div id="searchresultsfade4"></div>
- <div id="searchresults">
-<?php
- if ($sSuggestionURL)
- {
- echo '<div class="more"><b>Suggest: </b><a href="'.$sSuggestionURL.'"><b>'.$sSuggestion.'</b></a></div>';
- }
- foreach($aSearchResults as $iResNum => $aResult)
- {
- if ($aResult['aBoundingBox'])
- {
- echo '<div class="result" onClick=\'panToLatLonBoundingBox('.$aResult['lat'].', '.$aResult['lon'];
- echo ', '.$aResult['aBoundingBox'][0];
- echo ', '.$aResult['aBoundingBox'][1];
- echo ', '.$aResult['aBoundingBox'][2];
- echo ', '.$aResult['aBoundingBox'][3];
- if (isset($aResult['astext'])) echo ', "'.$aResult['astext'].'"';
- echo ");'>\n";
- }
- elseif (isset($aResult['zoom']))
- {
- echo '<div class="result" onClick="panToLatLonZoom('.$aResult['lat'].', '.$aResult['lon'].', '.$aResult['zoom'].');">';
- }
- else
- {
- echo '<div class="result" onClick="panToLatLon('.$aResult['lat'].', '.$aResult['lon'].');">';
- }
-
- echo (isset($aResult['icon'])?'<img alt="icon" src="'.$aResult['icon'].'"/>':'');
- echo ' <span class="name">'.$aResult['name'].'</span>';
- echo ' <span class="latlon">'.round($aResult['lat'],3).','.round($aResult['lon'],3).'</span>';
- echo ' <span class="place_id">'.$aResult['place_id'].'</span>';
- if (isset($aResult['label']))
- echo ' <span class="type">('.$aResult['label'].')</span>';
- else
- echo ' <span class="type">('.ucwords(str_replace('_',' ',$aResult['type'])).')</span>';
- echo ' <span class="details">(<a href="details.php?place_id='.$aResult['place_id'].'">details</a>)</span>';
- echo '</div>';
- }
- if (sizeof($aSearchResults))
- {
- if ($sMoreURL)
- {
- echo '<div class="more"><a href="'.htmlentities($sMoreURL).'">Search for more results</a></div>';
- }
- }
- else
- {
- echo '<div class="noresults">No search results found</div>';
- }