Révision c5f89cd9
Ajouté par Jocelyn Delande il y a presque 11 ans
class/RefPoint.class.php | ||
---|---|---|
4 | 4 |
// |
5 | 5 |
class RefPoint { |
6 | 6 |
static $all_ref_points_cache; |
7 |
public $name; |
|
8 |
public $lon; |
|
9 |
public $lat; |
|
10 |
public $ele; |
|
11 |
|
|
12 |
public function __construct($name, $values) { |
|
13 |
$this->name = $name; |
|
14 |
$this->lon = $values[0]; |
|
15 |
$this->lat = $values[1]; |
|
16 |
$this->ele = $values[2]; |
|
17 |
} |
|
7 | 18 |
|
8 | 19 |
public static function load_if_needed() { |
9 | 20 |
if (!isset(self::$all_ref_points_cache)) { |
... | ... | |
21 | 32 |
|
22 | 33 |
public static function get($name) { |
23 | 34 |
self::load_if_needed(); |
24 |
return self::$all_ref_points_cache[$name]; |
|
35 |
$values = self::$all_ref_points_cache[$name]; |
|
36 |
return new RefPoint($name, $values); |
|
25 | 37 |
} |
26 | 38 |
|
27 | 39 |
} |
Formats disponibles : Unified diff
webservice to reference ref_points is ready