PHP Classes

No class found?

Recommend this page to a friend!

      KML Generator  >  All threads  >  No class found?  >  (Un) Subscribe thread alerts  
Subject:No class found?
Summary:Fatal error: Class 'kml' not found in C:\wamp\www\kmlgenerator\e
Messages:4
Author:serkan
Date:2007-08-31 22:14:51
Update:2007-09-10 11:51:20
 

 


  1. No class found?   Reply   Report abuse  
Picture of serkan serkan - 2007-08-31 22:14:52
Do I have to configure something?

sName = $sName; $this->sHeader = ''; $this->sHeader .= ''; $this->sHeader .= " $sName"; /** * To change the style generate kml in google eath y paste in the next * line the header style. */ $this->sHeader .= " "; $this->sFooter .= " "; $this->sFooter .= ''; } /** * Add element to kml file */ function addElement($sElement) { $this->sBody .= $sElement; } /** * Print kml, change the header to open Google earth */ function export() { header('Content-type: application/keyhole'); //Para que modifique el nombre de lo que baja se agrega la siguiente línea. header('Content-Disposition:atachment; filename="' . $this->sName . '.kml"'); //Para que cuando se baje el archivo el cliente IE y/o FireFox pregunte si bajar o guardar el archivo. //Hay que agregar al header Content-Disposition:atachment $sKml = $this->sHeader . $this->sBody . $this->sFooter; header('Content-Length: ' . strlen($sKml)); header('Expires: 0'); header('Pragma: cache'); header('Cache-Control: private'); echo $sKml; } /** * Add point to kml file * @param int $lat latitude * @param int $lon longitude * @param int $alt altitude * @param string $tit title of point * @param string $des description of point * @param string $sLayer style of point default '' */ function addPoint($lon, $lat, $alt, $tit, $des, $sLayer = '') { $sResponse = ''; $sResponse .= "$des"; $sResponse .= "$tit"; $sResponse .= '1'; $sResponse .= "#$sLayer"; $sResponse .= ''; $sResponse .= "$lon,$lat,$alt"; $sResponse .= ''; $sResponse .= ''; $this->addElement($sResponse); } /** * Add line to kml file * @param array $puntos poits of line array of array('lat'=>num,'lon'=>num,'alt'=num) * @param string $tit title of line * @param string $des description of line * @param string $sLayer style of line default '' */ function addLine($puntos, $tit, $des, $sLayer = '') { $sResponse = ""; $sResponse .= "$tit"; $sResponse .= "$des"; $sResponse .= "#$sLayer"; $sResponse .= ""; $sResponse .= "1"; $sResponse .= ""; $primero = true; foreach ($puntos as $key => $punto) { if ($primero) { $sResponse .= $punto['lon'] . "," . $punto['lat'] . "," . $punto['alt']; $primero = false; } else $sResponse .= " " . $punto['lon'] . "," . $punto['lat'] . "," . $punto['alt']; } $sResponse .= ""; $sResponse .= ""; $sResponse .= ""; $this->addElement($sResponse); } /** * Add Polygon * @param array $puntos poits of polygon array of array('lat'=>num,'lon'=>num,'alt'=num) * @param string $tit title of polygon * @param string $des description of polygon * @param string $sLayer style of polygon default '' */ function addPolygon($puntos, $tit, $des, $sLayer = '') { $sResponse = ""; $sResponse .= "$tit"; $sResponse .= "#$sLayer"; $sResponse .= ""; $sResponse .= "1"; $sResponse .= " "; $primero = true; foreach ($puntos as $key => $punto) { if ($primero) { $sResponse .= $punto['lon'] . "," . $punto['lat'] . "," . $punto['alt']; $primero = false; } else $sResponse .= " " . $punto['lon'] . "," . $punto['lat'] . "," . $punto['alt']; } $sResponse .= " "; $this->addElement($sResponse); } /** * Add Link * @param string $link link to file * @param string $tit title of link * @param string $sLayer style of link default '' */ function addLink($link, $tit) { $aScript = explode('/', $_SERVER[SCRIPT_NAME]); array_pop($aScript); $sScript = implode('/', $aScript); $sLink = "http://" . $_SERVER[SERVER_NAME] . "/" . $sScript . "/$link"; $sResponse = ""; $sResponse .= "$tit"; $sResponse .= " $sLink onInterval onRequest "; //echo $sResponse; $this->addElement($sResponse); } /** * Add SreenOverlay * @param string $link link to logo file * @param string $tit title of logo */ function addScreenOverlay($link, $tit) { $aScript = explode('/', $_SERVER[SCRIPT_NAME]); array_pop($aScript); $sScript = implode('/', $aScript); $sLink = "http://" . $_SERVER[SERVER_NAME] . "/" . $sScript . "/$link"; $sResponse = ""; $sResponse .= "$tit"; $sResponse .= " $sLink "; //echo $sResponse; $this->addElement($sResponse); } } ?>
Fatal error: Class 'kml' not found in C:\wamp\www\kmlgenerator\exampleLink.php on line 6

  2. Re: No class found?   Reply   Report abuse  
Picture of Pablo Kogan Pablo Kogan - 2007-09-03 11:48:48 - In reply to message 1 from serkan
The class kml is the kml.class.php. This file has been included if you have to use the kml class.


  3. Re: No class found?   Reply   Report abuse  
Picture of serkan serkan - 2007-09-07 23:41:40 - In reply to message 2 from Pablo Kogan
I had included it, that is definitely not the problem. I think it is not referencing it somehow, I will respond once I have more time to figure out why this may be.

  4. Re: No class found?   Reply   Report abuse  
Picture of Pablo Kogan Pablo Kogan - 2007-09-10 11:51:20 - In reply to message 3 from serkan
The code in the first mail is not the publicated code class.kml.php
phpclasses.org/browse/file/20200.ht ...
You don't have change nothing to run the example.