Skip to content

Instantly share code, notes, and snippets.

@Avidid
Created July 29, 2013 18:21
Show Gist options
  • Select an option

  • Save Avidid/6106420 to your computer and use it in GitHub Desktop.

Select an option

Save Avidid/6106420 to your computer and use it in GitHub Desktop.
Display Nominatim search results in a table
<?php if (!$results->error && $results->total != '0'): ?>
<h3>Parks</h3>
<div id="parkData">
<?php $counter = 1 ;?>
<table>
<tr><td><b>#</b></td><td width="150px"><b>Name</b></td><td width="175px"><b>Address</b></td><td width="100px"><b>Distance</b></td></tr>
<?php foreach ($results as &$result): ?>
<tr>
<td><?php echo $counter++ ;?></td>
<td><?php echo $result->address->park;?></td>
<td><?php echo $result->address->road;?></td>
<td><span id="<?php echo $counter++;?>distance" class="ellipsis"></span> Miles</td>
</tr>
<?php endforeach; ?>
<?php unset($result); ?>
</table>
</div>
<?php endif; ?>
<p style="font-size:10px; text-align:right">Nominatim Search Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> <img src="http://developer.mapquest.com/content/osm/mq_logo.png"></p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment