Projet

Général

Profil

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

root / show_capline.php @ b5af2606

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
    zoom = 12;
31
  var get_lon_lat = false;
32
  var scale_line = true;
33

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

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

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

    
82
</script>
83
<script src="js/utils_osm.js"></script>
84
EOS;
85
}
86
?>
87
</head>
88
<body>
89
<?php
90
if ($complete) {
91
  echo '<div id="map"></div>'."\n";
92
  echo '<div id="panel"></div>'."\n";
93
  echo '<div id="position"></div>'."\n";
94
  echo '<div id="extra">'."\n";
95
  echo '<p>Autres contrôles'."\n";
96
  echo '<label><input type="checkbox" id="tilt" checked="checked"/>vision à 45°</label>'."\n";
97
  echo '<label><input type="checkbox" id="clic_pos"/>Position afichée sur clic</label>'."\n";
98
  echo '</div>'."\n";
99
} else {
100
  echo "<h1>Il faut indiquer des coordonnées.</h1>\n";
101
}
102
?>
103
</body>
104
</html>