Révision a3184cec
Ajouté par Jocelyn Delande il y a presque 11 ans
css/base.css | ||
---|---|---|
106 | 106 |
.validators a:hover { |
107 | 107 |
border-color:#F00; |
108 | 108 |
} |
109 |
|
|
110 |
fieldset { |
|
111 |
padding: 1em; |
|
112 |
} |
|
113 |
|
|
114 |
.help { |
|
115 |
margin-top: 1em; |
|
116 |
font-style: italic; |
|
117 |
font-size: small; |
|
118 |
} |
css/layers.css | ||
---|---|---|
4 | 4 |
z-index:100000; |
5 | 5 |
right: 0; |
6 | 6 |
height: 1em; |
7 |
width: 10em; |
|
8 | 7 |
} |
9 | 8 |
#panel div { |
10 | 9 |
float: left; |
envoyer.php | ||
---|---|---|
1 |
<?php |
|
2 |
if (array_key_exists('lat', $_GET) && array_key_exists('lon', $_GET)) { |
|
3 |
$lat = $_GET['lat']; |
|
4 |
$lon = $_GET['lon']; |
|
5 |
} else { |
|
6 |
$lat = ''; |
|
7 |
$lon = ''; |
|
8 |
} |
|
9 |
?> |
|
10 |
|
|
1 | 11 |
<!DOCTYPE html> |
2 | 12 |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr"> |
3 | 13 |
<head> |
... | ... | |
15 | 25 |
<form action="uploadReceive.php" method="post" enctype="multipart/form-data" id="upload"> |
16 | 26 |
<ul> |
17 | 27 |
<li> |
18 |
<label for="file" class="description">Envoyer le fichier :</label> |
|
19 |
<div> |
|
20 |
<input type="hidden" name="APC_UPLOAD_PROGRESS" id="progress_key" value="panoramas"/> |
|
21 |
<input type="file" name="files[]" id="file" multiple="multiple" |
|
22 |
title="Le fichier à envoyer doit être une image de taille maximale 300 Mo"/> |
|
23 |
</div> |
|
28 |
|
|
29 |
<fieldset> |
|
30 |
<legend>Envoyer le fichier:</legend> |
|
31 |
<input type="hidden" name="APC_UPLOAD_PROGRESS" id="progress_key" |
|
32 |
value="panoramas"/> |
|
33 |
<ul> |
|
34 |
<li><input type="file" name="files[]" id="file" multiple="multiple"/></li> |
|
35 |
|
|
36 |
<li><input type="checkbox" name="loop">Panorama bouclant |
|
37 |
(360°)</li> |
|
38 |
</ul> |
|
39 |
<p class="help"> |
|
40 |
Le fichier à envoyer doit être une image de taille maximale 300 Mo ; |
|
41 |
il peut s'agir d'un panorama (par exemple assemblé |
|
42 |
avec <a href="http://hugin.sourceforge.net/">hugin</a>), faisant 360° |
|
43 |
ou non, ou encore d'une simple photo. |
|
44 |
</p> |
|
45 |
|
|
46 |
</fieldset> |
|
47 |
</li> |
|
48 |
<li> |
|
49 |
<fieldset> |
|
50 |
<legend>Coordonnées (optionnel)</legend> |
|
51 |
<input type="text" name="lon" placeholder="longitude" value="<?php echo $lat ?>"/> |
|
52 |
<input type="text" name="lat" placeholder="latitude" value="<?php echo $lon; ?>"/> |
|
53 |
<input type="text" name="alt" placeholder="altitude (m)" width="20"/> |
|
54 |
<p class="help"> |
|
55 |
Si vous ne spécifiez pas les coordonnées maintenant, il sera |
|
56 |
toujours possible de le faire plus tard. |
|
57 |
</p> |
|
58 |
</fieldset> |
|
24 | 59 |
</li> |
25 |
|
|
26 | 60 |
<li> |
27 | 61 |
<input type="submit" name="submit" value="Envoyer" /> |
28 | 62 |
</li> |
js/utils_osm.js | ||
---|---|---|
16 | 16 |
} else zcontrol = new OpenLayers.Control.Zoom(); |
17 | 17 |
|
18 | 18 |
var map = new OpenLayers.Map({ |
19 |
div: "map", |
|
20 |
zoom: typeof zoom == 'undefined' ? 10:zoom, |
|
19 |
div: "map", |
|
20 |
theme: null, |
|
21 |
zoom: typeof zoom == 'undefined' ? 10:zoom, |
|
21 | 22 |
controls:[zcontrol, |
22 | 23 |
new OpenLayers.Control.KeyboardDefaults(), |
23 | 24 |
new OpenLayers.Control.Navigation()], |
24 | 25 |
}); |
25 |
|
|
26 |
|
|
27 |
|
|
26 | 28 |
if (typeof scale_line != 'undefined' && scale_line == true) { |
27 | 29 |
map.addControl(new OpenLayers.Control.ScaleLine({bottomOutUnits: ''})); |
28 | 30 |
} |
31 |
map.celutz_addnew = false; |
|
29 | 32 |
|
30 | 33 |
if (typeof base_layers != 'undefined') { |
31 | 34 |
var layers = new OpenLayers.Control.LayerSwitcher(); |
... | ... | |
61 | 64 |
map.events.unregister("click", map, show_pos); |
62 | 65 |
} |
63 | 66 |
} |
67 |
|
|
68 |
|
|
69 |
var bt_pano = mk_new_pano_button(map); |
|
64 | 70 |
var panel = new OpenLayers.Control.Panel({ |
65 |
div: document.getElementById("panel") |
|
66 |
}); |
|
71 |
div: document.getElementById("panel"), |
|
72 |
default: bt_pano, |
|
73 |
createControlMarkup: function(control) { |
|
74 |
var button = document.createElement('button'), |
|
75 |
iconSpan = document.createElement('span'), |
|
76 |
textSpan = document.createElement('span'); |
|
77 |
iconSpan.innerHTML = ' '; |
|
78 |
button.appendChild(iconSpan); |
|
79 |
if (control.text) { |
|
80 |
textSpan.innerHTML = control.text; |
|
81 |
} |
|
82 |
button.appendChild(textSpan); |
|
83 |
return button; |
|
84 |
} |
|
85 |
}); |
|
67 | 86 |
|
68 | 87 |
function formatLonlats(lonLat) { |
69 | 88 |
lonLat.transform(map.getProjectionObject(), new OpenLayers.Projection("EPSG:4326")); |
... | ... | |
78 | 97 |
formatOutput: formatLonlats |
79 | 98 |
})); |
80 | 99 |
|
81 |
var history = new OpenLayers.Control.NavigationHistory(); |
|
100 |
var history = new OpenLayers.Control.NavigationHistory({ |
|
101 |
previousOptions: { |
|
102 |
title: "Go to previous map position", |
|
103 |
text: "Préc." |
|
104 |
}, |
|
105 |
nextOptions: { |
|
106 |
title: "Go to next map position", |
|
107 |
text: "Suiv." |
|
108 |
}, |
|
109 |
}); |
|
110 |
|
|
82 | 111 |
map.addControl(history); |
83 |
panel.addControls([history.next, history.previous]);
|
|
112 |
panel.addControls([bt_pano, history.next, history.previous]);
|
|
84 | 113 |
map.addControl(panel); |
85 | 114 |
|
86 | 115 |
document.getElementById("clic_pos").onchange = set_pos; |
... | ... | |
315 | 344 |
|
316 | 345 |
map.addControl(selectControl); |
317 | 346 |
selectControl.activate(); |
347 |
} |
|
318 | 348 |
|
349 |
|
|
350 |
function mk_new_pano_button(map) { |
|
351 |
var btn = new OpenLayers.Control.Button({ |
|
352 |
displayClass: 'olControlBtnNewPano', |
|
353 |
title: "Ajouter un nouveau panorama", |
|
354 |
text: "Photo", |
|
355 |
id: 'btn-new-pano', |
|
356 |
autoActivate: true, |
|
357 |
trigger: function() {start_add_new_pano(map)}, |
|
358 |
}); |
|
359 |
return btn; |
|
360 |
} |
|
361 |
|
|
362 |
|
|
363 |
function add_pano_click_handler(callback) { |
|
364 |
var ctrlClass = OpenLayers.Class(OpenLayers.Control, { |
|
365 |
defaultHandlerOptions: { |
|
366 |
'single': false, |
|
367 |
'double': true, |
|
368 |
'pixelTolerance': 0, |
|
369 |
'stopSingle': false, |
|
370 |
'stopDouble': false |
|
371 |
}, |
|
372 |
|
|
373 |
initialize: function(options) |
|
374 |
{ |
|
375 |
this.handlerOptions = OpenLayers.Util.extend( |
|
376 |
{}, this.defaultHandlerOptions |
|
377 |
); |
|
378 |
|
|
379 |
OpenLayers.Control.prototype.initialize.apply(this, arguments); |
|
380 |
|
|
381 |
this.handler = new OpenLayers.Handler.Click( |
|
382 |
this, { |
|
383 |
'click': callback |
|
384 |
}, this.handlerOptions |
|
385 |
); |
|
386 |
}, |
|
387 |
}); |
|
388 |
|
|
389 |
var control = new ctrlClass({ |
|
390 |
handlerOptions: { |
|
391 |
"single": true, |
|
392 |
"double": false |
|
393 |
}, |
|
394 |
autoActivate: true}); |
|
395 |
|
|
396 |
return control; |
|
397 |
} |
|
398 |
|
|
399 |
function start_add_new_pano(map) { |
|
400 |
map.celutz_addnew = true; |
|
401 |
alert("cliquer sur un point de la carte pour choisir l'emplacement"); |
|
402 |
document.body.style.cursor = 'crosshair'; |
|
403 |
|
|
404 |
var control = add_pano_click_handler(function(evt) { |
|
405 |
var coord = map.getLonLatFromPixel(evt.xy); |
|
406 |
coord.transform(new OpenLayers.Projection("EPSG:900913"), |
|
407 |
new OpenLayers.Projection("EPSG:4326")); |
|
408 |
window.location = 'envoyer.php?lat='+coord.lat+'&lon='+coord.lon; |
|
409 |
}); |
|
410 |
map.addControl(control); |
|
319 | 411 |
} |
320 | 412 |
|
show_capline.php | ||
---|---|---|
3 | 3 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
4 | 4 |
<link type="image/x-icon" rel="shortcut icon" href="images/tsf.png"/> |
5 | 5 |
<link rel="stylesheet" type="text/css" href="css/layers.css" /> |
6 |
<link rel="stylesheet" type="text/css" href="http://dev.openlayers.org/releases/OpenLayers-2.13.1/theme/default/style.css" /> |
|
7 |
<link rel="stylesheet" type="text/css" href="css/olmap.css" /> |
|
8 |
|
|
6 | 9 |
<?php |
7 | 10 |
if (isset($_REQUEST['cap']) && isset($_REQUEST['org_lat']) && isset($_REQUEST['org_lon'])) { |
8 | 11 |
$cap = $_REQUEST['cap']; |
Formats disponibles : Unified diff
PREFIXXX