Projet

Général

Profil

Paste
Télécharger (2,87 ko) Statistiques
| Branche: | Révision:

root / show_capline.php @ fb66982c

1
<head>
2
  <title>Visualisation axe horizontal sur OSM</title>
3
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4
  <link type="image/x-icon" rel="shortcut icon" href="images/tsf.png"/>
5
  <link rel="stylesheet" type="text/css" href="css/layers.css" />
6
<?php
7
if (isset($_REQUEST['cap']) && isset($_REQUEST['org_lat']) && isset($_REQUEST['org_lon'])) {
8
  $cap = $_REQUEST['cap'];
9
  $org_lat = $_REQUEST['org_lat'];
10
  $org_lon = $_REQUEST['org_lon'];
11
  $complete = true;
12
} else {
13
  $complete = false;
14
}
15
if (isset($_REQUEST['title'])) {
16
  $pt_comment = htmlentities(base64_decode($_REQUEST['title']), ENT_QUOTES);
17
} else {
18
  $pt_comment = 'Le point de départ';
19
}
20
if (isset($_REQUEST['dist'])) {
21
  $dist = $_REQUEST['dist'];
22
} else {
23
  $dist = 120000;
24
}
25
if ($complete) {
26
  echo <<< EOS
27
<script src="http://maps.google.com/maps/api/js?v=3&amp;sensor=false"></script>
28
<script src="http://openlayers.org/api/OpenLayers.js"></script>
29
<script>
30
  var get_lon_lat = false;
31
  var scale_line = true;
32

33
  var def_points_style = {
34
  showPopup: false,
35
  icon_width: 24,
36
  icon_height: 24,
37
  icon_shiftX: -12,
38
  icon_shiftY: -24,
39
  opacity: 0.7}
40

41
  var ref_point = {
42
  lon: $org_lon,
43
  lat: $org_lat,
44
  icon_url: 'images/ptref.png',
45
  descr: '<div id="bulle">$pt_comment</div>',
46
  showPopup: true,
47
  icon_width: 24,
48
  icon_height: 24,
49
  icon_shiftX: -12,
50
  icon_shiftY: -24,
51
  title: 'chez nous'
52
};
53

54
var ref_line = {
55
 lon1: $org_lon,
56
 lat1: $org_lat,
57
 cap: $cap,
58
 width: 2,
59
 length: $dist,
60
 color: '#F00'
61
};
62
var base_layers = [
63
                   new OpenLayers.Layer.OSM(),
64
                   new OpenLayers.Layer.Google(
65
                                               "Google Satellite",
66
  {type: google.maps.MapTypeId.SATELLITE, numZoomLevels: 22}
67
                                               ),
68
                   new OpenLayers.Layer.Google(
69
                                               "Google Relief",
70
  {type: google.maps.MapTypeId.TERRAIN, visibility: false}
71
                                               ),
72
                   new OpenLayers.Layer.Google(
73
                                               "Google plan",
74
  {numZoomLevels: 20, visibility: false}
75
                                               ),
76
                   new OpenLayers.Layer.Google(
77
                                               "Google Hybrid",
78
  {type: google.maps.MapTypeId.HYBRID, numZoomLevels: 22, visibility: false}
79
                                               )];
80

    
81
</script>
82
<script src="js/utils_osm.js">
83
</script>
84
<script src="js/pano.js">
85
</script>
86

    
87
EOS;
88
}
89
?>
90
<script>
91
window.onload = function() {
92
  var map = draw_cap_map(12);//zoom
93
  all_refpoints = mk_all_refpoints_layer()
94
  map.addLayer(all_refpoints);
95
  add_refpoint_control(all_refpoints, map);
96
}
97
</script>
98
</head>
99
<body>
100
<?php
101
if ($complete) {
102
  echo '<div id="map"></div>'."\n";
103
  echo '<div id="panel"></div>'."\n";
104
  echo '<div id="position"></div>'."\n";
105
  echo '<div id="extra">'."\n";
106
  echo '<p>Autres contrôles'."\n";
107
  echo '<label><input type="checkbox" id="tilt" checked="checked"/>vision à 45°</label>'."\n";
108
  echo '<label><input type="checkbox" id="clic_pos"/>Position afichée sur clic</label>'."\n";
109
  echo '</div>'."\n";
110
} else {
111
  echo "<h1>Il faut indiquer des coordonnées.</h1>\n";
112
}
113
?>
114
</body>
115
</html>