Google Map

How to Change Google Map Type in phpMyDirectory

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.

  1. MapTypeId.ROADMAP – displays the default road map view. This is the default map type.
  2. MapTypeId.SATELLITE – displays Google Earth satellite images
  3. MapTypeId.HYBRID – displays a mixture of normal and satellite views
  4. MapTypeId.TERRAIN – displays a physical map based on terrain information.

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.