Use station location as base for map

pull/1351/head
phl0 2022-01-05 15:21:26 +01:00
rodzic d559937459
commit 8409dd03b0
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 48EA1E640798CA9A
2 zmienionych plików z 19 dodań i 2 usunięć

Wyświetl plik

@ -678,7 +678,24 @@ $(document).on('keypress',function(e) {
<script>
var markers = L.layerGroup();
var mymap = L.map('qsomap').setView([51.505, -0.09], 13);
var pos = [51.505, -0.09];
var mymap = L.map('qsomap').setView(pos, 12);
<?php
$this->load->model('stations');
$active_station_id = $this->stations->find_active();
$station_profile = $this->stations->profile($active_station_id);
$active_station_info = $station_profile->row();
if ($active_station_info->station_gridsquare != "") { ?>
$.getJSON('logbook/qralatlngjson/<?php echo $active_station_info->station_gridsquare; ?>', function(result) {
mymap.panTo([result[0], result[1]]);
pos = result;
})
<?php } else if (null !== $this->config->item('locator')) { ?>
$.getJSON('logbook/qralatlngjson/<?php echo $this->config->item('locator'); ?>', function(result) {
mymap.panTo([result[0], result[1]]);
pos = result;
})
<?php } ?>
L.tileLayer('<?php echo $this->optionslib->get_option('map_tile_server');?>', {
maxZoom: 18,

Wyświetl plik

@ -275,7 +275,7 @@ function reset_fields() {
$('#qso-last-table').show();
$('#partial_view').hide();
mymap.setView([51.505, -0.09], 13);
mymap.setView(pos, 12);
mymap.removeLayer(markers);
$('.callsign-suggest').hide();
}