Différences entre les versions de « Atlas 380/iPad/notreavion.net »

Aller à la navigation Aller à la recherche
1 583 octets supprimés ,  29 mars 2015 à 14:54
Ligne 92 : Ligne 92 :
<syntaxhighlight lang="php">
<syntaxhighlight lang="php">
<!DOCTYPE HTML>
<!DOCTYPE HTML>
<!--Page d'affichage de la carte animée avec les icones des terrains-->
<html lang="fr">
<html>
 
<!--Feuille de calcul du fichier KML et d'affichage des options d'envoi-->
 
<head>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Carte interactive</title>
<title>Résultat FAR-KML</title>
<link rel="stylesheet" type="text/css" href="style.css"/>
<link rel="stylesheet" type="text/css" href="style.css">
       
</head>


        <!--Appel de l'API MapQuest - Le paramètre key est propriétaire du site-->
<body>
<script src="http://open.mapquestapi.com/sdk/js/v7.2.s/mqa.toolkit.js?key=Fmjtd%7Cluurnu0125%2Cbs%3Do5-9w8lgw"></script>
<!--Routine d'affichage Plein Ecran : facultatif-->
<script src="http://www.notreavion.net/convert/screenfull.js"></script>
<!--Appel API Google pour les polices de caratères des listes déroulantes-->
<link href='http://fonts.googleapis.com/css?family=Raleway:400,300,700' rel='stylesheet' type='text/css'>
<!--Feuilles de style des listes déroulantes-->
<link rel="stylesheet" type="text/css" href="SelectInspiration/css/normalize.css" />
<link rel="stylesheet" type="text/css" href="SelectInspiration/css/cs-select.css" />
<link rel="stylesheet" type="text/css" href="SelectInspiration/css/cs-skin-underline.css" />
<!--définition des styles des informations Pop-up des épinglettes-->
<style type="text/css">
            .mqabasicwnd-corner div, .mqabasicwnd-close, .mqabasicwnd-close:hover, .mqabasicwnd-pointer-bottom, .mqabasicwnd-pointer-top, .mqabasicwnd-pointer-left, .mqabasicwnd-pointer-middleLeft, .mqabasicwnd-pointer-middleRight, .mqabasicwnd-pointer-topLeft, .mqabasicwnd-pointer-topRight, .mqabasicwnd-pointer-bottomLeft, .mqabasicwnd-pointer-bottomRight, .mqabasicwnd-btop div, .mqabasicwnd-bbottom div, .mqabasicwnd-bleft div, .mqabasicwnd-bright div {
                background-image: url('http://www.notreavion.net/convert/images/myinfow.png') !important;
            }
     
