Maps now centre on stored locator in a user profile if logged in.issue #56

pull/109/head
Peter Goodhall 2012-11-30 16:16:43 +00:00
rodzic befdae44f0
commit 53d27e9844
5 zmienionych plików z 37 dodań i 7 usunięć

Wyświetl plik

@ -24,6 +24,18 @@ class Dashboard extends CI_Controller {
}
}
// Calculate Lat/Lng from Locator to use on Maps
if($this->session->userdata('user_locator')) {
$this->load->library('qra');
$qra_position = $this->qra->qra2latlong($this->session->userdata('user_locator'));
$data['qra'] = "set";
$data['qra_lat'] = $qra_position[0];
$data['qra_lng'] = $qra_position[1];
} else {
$data['qra'] = "none";
}
// Store info
$data['todays_qsos'] = $this->logbook_model->todays_qsos();
$data['total_qsos'] = $this->logbook_model->total_qsos();

Wyświetl plik

@ -30,6 +30,18 @@ class Logbook extends CI_Controller {
$this->load->model('logbook_model');
$data['results'] = $this->logbook_model->get_qsos($config['per_page'],$this->uri->segment(3));
// Calculate Lat/Lng from Locator to use on Maps
if($this->session->userdata('user_locator')) {
$this->load->library('qra');
$qra_position = $this->qra->qra2latlong($this->session->userdata('user_locator'));
$data['qra'] = "set";
$data['qra_lat'] = $qra_position[0];
$data['qra_lng'] = $qra_position[1];
} else {
$data['qra'] = "none";
}
// load the view
$data['page_title'] = "Logbook";

Wyświetl plik

@ -5,11 +5,7 @@ class Welcome extends CI_Controller {
public function index()
{
$this->load->library('hamio');
$callbook = $this->hamio->callsign('m3php');
print_r($callbook);
}
}

Wyświetl plik

@ -21,7 +21,13 @@
<script type="text/javascript">
function create_map() {
var latlng = new google.maps.LatLng(40.313043, -32.695312);
<?php if($qra == "set") { ?>
var latlng = new google.maps.LatLng(<?php echo $qra_lat; ?>, <?php echo $qra_lng; ?>);
<?php } else { ?>
var latlng = new google.maps.LatLng(40.313043, -32.695312);
<?php } ?>
var myOptions = {
zoom: 3,
center: latlng,

Wyświetl plik

@ -32,7 +32,11 @@
<script type="text/javascript">
function create_map() {
var latlng = new google.maps.LatLng(40.313043, -32.695312);
<?php if($qra == "set") { ?>
var latlng = new google.maps.LatLng(<?php echo $qra_lat; ?>, <?php echo $qra_lng; ?>);
<?php } else { ?>
var latlng = new google.maps.LatLng(40.313043, -32.695312);
<?php } ?>
var myOptions = {
zoom: 3,
center: latlng,