PHP Classes

Marcus Brazzia

Recommend this page to a friend!

      PHP Google Driving Directions  >  All threads  >  Marcus Brazzia  >  (Un) Subscribe thread alerts  
Subject:Marcus Brazzia
Summary:PHP Google Driving Directions
Messages:7
Author:Felip Estrugo
Date:2013-05-02 19:05:37
Update:2013-06-04 12:34:07
 

  1. Marcus Brazzia   Reply   Report abuse  
Picture of Felip Estrugo Felip Estrugo - 2013-05-02 19:05:38
Hi,

I'm testing your class and I have some problemes to echo the image.

Many Thanks,

  2. Re: Marcus Brazzia   Reply   Report abuse  
Picture of Marcus Brasizza Marcus Brasizza - 2013-05-02 20:34:57 - In reply to message 1 from Felip Estrugo
The image need to be in a folder that you can access in your system.

You can put a folder in your www/maps
chmod 777 maps and then the path you put the map.

just let me know if you have another issue!

Thanks!

  3. Re: Marcus Brazzia   Reply   Report abuse  
Picture of Marcus Brasizza Marcus Brasizza - 2013-05-02 20:38:23 - In reply to message 1 from Felip Estrugo
you can do like this

with a folder maps in your public_html (www) with chmod 777 ...
i just put the php file to read the image because i didn't put the image in my public_html folder


<?php
include('googleApiClass.php');
$google = new googleApiClass();

$google->setFromAddress('England');
$google->setToAddress('France');
$google->setLanguage('us');
$google->setImageOutput('png');
$google->setZoom(14);
$google->setScale('1');
try{
$pathImg = 'maps/mapMe.png';
$google->findAddress()->withImage(5,$pathImg);

echo "From: ". $google->getFromAddress().'<br>';
echo "To: ". $google->getToAddress().'<br>';
echo "Distance: ".($google->getDistance()).' meters<br>';
echo "Time: ".($google->getTime()).' seconds<br>';
echo " {$google->getCountSteps()} steps between from and to address<br>";
echo "<hr><strong>Steps</strong>";
echo "<pre>";
print_r($google->getInstructions());
echo "</pre>";
if(!$google->getImgBuffer()){
echo "No image was requested";
}else{
echo "Followed Image <br>";
echo "Scale: ".$google->getScale().'<br>';
echo "Center: ".$google->getCenterStep().'<br>';
echo "Zoom: ".$google->getZoom().'<br>';

echo "<img src='{$pathImg}'><br>";

}


}catch(Exception $e ){
echo $e->getMessage();
}

?>

  4. Re: Marcus Brazzia   Reply   Report abuse  
Picture of Felip Estrugo Felip Estrugo - 2013-05-03 08:14:45 - In reply to message 3 from Marcus Brasizza
Thanks a lot

  5. Re: Marcus Brazzia   Reply   Report abuse  
Picture of larry larry - 2013-06-04 04:31:47 - In reply to message 1 from Felip Estrugo
Can you provide how to use your CLASS, is there anyway to use in local?

  6. Re: Marcus Brazzia   Reply   Report abuse  
Picture of Marcus Brasizza Marcus Brasizza - 2013-06-04 12:34:07 - In reply to message 5 from larry
I don't understand what you mean with 'local'.
you'll need the internet connection to use the google api.

you can use the code in the example of this class.

  7. Re: Marcus Brazzia   Reply   Report abuse  
Picture of Eduardo Brennan Eduardo Brennan - 2016-12-01 00:28:19 - In reply to message 3 from Marcus Brasizza
Hi Marcus.
I test U script but I have two problems.

1) The image nor appear, I créate maps directory and up the mapMe.png but to bottom not appear the image.

2) The steps appear how to XML structure...

Thanks for U help