Map

How to Display GPS Coordinate in Listing Page of phpMyDirectory

If you are using phpMyDirectory and would like to display GPS Coordinate in listing page, this is the modification required.

To do this, 2 files have to be modified,

  1. listing.php -> located in the root of phpMyDirectory installation
  2. listing_default.tpl -> located in template directory

listing.php

Search following code,

$template_content->set('map',$map_output);

Add the following codes directly below

$template_content->set('latitude',$listing['latitude']);
$template_content->set('longitude',$listing['longitude']);

and save it.

listing_default.tpl

Search following code,

<?php echo $map; ?>

Add the following codes directly above it,

<h2>GPS Coordinate, Location and Map</h2>
<strong>Latitude : </strong><?php echo $latitude; ?><br />
<strong>Longitude : </strong><?php echo $longitude; ?><br /><br />

and save it.