Mashing Up BT Web21c Location service with Google Maps

This example combines the  two post  (Google Maps API and your location from the sdk)to automatically look up a phones location and then map it straight to a google map box.

The code is below, please note you should only need to change the four variables at the top of the code :
require\_once(dirname(\_\_FILE\_\_) . '/../../web21c.php'); 
require\_once(dirname(\_\_FILE\_\_) . '/../common.php');

//  command to locate a mobile deviice 
//  - set these to sensible values

$deviceId = 'tel:+PHONENUMBER'; 
$password = "YOUR PASSWORD"; 

$web21c = new Web21c($applicationName, $environment);

// login as a user 
$wla = $web21c->WhiteLabelAuthentication(); 
$wla->login($username, $password);

 //  locate mobile 
$location = $web21c->Location(); 
$location->web21cUser = $wla->web21cUser;

 $r = $location->getGeoLocation($deviceId); 
catch (Web21cPermissionDeniedException $e) 
 print "requesting device owner's permission to be located ..n"; 
 print "try again later when the owner may have respondedn"; 
 $access = $web21c->LocationPermission(); 
 $access->web21cUser = $wla->web21cUser; 

// var\_dump($r->geoLocation);

echo 'Longitude : '.$r->geoLocation->longitude. '<br />'; 
echo 'Latitude : '.$r->geoLocation->latitude. '<br />'; 
echo "Click below to see the location of mobile number ".$deviceId."<br />"; 
echo "<a href='".$r->geoLocation->latitude.",%20".$r->geoLocation->longitude."'>Google Maps</a> "; 
//echo 'start : '.$r->getGeoLocation()->getLongitude(); 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
<html xmlns="[]("> 
    <script src="[<?=$googleAPIKey](<?=$googleAPIKey)?>" 

  <body onload="load()" onunload="GUnload()"> 
  <script type="text/javascript">    
  function load() 
   if (GBrowserIsCompatible()) 
    var map = new GMap2(document.getElementById("map"));        
    var map = new GMap2(document.getElementById("map")); 
    map.setCenter(new GLatLng(<?=$r->geoLocation->latitude?>, <?=$r->geoLocation->longitude?>), 13); 
    document.createTextNode("Simon is here ")); 
      <span class="style1">BT SDK Location Service </span></p> 
    <div id="map" style="width: 500px; height: 300px"></div>