.mqabasicwnd {
font-size : 10px !important;
                width: 200px !important;
}


            .mqabasicwnd-close {
                top: 0px !important;
                right: -18px !important;
                width: 18px !important;
                height: 20px !important;
            }
          .mqa_htmlpoi {
font-size :8px;
        </style>


<?php
<!--Création de la carte--->
 
<script type="text/javascript">


var myfile="/convert/"+ getURLParameter('file');
 
if (!$route= $_POST["name"]) // récupère la route
{ // la route est vide!!!
//Message si route vide
echo "<p class='error'>ERREUR : Vous n'avez rien collé !!!!!!!</p>";
echo "<hr>";
echo '<br><br><button type ="button" class="btn" onclick="window.history.back();">Retour</button>&nbsp;&nbsp;&nbsp;';
echo '<button type ="button" class="btn" style= "padding: 10px 15px 10px 15px;" onclick="location.href=\'help.html\'">?</button>';
exit;
}


function getURLParameter(name) {                        <!--Le nom du fichier est dans l'URL demandeuse, fonction de recherche de ce nom de fichier
$mytype=$_POST['typeroute'];
  return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null
}


$route;


$fc="(\b[N|S].{6}[W|E].{7}\b)"; //format des coordonnées mot entier uniquement
MQA.EventUtil.observe(window, 'load', function() {
$rempl = "latitudlongitud";
$routebis=preg_replace($fc,$rempl,$route); //remplace les coordonnées par texte pour analyse et recherche


<!--Taille de la carte en fonction de la taille d'affichage du navigateur-->
$posdeb=strpos($routebis,$rempl);     //position premières coordonnées
var intFrameWidth = window.innerWidth;
var newwidth = Math.max(window.innerWidth - 280,700);
var newheight= Math.max(window.innerHeight - 80,440) ;
document.getElementById('map').setAttribute("style","float:left;width:"+newwidth+"px"+";height :"+newheight+"px;");
<!--Affiche le sablier
document.getElementById('info').innerHTML= "<h4><br><br>Un peu de patience<br><br><br>&nbsp;&nbsp;&nbsp;<img src='../convert/images/ajax-loader.gif'></h4>";




var options = {
elt: document.getElementById('map'),      <!--ID of map element on page-->
zoom: 2,                                  <!-- initial zoom level of the map-->
latLng: { lat: 49, lng: 2.5 }    <!--center of map in latitude/longitude-->
};


<!--construct an instance of MQA.TileMap with the options object-->
if (stripos($_SERVER['HTTP_USER_AGENT'],"iPad")){    // si appel depuis IPAD, il faut enlever un caractère supplémentaire?????
window.map = new MQA.TileMap(options);
$offset =6;
}
else {
$offset=5;
}


<!--Download the modules.-->
<!--The MQA.KMLDeserializer can also create InfoWindows if the data is supplied.-->
MQA.withModule('dotcomwindowmanager', 'remotecollection', 'kmldeserializer','mousewheel','largezoom','viewoptions','htmlpoi', function() {


$route=substr($route,$posdeb-$offset);
map.addControl( <!--Ajout Zoom, choix du type de carte, navigation-->
new MQA.LargeZoom(),
new MQA.MapCornerPlacement(MQA.MapCorner.TOP_LEFT, new MQA.Size(5,5))
);
map.addControl(new MQA.ViewOptions());
map.enableMouseWheelZoom();


<!-- create a remote collection-->
route = new MQA.RemoteCollection(myfile, new MQA.KMLDeserializer());
$posfin=strripos($routebis,$rempl);
//position des dernières coordonnées
PPV = new MQA.RemoteCollection('http://localhost/convert/fichiers_airports/PPV.kml', new MQA.KMLDeserializer());
$route=substr($route,0,$posfin+15-$posdeb+$offset); //suppression de ce qui est derrière les dernières coordonnées
A318 = new MQA.RemoteCollection('/convert/fichiers_airports/A318.kml', new MQA.KMLDeserializer());
A319 = new MQA.RemoteCollection('/convert/fichiers_airports/A319.kml', new MQA.KMLDeserializer());
A320 = new MQA.RemoteCollection('/convert/fichiers_airports/A320.kml', new MQA.KMLDeserializer());
A321 = new MQA.RemoteCollection('/convert/fichiers_airports/A321.kml', new MQA.KMLDeserializer());
A330 = new MQA.RemoteCollection('/convert/fichiers_airports/A330.kml', new MQA.KMLDeserializer());
A340 = new MQA.RemoteCollection('/convert/fichiers_airports/A340.kml', new MQA.KMLDeserializer());
A380 = new MQA.RemoteCollection('/convert/fichiers_airports/A380.kml', new MQA.KMLDeserializer());
B744 = new MQA.RemoteCollection('/convert/fichiers_airports/B744.kml', new MQA.KMLDeserializer());
B74F = new MQA.RemoteCollection('/convert/fichiers_airports/B74F.kml', new MQA.KMLDeserializer());
B772 = new MQA.RemoteCollection('/convert/fichiers_airports/B772.kml', new MQA.KMLDeserializer());
B773 = new MQA.RemoteCollection('/convert/fichiers_airports/B773.kml', new MQA.KMLDeserializer());
B77F = new MQA.RemoteCollection('/convert/fichiers_airports/B77F.kml', new MQA.KMLDeserializer());
<!-- automatically zoom and center the map using the bestFit method after the collection has loaded-->
MQA.EventManager.addListener(route, 'loaded', function() {
  map.bestFit();
  for (i=2;i<route.getSize();i++) {  <!--Boucle les points pour ne jamais afficher info uniquement le titre (nom du point).-->


var poi = route.getAt(i);
var str = "<b>" + poi.infoTitleHTML + "</b>";
poi.addExtraField('texte',str);
poi.setInfoTitleHTML("");                <!--Vide le contenu des infos des points-->
poi.setInfoContentHTML(str);


MQA.EventManager.addListener(poi, 'mouseover', function(){              <!--Affiche info au survol du point-->
this.toggleInfoWindowRollover();
});


MQA.EventManager.addListener(poi, 'click', function(){                  <!--Affiche info au clic-->
if (strstr($route,"-"))
this.toggleInfoWindowRollover();
{
});
$rdeg= stristr($route,"---");       // crée le dégagement s'il existe
}
$rdeg=preg_replace("[-]","",$rdeg);
nomEpingle=null;                  <!--Reset des variables d'affichage, en cas de rafraichissement de la page.-->
$pos=stripos($route,"-"); 
nomEtiquette=null;
$rmain=substr($route,0,$pos);  
nomInfo=null;
}
document.getElementById('info').innerHTML= "";    <!--Efface le "sablier"-->
else
{
  });
$rdeg=""; // pas de dégagement
<!-- add the shape collection to the map-->
$rmain=$route;
map.addShapeCollection(route);
}
});
});
$rmain= filter_var($rmain, FILTER_SANITIZE_ENCODED);  
$rmain=preg_replace("[%(20|0A|0D)]"," ",$rmain);
$rmain=explode(" ",$rmain); //met tous les éléments dans un tableau
$rmain= array_values(array_filter($rmain,"testvide"));  //supprime les élements vides et reindexe le tableau




if (count($rmain)<4)
{
        //Message si route trop courte, pas assez de points
echo "<p class='error'>ERREUR : Il faut au moins deux point pour définir une route<br>Vérifiez votre insertion ! ! ! ! !</p>";
echo "<hr>";
echo '<br><br><button type ="button" class="btn" onclick="window.history.back();">Retour</button>&nbsp;&nbsp;&nbsp;';
echo '<button type ="button" class="btn" style= "padding: 10px 15px 10px 15px;" onclick="location.href=\'help.html\'">?</button>';
exit;
}


<!--Fonction de chargement de carte des icônes-->
function AddEvent(val) { 


<!--Les valeurs des trois listes déroulantes-->
$rdeg= filter_var($rdeg, FILTER_SANITIZE_ENCODED);
nomEpingle = document.getElementById('Epingle').options[document.getElementById('Epingle').selectedIndex].value;
$rdeg=preg_replace("[%(20|0A|0D)]"," ",$rdeg);
nomEtiquette = document.getElementById('Etiquette').options[document.getElementById('Etiquette').selectedIndex].value;
$rdeg=explode(" ",$rdeg);  
nomInfo = document.getElementById('InMap').options[document.getElementById('InMap').selectedIndex].value;
$rdeg= array_values(array_filter($rdeg,"testvide"));


myCollec=eval(nomEpingle);
AffichEping(nomEpingle,nomEtiquette,nomInfo,myCollec);


MQA.EventManager.addListener(myCollec, 'loaded', function(){
$rmain= CreateArrayRoute ($rmain);
for (i=1;i<myCollec.getSize();i++) {  <!--Boucle les points pour créer les infos supplémentaires pour les étiquettes et les infos.-->
$rdeg= CreateArrayRoute ($rdeg);
var poi = myCollec.getAt(i);  
 
var str = "<b><u>" + poi.infoTitleHTML.substring(5)+ "</u></b><br><br>" + poi.infoContentHTML;
// Création du nom du fichier
poi.addExtraField('texte',str);
 
poi.addExtraField('code',poi.infoTitleHTML.substring(0,4));
$dep=$rmain[0]['waypoint'];             //Point de départ
poi.addExtraField('nom',poi.infoTitleHTML.substring(5));
$arr=end($rmain)['waypoint']; //Point d'arrivée
poi.setInfoTitleHTML("");
$deg=end($rdeg)['waypoint']; //Point de dégagement
}
$timestp = date("dMY_His");
AffichEtiq (myCollec,nomEtiquette);
if ($deg){
AffichInfo(myCollec, nomInfo);
$mykml = $dep."-".$arr."_(".$deg.")_".$timestp.".kml"; //Nom du fichier KML
});
}
else {
$mykml = $dep."-".$arr."_".$timestp.".kml";
}
}
$mykml = trim($mykml); //Suppression des caractères bizarres
generatekml ($rmain,$rdeg,$mykml,$mytype);        //Création du point KML
// Création de l'image
$rmain=InvertLat ($rmain);
$rdeg=InvertLat ($rdeg);


$deppoint=$rmain[0]['latitude'].",".$rmain[0]['longitude'];            //Point de départ
$arrmain=end($rmain)['latitude'].",".end($rmain)['longitude'];          //Arrivée
$arrdeg=end($rdeg)['latitude'].",".end($rdeg)['longitude']; //Dégagement


<!--Traitement de l'affichage des épingles-->
$mainstring= CreateString($rmain); //Création string route principale et dégagement
function AffichEping (nomcollec,etiqonmap,infoonmap,collec){
$degstring= CreateString($rdeg);


switch(nomcollec) {
$upperleftlat=max(array_column($rmain,'latitude'));                //point gauche et point droit de la carte statique
$upperleftlong=min(array_column($rmain,'longitude'));
$upperleft=$upperleftlat.",".$upperleftlong;
$lowerrightlat= min(array_column($rmain,'latitude'));
$lowerrightlong=max(array_column($rmain,'longitude'));
$lowerright=$lowerrightlat.",".$lowerrightlong;


case ("") :        <!--Pas de choix-->
break;


case ("PPV") :     <!--Les affichages -->
//Map MapQuest
case ("A320"):
//A noter que le paramètre key est propriétaire du site et doit être demandé à MapQuest pour utilisation sur un autre site
case ("A330"):
// Création de l'image MapQuest
case ("A380"):
$mapurl= "http://open.mapquestapi.com/staticmap/v4/getmap?key=Fmjtd%7Cluurnu0125%2Cbs%3Do5-9w8lgw&size=1000,1000&margin=10&imagetype=png&pois=red_1,".$deppoint."|purple_1,".$arrdeg."|red_1,".$arrmain."&polyline=color:0xFF0000|width:3|".$mainstring."&polyline=color:0xCCCC00|width:3|".$degstring."";
case ("B747"):
case ("B772"):
case ("B773"):


// Création de l'image MapQuest en plein écran
$imgurl="http://open.mapquestapi.com/staticmap/v4/getmap?key=Fmjtd%7Cluurnu0125%2Cbs%3Do5-9w8lgw&size=300,200&margin=15&scalebar=false&imagetype=png&pois=red_1,".$deppoint."|purple_1,".$arrdeg."|red_1,".$arrmain."&polyline=color:0xFF0000|width:2|".$mainstring."&polyline=color:0xCCCC00|width:2|".$degstring."";
//Affichage du résultat
echo  "<p>Votre fichier ".$mykml." est disponible</p>";
echo "<a href=$mapurl target='_blank'><img src='$imgurl'></a>";
echo "<hr>";


if (typeof collec !== "undefined") {  <!--Des épingles sont bien affichées, on les efface-->
echo "<br>";
  collec.setVisible(false);
$filename="carteanim.html?file=../convert/KML_outputs/".$mykml;
}


if (collec.loaded){                      <!--Les épingles ont déjà été traitées, on ne refait que l'affichage-->
echo '<button type ="button" class="btn"  onclick="window.open(\''.$mapurl.'\')"> &nbsp;Carte&nbsp;  statique&nbsp; </button>';
collec.setVisible(true);
echo "<br>";
AffichEtiq (collec,nomEtiquette);  
echo "<br>";
AffichInfo(collec, nomInfo);


}
  echo '<button type ="button" class="btn"  onclick="window.open(\''.$filename.'\')">Carte interactive</button>';
else {
echo "<br>";
map.addShapeCollection(collec);   <!--Affiche les épingles demandées-->
echo "<br>";
collec.setVisible(true);
echo  '<button type ="button" class="btn" onclick="location.href=\'../convert/KML_outputs/'.$mykml.'\'">Téléchargement</button>';  //Faire test avec fichiers dans dossier.
echo "<br>";
echo "<br>";
echo "<form action='envoi_mail.php' method='post'>
<input type='text' name ='email' placeholder='Votre adresse mail' class= 'style_input'>
<br> <br><input type ='submit' value='Envoyer  le  mail'>
<input type='hidden' name='fichier'  value='../convert/KML_outputs/".$mykml."'> </form>";
echo '<br><br><button type ="button" class="btn" onclick="window.history.back();">Retour</button>&nbsp;&nbsp;&nbsp;';
echo '<button type ="button" class="btn" style= "padding: 10px 15px 10px 15px;" align="right" onclick="location.href=\'help.html\'">?</button>';


}
echo "<br>";
break;


case "NOICON" :            <!--Effacer les épingles-->
if (typeof collec == "undefined") {  <!--Pas d'épingles affichées, donc rien à effacer-->
  break;
}
collec.setVisible(false);
document.getElementById('info').innerHTML= "";
break;
}
}


//========= Les fonctions utilisées =========


<!----------------------------------------------------------------------->
<!--Routine d'affichage des étiquettes-->
//Fonction de test, pour voir si un élément d'un tableau est vide
function testvide($var)
{
strlen($var)==0;
return($var);
}


function AffichEtiq (iconsaff,etiqtype){


switch(etiqtype){
case ("") :
//Fonction de création du fichier .KML
break;
function generatekml($inputm,$inputd,$filename,$type){      
// $inputm est la route principale, $inputd est la route dégagement,$type est le type de route


case ("OACI") :
case ("NAME") :
case ("BOTH") :


if (typeof EtiqCollec !== "undefined") {  <!--Des étiquettes sont bien affichées, on les efface-->
$output="<?xml version='1.0' encoding='UTF-8'?>
  EtiqCollec.setVisible(false);
<kml xmlns='http://www.opengis.net/kml/2.2' xmlns:gx='http://www.google.com/kml/ext/2.2' xmlns:kml='http://www.opengis.net/kml/2.2' xmlns:atom='http://www.w3.org/2005/Atom'>
  map.removeShapeCollection(EtiqCollec)
<Document>
}
<name>";
$output.=substr($filename,0,9)."</name>
<Style id='no_icone'>
<IconStyle>
<Icon>
<href>http://www.notreavion.net/convert/images/no_icon.png</href>
</Icon>
<hotSpot x='0.5' y='0.0' xunits='fraction' yunits='fraction' />
</IconStyle>
</Style>


EtiqCollec=new MQA.ShapeCollection(); <!-- Création des étiquettes-->
<Style id='placemark-purple'>
for (i=1;i<iconsaff.getSize();i++) {
if (etiqtype=="OACI"){title=iconsaff.getAt(i).getExtraField('code');}
<IconStyle>
else if (etiqtype=="NAME") {title=iconsaff.getAt(i).getExtraField('nom');}
<Icon>
else {title=iconsaff.getAt(i).getExtraField('code') + " " +iconsaff.getAt(i).getExtraField('nom');}
<href>http://www.notreavion.net/convert/images/icone_route.png</href>
latt=iconsaff.getAt(i).latLng.lat;
</Icon>
lonn=iconsaff.getAt(i).latLng.lng;
var newpoi= new MQA.HtmlPoi({lat: latt, lng: lonn});
<hotSpot x='0.5' y='0.0' xunits='fraction' yunits='fraction' />
newpoi.setHtml(title, -15, 10, 'mqa_htmlpoi');
</IconStyle>
EtiqCollec.add(newpoi);
</Style>
}
<Style id='placemark-pink'>
map.addShapeCollection(EtiqCollec);
<IconStyle>
break;
<Icon>
 
<href>http://www.notreavion.net/convert/images/icone_deg.png</href >
case "NONAME" :
</Icon>
if (typeof EtiqCollec == "undefined") { <!--Il n'y a pas d'étiquettes affichées, sort-->
break;
<hotSpot x='0.5' y='0.0' xunits='fraction' yunits='fraction' />
}
</IconStyle>
EtiqCollec.setVisible(false);
</Style>
map.removeShapeCollection(EtiqCollec); <!--Efface les étiquettes-->
<Style id='rmain'>
break;
<LineStyle>
}
<color>FFDA25A8</color>
}
<width>3</width>
</LineStyle>
<PolyStyle>
<color>FFDA25A8</color>
</PolyStyle>
</Style>
<Style id='rdeg'>
<LineStyle>
<color>FFFF00FF</color>
<width>3</width>
</LineStyle>
<PolyStyle>
<color>FFFF00FF</color>
</PolyStyle>
</Style>
<Folder>
<name>Lignes</name>
<open>1</open>
<Placemark>
<name>Rmain</name>
<styleUrl>#rmain</styleUrl>";
$output.="
<LineString>
<tessellate>1</tessellate>
<coordinates>";
foreach($inputm as $point){
$coordinates=$point['coordinates'];
$output.="$coordinates ";}
$output.="</coordinates>
</LineString>
</Placemark>";
$output.="<Placemark>
<name>Rdeg</name>
<styleUrl>#rdeg</styleUrl>";
$output.="
<LineString>
<tessellate>1</tessellate>
<coordinates>";
foreach($inputd as $point){
$coordinates=$point['coordinates'];
$output.="$coordinates ";}
$output.="</coordinates>
</LineString>
</Placemark>
</Folder><Folder>";


if($type=="routewaypoint"){
foreach($inputm as $point){
$name=$point['waypoint'];
$coordinates=$point['coordinates'];


<!----------------------------------------------------------------------->
$output.="
<!--Routine d'affichage des infos terrain  (INMAP à l'ouverture)-->
<Placemark>";


function AffichInfo(icons, infotype){   
$output.="<name>$name</name>";


if (infotype=="INMAP"){               
$output.="
for (i=1;i<icons.getSize();i++) {  <!-- Boucle les points pour créer les évènements clic et survol-->
<styleUrl>#placemark-purple</styleUrl>
var poi = icons.getAt(i);
";
MQA.EventManager.removeListener(poi, 'mouseover', affichout);
MQA.EventManager.removeListener(poi, 'click', affichout);
MQA.EventManager.addListener(poi, 'mouseover',affichin);
MQA.EventManager.addListener(poi, 'click',affichin);
}
}


else if(infotype=="OUTMAP") {
$output.="<description>$name</description>
for (i=1;i<icons.getSize();i++) {  <!-- Boucle les points pour créer les évènements clic et survol-->
<Point>     
var poi = icons.getAt(i);
<coordinates>$coordinates</coordinates>
MQA.EventManager.removeListener(poi, 'mouseover', affichin);
</Point>
MQA.EventManager.removeListener(poi, 'click', affichin);
</Placemark>
MQA.EventManager.addListener(poi, 'mouseover',affichout);
";
MQA.EventManager.addListener(poi, 'click',affichout);
}
}
}
}
foreach($inputd as $point){
$name=$point['waypoint'];
$coordinates=$point['coordinates'];
$output.="<Placemark>";


$output.="<name>$name</name>";


affichout = function(){                  <!--Affiche info au clic hors carte-->
this.setInfoContentHTML("");
document.getElementById('info').innerHTML= this.getExtraField('texte');
}


affichin =function(){
$output.="
if (navigator.userAgent.match(/iPad/i)){
<styleUrl>#placemark-pink</styleUrl>
document.getElementById('info').innerHTML= ""; <!--Affiche info au clic sur la carte-->
";
 
this.setInfoTitleHTML(this.getExtraField('texte'));
this.setInfoContentHTML(this.getExtraField('texte'));


}
$output.="<description>$name</description>
else{
<Point>     
document.getElementById('info').innerHTML= "";
<coordinates>$coordinates</coordinates>
this.setInfoTitleHTML(""); <!--S'affiche au clic-->
</Point>
this.setInfoContentHTML(this.getExtraField('texte'));  <!--S'affiche rollover-->
</Placemark>
";
}
}
}
}
$output.="</Folder></Document>
</kml>
";


//Ecriture du fichier KML dans le dossier KML_outputs sur le serveur
$myfile = fopen("../convert/KML_outputs/".$filename,"w") or die("Unable to open file!");
fwrite($myfile, $output);
fclose($myfile);


  </script>
/*
    </head>
  //Création du fichier kmz - non utilisé
$mykmz = substr($filename,0,strlen($filename)-3)."kmz";


    <body >
$zip = new ZipArchive();
<!--Affichage sur la page-->


<table id='table'>
if ($zip->open($mykmz, ZIPARCHIVE::CREATE)!==TRUE) {
<tr>
exit("cannot open <$file>\n");
<td><h4>Options d'affichage &nbsp;&nbsp;&nbsp;&nbsp;</h4></td>
}
<td>
$zip->addFromString("doc.kml",$output );
$zip->addEmptyDir ( "files" );
$zip->addFile ('icone_route.png','files/icone_route.png');
$zip->addFile ('icone_route.png','files/icone_deg.png');
$zip->close();
*/
//print $output;
}


