Show stores on google map

Name
showGoogleMap($divid, $startrecordno, $perpagerecord, $sortby, $markerIconPath, $custom, $longitudelatitudestring, $tooltipstring)
Example
<?php
require_once(‘eMaxApi.class.php’);
?>
<html>
<head>
<script language=”javascript” type=”text/javascript”>
var googleKey=’<?php echo googleAPIKey; ?>’;
</script>
<script type=”text/javascript” language=”javascript” src=”http://maps.google.com/maps?file=api&amp;v=2&amp;key=”+googleKey+”&amp;sensor=true”></script>
</head>
<body>
<?php
$emax = new eMaxClient;
$emax->zipcode = $zipcode; //mandatory when custom parameter = 0
$emax->miles = $miles; // optional
$emax->city = $city;  // optional
$emax->state = $state;  // optional
$emax->country = $country;  // optional
$emax->store = $storename;  // optional
$emax->product = $productname; // optional
$emax->category = $category;  // optional
?>
<div id=”divshowgooglemap”>
<?php
$emax->showGoogleMap($divid, $startrecordno, $perpagerecord, $sortby, $markerIconPath, $custom, $longitudelatitudestring, $tooltipstring);
?>
</div>
</body>
</html>
Description
Prerequisites using showGoogleMap function : 

1. Your googleAPIKey must be defined in eMaxApi.Config.php file. You can obtain your Google API Key from your Google account. Click here to know how to obtain it.
2. You must add two javascript scripts blocks in head of your html as shown in the example. Here are the two blocks for your reference.

<script type=”text/javascript”>
var googleKey=”<?php echo googleAPIKey; ?>”;
</script>
<script type=”text/javascript” src=”http://maps.google.com/maps?file=api&amp;v=2&amp;key=”+googleKey+”&amp;sensor=true”></script>

Variables :

This function needs the same variable initialized as for the listStores. Click here to see the listStores function reference.

Parameters :

$divid (required)
Type (String), Value (ID of the element (div,span))
- Specify the ID of the element (div, span) in which you want the Google map to display.

$custom (optional)
Type (Binary), Default (0), Value (1 for custom 0 for default)
- Set $custom 1 if you want locations specified in an array by you and not the stores of the eMax API. Don’t set this variable if you are unsure.

$startrecordno (required when $custom is 0 otherwise optional)
Type (Integer), Default (0), Value (Any Number)
- This parameter is used if you want to show stores on google map in pages. For example, You can set it to 0 and perpagerecod (see the next parameter) to 5 to show the stores 0-5 from eMax API data.

$perpagerecord (required when $custom is 0 otherwise optional)
Type (Integer), Default (5), Value (Any Number)
- This parameter is used if you want to show stores on google map in pages. For example, You can set startrecordno (see the parameter explained above) to 5 and this to 5 to show the stores 5-9 from eMax API data.

$sortby (optional)
Type (String), Default (“DISTANCE”), Value (“STORENAME”, “ADDRESS”, “CITY”, “ZIPCODE”, “DISTANCE”)
- The google API has facility to number the markers. Setting $sortby will number the markers based on the value of it. Default is “DISTANCE”. Don’t set this if you are unsure.

$markerIconPath (optional)
Type (String), Default (“path to default eMax Marker graphic”), Value (The full Web url (including http) of the marker graphic)
- Set complete URL of your marker graphic if you want to use your own Marker graphic. e.g. http://www.yourdomain.com/images/mapMarker.png

$longitudelatitudestring (optional if $custom is 0 required if $custom is 1)
Type (String), Value (latidue1:longitude1,…,latitude5:longitude5)
- Set this string if you want to display your own markers independent of eMax API data. You need to specify latitude and longitude for each store separated by colon (:) and each store separated by comma (,). e.g.”latitude1:longitude1,latitude2:longitude2…”

$tooltipstring (optional if $custom is 0 required if $custom is 1)
Type (String), Value (htmlmessage1@#@…@#@htmlmessage5)
- Set this value if you want to display your own markers independent of eMax API data. You need to specify the html code of each store in order of entering the longitude:latitude set in above parameter separated by @#@. e.g.”htmlmessage1@#@htmlmessage2…”
on Google Map with custom Google Map marker icon.
Summary
Function displays google MAP with those stores marked on the map for which the zip code search is carried out.
eMax Store locator software
eMax Store locator software