Révision 0bd646e4
Ajouté par Victor PONGNIAN il y a environ 11 ans
panorama.php | ||
---|---|---|
2 | 2 |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> |
3 | 3 |
<head> |
4 | 4 |
<?php |
5 |
require 'class/site_point.class.php'; |
|
6 |
require 'class/sites_dir.class.php'; |
|
5 |
require 'class/utils.class.php'; |
|
6 |
utils::init(); |
|
7 |
|
|
8 |
$form_extpoint = <<<'EO_FORM_EXTPOINT' |
|
9 |
<img src="images/locapoint.svg" id="loca_show" alt="localiser un point" title="pour localiser un point..."/> |
|
10 |
<fieldset id="locadraw"><legend id="loca_hide">Localiser un point</legend> |
|
11 |
<label class="form_col" title="La latitude ϵ [-90°, 90°]. Ex: 12.55257">Latitude : |
|
12 |
<input name="loca_latitude" type="number" min="-90" max="90" id="loca_latitude"/></label> |
|
13 |
<label class="form_col" title="La longitude ϵ [-180°, 180°]. Ex: 144.14723">Longitude : |
|
14 |
<input name="loca_longitude" type="number" min="-180" max="180" id="loca_longitude"/></label> |
|
15 |
<label class="form_col" title="L'altitude positive Ex: 170">Altitude : |
|
16 |
<input name="loca_altitude" type="number" min="-400" id="loca_altitude"/></label> |
|
17 |
<div class="answer"> |
|
18 |
<input type="button" value="Localiser" id="loca_button"/> |
|
19 |
<input type="button" value="Effacer" id="loca_erase"/> |
|
20 |
</div> |
|
21 |
</fieldset> |
|
22 |
EO_FORM_EXTPOINT; |
|
23 |
|
|
24 |
$form_param = <<<'EO_FORM_PARAM' |
|
25 |
<div id="addParams"> |
|
26 |
<label id="paramFormShow">Paramétrer le panorama</label> |
|
27 |
</div> |
|
28 |
<form action="addParams.php?param_dir=%s&param_panorama=%s" id="form_param" method="post"> |
|
29 |
<fieldset id="adding"><legend id="paramFormHide">Paramétrage du panorama</legend> |
|
30 |
<label title="Au moins 4 caractères">Titre : |
|
31 |
<input type="text" pattern="^.{1,40}$" name="param_title" placeholder="%s" |
|
32 |
title="ne doit pas contenir pus de 40 caractères" required=""/></label> |
|
33 |
<label title="La latitude ϵ [-90°, 90°]. Ex : 46.55257">Latitude : |
|
34 |
<input name="param_latitude" type="number" min="-90" max="90" placeholder="43.56" required="" step="any"/></label> |
|
35 |
<label title="La longitude ϵ [-180°, 180°]. Ex : 1.45">Longitude : |
|
36 |
<input name="param_longitude" type="number" min="-180" max="180" placeholder="1.45" required="" step="any"/></label> |
|
37 |
<label title="L'altitude exprmée en mètres et > -400. Ex : 170">Altitude : |
|
38 |
<input name="param_altitude" type="number" min="-400" required="" placeholder="170" step="any"/></label> |
|
39 |
<label title="L'image fait-elle 360° ?">Rebouclage : |
|
40 |
<input type="checkbox" name="param_loop" value="true"></label> |
|
41 |
|
|
42 |
<div> |
|
43 |
<input type="submit" value="Submit"/> |
|
44 |
<input type="reset" value="Reset"/> |
|
45 |
</div> |
|
46 |
</fieldset> |
|
47 |
</form> |
|
48 |
EO_FORM_PARAM; |
|
7 | 49 |
|
8 | 50 |
if (isset($_GET['dir']) && isset($_GET['panorama'])) { |
9 | 51 |
$dir = $_GET['dir']; |
... | ... | |
24 | 66 |
$prefix = $pt->get_prefix(); |
25 | 67 |
?> |
26 | 68 |
<meta http-equiv="Content-type" content="text/html; charset=UTF-8"/> |
27 |
<?php
|
|
69 |
<?php |
|
28 | 70 |
$titre = 'panorama'; |
29 |
if ($params && isset($params['titre'])) $titre .= ' ; '.$params['titre'];
|
|
30 |
printf ("<title>%s</title>\n", $params['titre']);
|
|
71 |
if ($params && isset($params['titre'])) $titre .= ' : '.$params['titre'];
|
|
72 |
printf ("<title>%s</title>\n", $titre);
|
|
31 | 73 |
?> |
32 | 74 |
<script> |
33 | 75 |
<?php |
34 | 76 |
printf ("var img_prefix = '%s/%s'\n", $base_dir, $prefix); |
35 | 77 |
if (is_array($params)) $opt_vals = array_merge($params, $opt_vals); |
36 | 78 |
foreach(array('to_cap', 'to_ele', 'to_zoom', 'image_loop') as $val) { |
37 |
if (isset($opt_vals[$val])) printf ('var '.$val.' = '.$opt_vals[$val].";\n"); // correction du décalage angulaire par rapport au Nord |
|
79 |
if (isset($opt_vals[$val])) printf ('var '.$val.' = '.$opt_vals[$val].";\n"); // correction du décalage angulaire par rapport au Nord
|
|
38 | 80 |
} |
39 | 81 |
?> |
40 | 82 |
</script> |
... | ... | |
92 | 134 |
} |
93 | 135 |
} |
94 | 136 |
|
95 |
$localLat = (isset($_POST["loca_latitude"])) ? $_POST["loca_latitude"] : NULL; |
|
96 |
$localLon = (isset($_POST["loca_longitude"])) ? $_POST["loca_longitude"] : NULL; |
|
97 |
$localAlt = (isset($_POST["loca_altitude"])) ? $_POST["loca_altitude"] : NULL; |
|
137 |
$localLat = (isset($_POST["loca_latitude"])) ? $_POST["loca_latitude"] : NULL;
|
|
138 |
$localLon = (isset($_POST["loca_longitude"])) ? $_POST["loca_longitude"] : NULL;
|
|
139 |
$localAlt = (isset($_POST["loca_altitude"])) ? $_POST["loca_altitude"] : NULL;
|
|
98 | 140 |
|
99 |
if ($localLat && $localLon && $localAlt) { |
|
100 |
list($localDistance, $localCap, $localEle) = $pt->coordsToCap($localLat, $localLon, $localAlt);
|
|
101 |
$n = "point temporaire";
|
|
102 |
printf('point_list[%d] = new Array("%s", %03lf, %03lf, %03lf, "temporary");'."\n",$ipt++, $n, $localDistance, $localCap, $localEle);
|
|
103 |
} |
|
141 |
if ($localLat && $localLon && $localAlt) {
|
|
142 |
list($localDistance, $localCap, $localEle) = $pt->coordsToCap($localLat, $localLon, $localAlt);
|
|
143 |
$n = "point temporaire";
|
|
144 |
printf('point_list[%d] = new Array("%s", %03lf, %03lf, %03lf, "temporary");'."\n",$ipt++, $n, $localDistance, $localCap, $localEle); |
|
145 |
}
|
|
104 | 146 |
?> |
105 | 147 |
</script> |
106 |
|
|
107 |
|
|
108 |
|
|
109 |
|
|
110 | 148 |
<link type="image/x-icon" rel="shortcut icon" href="images/tsf.png"/> |
111 |
<link rel="stylesheet" media="screen" href="css/all.css" />
|
|
149 |
<link rel="stylesheet" media="screen" href="css/map.css" />
|
|
112 | 150 |
<script src="js/hide_n_showForm.js"></script> |
113 | 151 |
</head> |
114 | 152 |
<body> |
115 | 153 |
<canvas id="mon-canvas"> |
116 |
Ce message indique que ce navigateurs est vétuste car il ne supporte pas <samp>canvas</samp> (IE6, IE7, IE8, ...)
|
|
154 |
Ce message indique que ce navigateur est vétuste car il ne supporte pas <samp>canvas</samp> (IE6, IE7, IE8, ...) |
|
117 | 155 |
</canvas> |
118 | 156 |
|
119 | 157 |
<fieldset id="control"><legend>contrôle</legend> |
120 | 158 |
<label>Zoom : <input type="range" min="0" max="2" value="2" id="zoom_ctrl"/></label> |
121 |
<label>Cap : <input type="number" min="0" max="360" step="10" value="0" autofocus="" id="angle_ctrl"/></label> |
|
122 |
<label>Élévation : <input type="number" min="-90" max="90" step="1" value="0" autofocus="" id="elvtn_ctrl"/></label> |
|
159 |
<label>Cap : <input type="number" min="0" max="360" step="10" value="0" autofocus="" id="angle_ctrl" step="any"/></label>
|
|
160 |
<label>Élévation : <input type="number" min="-90" max="90" step="1" value="0" autofocus="" id="elvtn_ctrl" step="any"/></label>
|
|
123 | 161 |
</fieldset> |
124 | 162 |
|
125 | 163 |
<?php |
... | ... | |
130 | 168 |
printf ("<p>longitude : <em><span id=\"pos_lon\">%.5f</span>°</em></p>\n", $params['longitude']); |
131 | 169 |
if (isset($params['altitude'])) printf ("<p>altitude : <em><span id=\"pos_alt\">%d</span> m</em></p>\n", $params['altitude']); |
132 | 170 |
print("</div>\n"); |
133 |
?> |
|
134 |
<span id="loca"><img src="images/locapoint.svg" id="icone" onclick="showLoca()"/></span> |
|
135 |
<fieldset id="locadraw"><legend id="" onclick="hideLoca()">Localiser un point</legend> |
|
136 |
<form id="form_loca" method="post" name="form_localate" action="panorama.php?dir=<?php echo $_GET['dir'];?>&panorama=<?php echo $_GET['panorama'];?>"> |
|
137 |
<label class="form_col" title="La latitude ϵ [-90°, 90°]. Ex: 12.55257">Latitude : |
|
138 |
<input name="loca_latitude" type="number" min="-90" max="90" id="loca_latitude"/></label> |
|
139 |
|
|
140 |
<label class="form_col" title="La longitude ϵ [-180°, 180°]. Ex: 144.14723">Longitude : |
|
141 |
<input name="loca_longitude" type="number" min="-180" max="180" id="loca_longitude"/></label> |
|
142 |
|
|
143 |
<label class="form_col" title="L'altitude positive Ex: 170">Altitude : |
|
144 |
<input name="loca_altitude" type="number" min="-400" id="loca_altitude"/></label> |
|
145 |
|
|
146 |
<div class="answer"> |
|
147 |
<input type="button" value="Localiser" id="loca_button" class="form_button"/> |
|
148 |
<input type="reset" value="Reset" class="form_button"/> |
|
149 |
<input type="button" value="Effacer" class="form_button" id="loca_erase"/> |
|
150 |
</div> |
|
151 |
|
|
152 |
</form> |
|
153 |
</fieldset> |
|
154 |
<?php |
|
155 |
} elseif ($params == false ){ |
|
171 |
echo $form_extpoint; |
|
172 |
} elseif ($params == false ) { |
|
156 | 173 |
$dir = $_GET['dir']; |
157 | 174 |
$name = $_GET['panorama']; |
158 |
?> |
|
159 |
<div id="addParams"> |
|
160 |
<label onclick="showForm()" value="Hide label">Paramétrer le panorama</label> |
|
161 |
</div> |
|
162 |
<fieldset id="adding"><legend id="lgd" onclick="hideForm()">Paramètrer le panorama</legend> |
|
163 |
<form action="addParams.php?dir=<?php echo $dir;?>&panorama=<?php echo $name;?>" id="form_param" method="post"> |
|
164 |
|
|
165 |
<label class="form_col" for="param_title" title="Au moins 4 caractères">Titre: </label> |
|
166 |
<input type="text" id="param_title" name="param_title"/> |
|
167 |
|
|
168 |
<label class="form_col" for="param_latitude" title="La latitude ϵ [-90°, 90°]. Ex: 12.55257">Latitude: </label> |
|
169 |
<input name="param_latitude" type="text" id="param_latitude" /> |
|
170 |
|
|
171 |
<label class="form_col" for="param_longitude" title="La longitude ϵ [-180°, 180°]. Ex: 144.14723">Longitude: </label> |
|
172 |
<input name="param_longitude" type="text" id="param_longitude" /> |
|
173 |
|
|
174 |
<label class="form_col" for="param_altitude" title="L'altitude positive Ex: 170">Altitude: </label> |
|
175 |
<input name="param_altitude" type="text" id="param_altitude" /> |
|
176 |
|
|
177 |
<label class="form_col" for="param_elevation" title="élévation ϵ [-10,10] ( valeur par défaut : 0)">Elévation: </label> |
|
178 |
<input name="param_elevation" type="text" id="param_elevation" /> |
|
179 |
|
|
180 |
<label class="form_col" for="param_loop" title="L'image fait elle 360° ? ">Rebouclage: </label> |
|
181 |
<input class="radio" type="radio" name="param_loop" value="true" checked="checked"> Oui |
|
182 |
<input class="radio" type="radio" name="param_loop" value="false"> Non |
|
183 |
|
|
184 |
<input type="hidden" value="Localiser" id="loca_button" class="form_button" style="width:70px" /> |
|
185 |
<input type="hidden" value="Effacer" class="form_button" id="loca_erase"/> |
|
186 |
|
|
187 |
<div class="answer"> |
|
188 |
<input type="submit" value="Submit" class="form_button"/> |
|
189 |
<input type="reset" value="Reset" class="form_button"/> |
|
190 |
</div> |
|
191 |
|
|
192 |
</form> |
|
193 |
</fieldset> |
|
194 |
|
|
195 |
|
|
196 |
<script src="js/pano_deroulant.js"></script> |
|
197 |
|
|
198 |
<?php |
|
175 |
printf($form_param, $dir, $name, $name); |
|
199 | 176 |
} |
200 | 177 |
echo '<p id="info"></p>'."\n"; |
201 | 178 |
if (count($extra_names) > 1) { |
... | ... | |
203 | 180 |
foreach ($extra_names as $nm) { |
204 | 181 |
echo '<option>'.$nm."</option>\n"; |
205 | 182 |
} |
206 |
echo "</select>\n<br/>";
|
|
183 |
echo "</select>\n"; |
|
207 | 184 |
echo "<input type=\"button\" id=\"do-insert\" value=\"insérer\"/>\n"; |
208 | 185 |
echo "<input type=\"button\" id=\"do-delete\" value=\"suppimer\"/>\n"; |
209 | 186 |
echo "<input type=\"button\" id=\"do-cancel\" value=\"annuler\"/>\n"; |
210 | 187 |
echo "</p>\n"; |
211 | 188 |
} |
212 | 189 |
|
213 |
?> |
|
214 |
<p class="validators"><a href="http://validator.w3.org/check?uri=referer">page xHTML validé !</a></p> |
|
190 |
?> |
|
215 | 191 |
<p id="res"></p> |
192 |
<div class="validators"> |
|
193 |
pages validées par |
|
194 |
<a href="http://validator.w3.org/check?uri=referer"><img src="images/valid_xhtml.svg" alt="Valid XHTML 1.1" title="xHTML 1.1 validé !"/></a> |
|
195 |
<a href="http://jigsaw.w3.org/css-validator/check/referer"><img src="images/valid_css.svg" alt="CSS validé !" title="CSS validé !"/></a> |
|
196 |
</div> |
|
216 | 197 |
</body> |
217 | 198 |
</html> |
Formats disponibles : Unified diff
remise en forme du travail de Victor Pongnian suit à son stage
Il reste pas mal de cosmétique à revoir mais le système devrait déjà être utilisable dans l'état.