Projet

Général

Profil

Paste
Télécharger (3,06 ko) Statistiques
| Branche: | Révision:

root / show_capline.php @ a1063f68

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
  <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

    
9
<?php
10
if (isset($_REQUEST['cap']) && isset($_REQUEST['org_lat']) && isset($_REQUEST['org_lon'])) {
11
  $cap = $_REQUEST['cap'];
12
  $org_lat = $_REQUEST['org_lat'];
13
  $org_lon = $_REQUEST['org_lon'];
14
  $complete = true;
15
} else {
16
  $complete = false;
17
}
18
if (isset($_REQUEST['title'])) {
19
  $pt_comment = htmlentities(base64_decode($_REQUEST['title']), ENT_QUOTES);
20
} else {
21
  $pt_comment = 'Le point de départ';
22
}
23
if (isset($_REQUEST['dist'])) {
24
  $dist = $_REQUEST['dist'];
25
} else {
26
  $dist = 120000;
27
}
28
if ($complete) {
29
  echo <<< EOS
30
<script src="http://maps.google.com/maps/api/js?v=3&amp;sensor=false"></script>
31
<script src="http://openlayers.org/api/OpenLayers.js"></script>
32
<script>
33
  var get_lon_lat = false;
34
  var scale_line = true;
35

36
  var def_points_style = {
37
  showPopup: false,
38
  icon_width: 24,
39
  icon_height: 24,
40
  icon_shiftX: -12,
41
  icon_shiftY: -24,
42
  opacity: 0.7}
43

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

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

    
84
</script>
85
<script src="js/utils_osm.js">
86
</script>
87
<script src="js/pano.js">
88
</script>
89

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