Project

General

Profile

Revision ffebe856

Added by Jocelyn Dealande about 8 years ago

do not display ref_points and panorama further than 25km from the current one (tunable in constant)

View differences:

panorama.php
12 12
    'to_ele'     => array('numeric'),
13 13
    'to_zoom'     => array('numeric')
14 14
  );
15
  
15

  
16 16
  $validator = new FormValidator($fields_spec);
17 17
  $is_valid = $validator->validate($_GET);
18
  
18

  
19 19
  if ($is_valid) {
20 20
    $input = $validator->sane_values();
21 21
  } else {
22 22
    $validator->print_errors();
23 23
    die();//fixme, could be cleaner
24 24
  }
25
  
25

  
26 26
   $form_extpoint = file_get_contents('html/form_extpoint.html');
27 27

  
28 28
   $form_param = file_get_contents('html/form_param.html');
......
57 57
     printf ("var img_prefix = '%s/%s';\n", $base_dir, $prefix);
58 58
     if (is_array($params)) $opt_vals = array_merge($params, $opt_vals);
59 59
     foreach(array('to_cap', 'to_ele', 'to_zoom', 'image_loop') as $val) {
60
        if (isset($opt_vals[$val])) 
60
        if (isset($opt_vals[$val]))
61 61
        printf ('var '.$val.' = '.utils::php2ini($opt_vals[$val]).";\n"); // correction du d├ęcalage angulaire par rapport au Nord
62 62
     }
63 63
  ?>
......
83 83
   $dir_list = new sites_dir($dir);
84 84

  
85 85
   $ipt = 0;
86
  foreach(site_point::get_all() as $opt) {
86
   foreach(site_point::near_points($pt, MAX_SEEING_DISTANCE) as $opt) {
87 87
     $prm = $opt->get_params();
88 88
     $oname = $opt->get_name();
89 89
     if (($oname != $name) && $opt->has_params()) {
......
94 94
     }
95 95
   }
96 96

  
97
   $ref_points = RefPoint::get_all();
98 97
   $extra_names = array();
99 98
   $ref_names = array();
100
   foreach ($ref_points as $ref) {
99
   foreach (RefPoint::near_points($pt, MAX_SEEING_DISTANCE) as $ref) {
101 100
     $extra_names[] = $ref->name;
102 101
     list($dist, $cap, $ele) = $pt->coordsToCap($ref->lon, $ref->lat,
103 102
                                                $ref->ele);

Also available in: Unified diff