Пример #1
0
            $ex = makeSane($_GET['ex'], 1);
            $an = makeSane($_GET['an'], 1);
            if (!$w) {
                $w = 2;
            }
            if (!$c) {
                $c = "ff0000";
            }
            if (!$ex) {
                $ex = 1;
            }
            DEBUG("DL", 1, "Will serve flight {$flightID}<BR>");
            $flight = new flight();
            $flight->getFlightFromDB($flightID);
            // $getFlightKML=$flight->getFlightKML()."&c=$c&ex=$ex&w=$w&an=$an";
            $getFlightKML = "http://" . str_replace('//', '/', $_SERVER['SERVER_NAME'] . "/{$baseInstallationPath}/" . $flight->getKMLRelPath(0));
            $KMLlineColor = "ff" . substr($c, 4, 2) . substr($c, 2, 2) . substr($c, 0, 2);
            $xml = '<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2"
 xmlns:gx="http://www.google.com/kml/ext/2.2">
 ' . "<NetworkLinkControl>\n  <Update>\n    <targetHref>" . str_replace("&", "&amp;", $getFlightKML) . "</targetHref>\n    <Change>\n      <Style targetId='#Track1'>\t  \t\t\t\t\t\n\t\t<LineStyle>\n\t\t  <color>{$KMLlineColor}</color>\n\t\t  <width>{$w}</width>\n\t\t</LineStyle>\n\t </Style>\n\t <Style targetId='#Track2'>\t  \t\t\t\t\t\n\t\t<LineStyle>\n\t\t  <color>{$KMLlineColor}</color>\n\t\t  <width>{$w}</width>\n\t\t</LineStyle>\n\t </Style>\n    </Change>\n  </Update>\n</NetworkLinkControl>\n</kml>";
            //echo $xml;
            //exit;
        } else {
            if ($type == "kml_trk") {
                $moduleRelPath = moduleRelPath(0);
                $waypointsWebPath = $moduleRelPath . "/" . $waypointsRelPath;
                $flightID = makeSane($_REQUEST['flightID'], 1);
                //echo $_SERVER['QUERY_STRING'];
                $w = makeSane($_GET['w'], 1);
                $c = makeSane($_GET['c']);
	map.addControl(new GMapTypeControl());
	map.setCenter (new GLatLng(0,0), 4, <?php 
echo $GMapType;
?>
);
/*
TODO move to API v3 !!!!
*/

	//var kmlOverlay = new GGeoXml("http://pgforum.thenet.gr/modules/leonardo/download.php?type=kml_task&flightID=14142&t=a.kml");
	// var kmlOverlay = new GGeoXml("http://pgforum.thenet.gr/modules/leonardo/download.php?type=kml_trk&flightID=14722&lang=english&w=2&c=FF0000&an=1&t=a.kml");
	// var kmlOverlay = new GGeoXml("http://pgforum.thenet.gr/1.kml");
	// map.addOverlay(kmlOverlay);

	<?php 
$kmz = $_SERVER['SERVER_NAME'] . "/{$baseInstallationPath}/" . $flight->getKMLRelPath(0);
$kmz = str_replace('//', '/', $kmz);
$kmz = str_replace('//', '/', $kmz);
$flightKMZ = "http://" . $kmz;
?>
	var kmlOverlay = new GGeoXml("<?php 
echo $flightKMZ;
?>
");
	
	map.addOverlay(kmlOverlay);
	
	var tp = <?php 
echo $flight->gMapsGetTaskJS();
?>
 ;