mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
new function for return json data for map
This commit is contained in:
@@ -513,14 +513,14 @@ 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() {
|
||||
// [MAP Custom] get array for json structure (for map) about info's station //
|
||||
public function get_station_array_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)):'';
|
||||
return (count($_jsonresult)>0)?(array('station'=>$_jsonresult)):array();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user