Witajcie.
Ściągnąłem prosty skrypt, dzięki któremu chcę wyświetlić trasę z punkt A do punkt B.
Mam jedynie problem z tym, by mi pod nazwą A i B wyświetliło ich koordynaty(współrzędne) latitude i longitude. Skrypt pobiera te dane automatycznie, ale ja nie potrafię napisać by mi je wyświetliło...

Tekst wyświetla mi teraz tak:
From: England
To: France
Distance: 971810 meters
Time: 34153 seconds
39 steps between from and to address


a chcę żeby było:
From: England
Lat:
Long:
To: France
Lat:
Long:
Distance: 971810 meters
Time: 34153 seconds
39 steps between from and to address


test.php ten plik wyświetla mi dane
  1. <?php
  2. include('googleApiClass.php');
  3. $google = new googleApiClass();
  4.  
  5. $google->setFromAddress('England');
  6. $google->setToAddress('France');
  7. $google->setLanguage('us');
  8. $google->setImageOutput('png');
  9. $google->setZoom(14);
  10. $google->setScale('1');
  11. try{
  12. $pathImg = '/tmp/mapMe.png';
  13. $google->findAddress()->withImage(5,$pathImg);
  14.  
  15. echo "From: ". $google->getFromAddress().'<br>';
  16. echo "To: ". $google->getToAddress().'<br>';
  17. echo "Distance: ".($google->getDistance()).' meters<br>';
  18. echo "Time: ".($google->getTime()).' seconds<br>';
  19. echo " {$google->getCountSteps()} steps between from and to address<br>";
  20. echo "<hr><strong>Steps</strong>";
  21. echo "<pre>";
  22. print_r($google->getInstructions());
  23. echo "</pre>";
  24. if(!$google->getImgBuffer()){
  25. echo "No image was requested";
  26. }else{
  27. echo "Followed Image <br>";
  28. echo "Scale: ".$google->getScale().'<br>';
  29. echo "Center: ".$google->getCenterStep().'<br>';
  30. echo "Zoom: ".$google->getZoom().'<br>';
  31.  
  32. echo "<img src='showimage.php?path={$pathImg}'><br>";
  33.  
  34. }
  35.  
  36.  
  37. }catch(Exception $e ){
  38. echo $e->getMessage();
  39. }
  40.  
  41. ?>



plik googleApiClass.php
http://www.phpclasses.org/browse/file/45336.html