Esempio n. 1
0
 /**
  * Loads the given KML file
  *
  * @param  string $kmlFilename The file to be loaded
  * @param  string $regionName  The name of the region. If omitted the filename will be used as the region name
  *
  * @return boolean Success
  */
 public function loadRegion($kmlFilename, $regionName = null)
 {
     $data = null;
     if ($this->php->file_exists($kmlFilename)) {
         $data = $this->php->file_get_contents($kmlFilename);
     }
     if (!$data) {
         throw new GeoDataException("Error reading file {$kmlFilename}", 4002);
     }
     if (!$regionName) {
         $regionName = $this->php->basename($kmlFilename, '.kml');
     }
     return $this->loadRegionData($data, $regionName);
 }