Map custom function (eng lang)

This commit is contained in:
abarrau
2023-11-30 18:11:22 +01:00
parent e19f9bcd07
commit 6244681069
12 changed files with 326 additions and 86 deletions

View File

@@ -512,6 +512,16 @@ class Stations extends CI_Model {
}
return false;
}
// [MAP Custom] get json structure (for map) about info's station //
public function get_station_json_for_map() {
$_jsonresult = array();
list($station_lat, $station_lng) = array(0,0);
$station_active = $this->profile($this->find_active())->row();
if (!empty($station_active)) { list($station_lat, $station_lng) = $this->qra->qra2latlong($station_active->station_gridsquare); }
if (($station_lat!=0)&&($station_lng!=0)) { $_jsonresult = array('lat'=>$station_lat,'lng'=>$station_lng,'html'=>$station_active->station_gridsquare,'label'=>$station_active->station_profile_name,'icon'=>'stationIcon'); }
return (count($_jsonresult)>0)?("\"station\":".json_encode($_jsonresult)):'';
}
}
?>