To change Google Map Type in listing details of phpMyDirectory from the default “ROADMAP” is very easy. You only to edit “/includes/class_map.php” file.
Find the following
MapTypeId.HYBRID
Replace it with any of 4 options below, depending on your map selection.
- MapTypeId.ROADMAP – displays the default road map view. This is the default map type.
- MapTypeId.SATELLITE – displays Google Earth satellite images
- MapTypeId.HYBRID – displays a mixture of normal and satellite views
- MapTypeId.TERRAIN – displays a physical map based on terrain information.
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,
- listing.php -> located in the root of phpMyDirectory installation
- 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.