//Fonction de création du tableau à deux colonnes waypoints-coordonnées décimales


function CreateArrayRoute ($route){         
<select id="Epingle"  class="cs-select cs-skin-underline" >
<option value=""  selected disabled >Epingles</option>
<option value="PPV" >MANEX C</option>
<option value="A320">A318</option>
<option value="A320">A319</option>
<option value="A320">A320</option>
<option value="A320">A321</option>
<option value="A330">A330</option>
<option value="A320">A340</option>
<option value="A380">A380</option>
<option value="B747">B744</option>
<option value="A320">B74F</option>
<option value="B772">B772</option>
<option value="B773">B773</option>
<option value="A320">B77F</option>
<option value="NOICON">Aucune</option>
</select>
</td>
<td>
<select id="Etiquette" class="cs-select cs-skin-underline" >
<option value="NONAME" selected disabled>Etiquettes</option>
<option value="OACI">Code OACI</option>
<option value="NAME">Nom</option>
<option value="BOTH">Les deux</option>
<option value="NONAME">Aucune</option>
</select>


</td>
$arrlength=count($route);
<td>
<select id="InMap" class="cs-select cs-skin-underline" >
<option value="INMAP" selected>Infos sur la carte</option>
<option value="OUTMAP">Hors de la carte</option>
</select>
</td>
<td>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;


<td>
$newroute=array(); //Nouveau tableau à deux colonnes Nom et Coordonnées
<button type ="button" class="btn" id="myfsbutton">Carte plein écran</button>
</td>
</tr>
</table>


  <div id='map'></div>
for($x=0;$x<$arrlength;$x++)
  <div id='info' style='padding-left: 10px; min-width:100px; min-height: 100px; overflow:hidden; '></div>
{
 
<br>
if (strlen($route[$x])<15)                //il s'agit d'un nom de point, on crée les deux lignes du tableau
{
$waypoint=$route[$x];
$lat = substr($route[$x+1],0,7);
$long = substr($route[$x+1],7,8);
$latitude = ConvertDMSToDD ($lat);
$longitude = ConvertDMSToDD($long);
$coordinates=$longitude.",".$latitude;
}
elseif (strlen($route[$x-1])<15)        //si le précédent est un point, on ne traite pas ces coordonées, elle correspondent au point précédent
{
continue;
}
else //il s'agit de coordonnées seules, donc on crée aussi le nom du point "LATLONG"
{
$lat = substr($route[$x],0,7);
$long = substr($route[$x],7,8);
$waypoint = substr($lat,0,3).substr($long,0,4);
$latitude = ConvertDMSToDD ($lat);
$longitude = ConvertDMSToDD($long);
$coordinates=$longitude.",".$latitude;
}
$point = array('waypoint'=>$waypoint,'coordinates'=>$coordinates); //Création de la ligne du tableau
$newroute[]=$point; // Insertion dans le tableau
}
return $newroute;
}


