I don't know what I did but now when it loads, there is no map appearing initially at all. It's only when you fill in the form and select a destination that the map appears along with the driving instructions.
In step 2 of 5 of the wizard, I have all the addresses populated with the rstDestinations recordset.
If this is the case one thing you can do to account for that would be to set the default value of your filter to be a record id from your locations table for the location you would like to see as the default.
How do I do this?
The following is the php code at the top of my document:
<?php require_once('../Connections/locations.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_locations, $locations);
$query_rstLocations = "SELECT * FROM locations ORDER BY store ASC";
$rstLocations = mysql_query($query_rstLocations, $locations) or die(mysql_error());
$row_rstLocations = mysql_fetch_assoc($rstLocations);
$totalRows_rstLocations = mysql_num_rows($rstLocations);
$colname_rstDestination = "-1";
if (isset($_POST['location'])) {
$colname_rstDestination = (get_magic_quotes_gpc()) ? $_POST['location'] : addslashes($_POST['location']);
}
mysql_select_db($database_locations, $locations);
$query_rstDestination = sprintf("SELECT locationID, store, street, suburb, `state`, postcode, Country FROM locations WHERE locationID = %s", GetSQLValueString($colname_rstDestination, "int"));
$rstDestination = mysql_query($query_rstDestination, $locations) or die(mysql_error());
$row_rstDestination = mysql_fetch_assoc($rstDestination);
$totalRows_rstDestination = mysql_num_rows($rstDestination);
?>