// Fonction de conversion des longitudes et latitudes


<script>
function ConvertDMSToDD($input) {
<!-- Goes to fullscreen !!!!-->


var elem = document.getElementById('map');
  $hemi = substr($input,0,1);
document.getElementById('myfsbutton').addEventListener('click', function () {
  if (strlen($input)==7)
    if (screenfull.enabled) {
  {
        screenfull.request(elem);
        $deg = intval(substr($input,1,2));
    }
$min = intval(substr($input,3,2));
  $decim =intval(substr($input,6,1));
  }
else  
else  
{
{
alert('Oups, votre navigateur ne permet pas le passage en plein écran');
$deg = intval(substr($input,1,3));
$min = intval(substr($input,4,2));
  $decim =intval(substr($input,7,1));
  }
    $result = $deg + $min/60 + $decim/600;
switch ($hemi)                //inversion du signe pour W et S
{
case ("W") :
$result = $result*-1;
break;
case ("S") :
$result = $result*-1;
break;
case ("N") :
break;
case ("E") :
break;
}
return ($result);
}
function InvertLat ($route){          //Inversion longitude,latitude et création tableau
$arrlength=count($route);
$newroute=array();
for($x=0;$x<$arrlength;$x++)
{
$coordx=$route [$x]['coordinates']; //Récupère les coordonnées
$longx=substr($coordx,0,stripos($coordx,",")); 
$latx=substr($coordx,stripos($coordx,",")+1);
$latx=strtr($latx,",",".");
$longx=strtr($longx,",",".");
$point = array('latitude'=>$latx,'longitude'=>$longx); //Création de la ligne du tableau
$newroute[]=$point;
}
return $newroute; // Insertion dans le tableau
}
}
});
function CreateString($route){
</script>


<!--Script d'affichage des listes déroulantes-->
$arrlength=count($route);
$linestring="";
<script src="SelectInspiration/js/classie.js"></script>
for($x=0;$x<$arrlength;$x++)
<script src="SelectInspiration/js/selectFx.js"></script>
{
$linestring.=$route[$x]['latitude'].",".$route[$x]['longitude'].",";
}
return $linestring;
}


<script>
//========= Fin des fonctions utilisées =========
(function() {
[].slice.call( document.querySelectorAll( 'select.cs-select' ) ).forEach( function(el) {
new SelectFx(el, {
                onChange: function(val) {
                  AddEvent(val);
                }
              });
} );
})();
</script>
             
             
<script>
 


</script>
?>


  </body>
</body>
</html>
</html>  
           


</syntaxhighlight>
</syntaxhighlight>
110

modifications

Les cookies nous aident à fournir nos services. En utilisant nos services, vous acceptez notre utilisation des cookies.

Menu de navigation