Fix various errors in gridmap (in context of removal of old maps)

This commit is contained in:
phl0 2023-11-30 10:37:57 +01:00
parent 79bb03ac92
commit 476a50706d
No known key found for this signature in database
GPG Key ID: 48EA1E640798CA9A
4 changed files with 21 additions and 13 deletions

View File

@ -13,6 +13,7 @@ class Activated_gridmap extends CI_Controller {
$this->load->model('activated_gridmap_model');
$this->load->model('stations');
$data['visitor'] = false;
$data['homegrid'] = explode(',', $this->stations->find_gridsquare());
$data['modes'] = $this->activated_gridmap_model->get_worked_modes();

View File

@ -439,7 +439,6 @@ class Visitor extends CI_Controller {
$data['grid_4char'] = js_array($array_grid_4char);
$data['grid_6char'] = js_array($array_grid_6char);
$data['homegrid'] = 'JO31OL';
$data['layer'] = $this->optionslib->get_option('option_map_tile_server');
$data['attribution'] = $this->optionslib->get_option('option_map_tile_server_copyright');

View File

@ -124,19 +124,25 @@
<div id="gridsquare_map" style="width: 100%; height: 800px"></div>
</div>
<div class="coordinates d-flex">
<div class="cohidden"><?php echo lang('gen_hamradio_latitude')?>: </div>
<div class="cohidden"><?php echo lang('gen_hamradio_latitude')?>:&nbsp;</div>
<div class="cohidden col-auto text-success fw-bold" id="latDeg"></div>
<div class="cohidden"><?php echo lang('gen_hamradio_longitude')?>: </div>
<div class="cohidden"><?php echo lang('gen_hamradio_longitude')?>:&nbsp;</div>
<div class="cohidden col-auto text-success fw-bold" id="lngDeg"></div>
<div class="cohidden"><?php echo lang('gen_hamradio_gridsquare')?>: </div>
<div class="cohidden"><?php echo lang('gen_hamradio_gridsquare')?>:&nbsp;</div>
<div class="cohidden col-auto text-success fw-bold" id="locator"></div>
<div class="cohidden"><?php echo lang('gen_hamradio_distance')?>: </div>
<div class="cohidden"><?php echo lang('gen_hamradio_distance')?>:&nbsp;</div>
<div class="cohidden col-auto text-success fw-bold" id="distance"></div>
<div class="cohidden"><?php echo lang('gen_hamradio_bearing')?>: </div>
<div class="cohidden"><?php echo lang('gen_hamradio_bearing')?>:&nbsp;</div>
<div class="cohidden col-auto text-success fw-bold" id="bearing"></div>
</div>
<script>var gridsquaremap = true;
<script>
var gridsquaremap = true;
var type = "activated";
<?php if ($visitor == true) { ?>
var visitor = true;
<?php } else { ?>
var visitor = false;
<?php } ?>
<?php
echo 'var jslayer ="' . $layer .'";';
echo "var jsattribution ='" . $attribution . "';";

View File

@ -126,15 +126,15 @@
<div id="gridsquare_map" style="width: 100%; height: 800px"></div>
</div>
<div class="coordinates d-flex">
<div class="cohidden"><?php echo lang('gen_hamradio_latitude')?>: </div>
<div class="cohidden"><?php echo lang('gen_hamradio_latitude')?>:&nbsp;</div>
<div class="cohidden col-auto text-success fw-bold" id="latDeg"></div>
<div class="cohidden"><?php echo lang('gen_hamradio_longitude')?>: </div>
<div class="cohidden"><?php echo lang('gen_hamradio_longitude')?>:&nbsp;</div>
<div class="cohidden col-auto text-success fw-bold" id="lngDeg"></div>
<div class="cohidden"><?php echo lang('gen_hamradio_gridsquare')?>: </div>
<div class="cohidden"><?php echo lang('gen_hamradio_gridsquare')?>:&nbsp;</div>
<div class="cohidden col-auto text-success fw-bold" id="locator"></div>
<div class="cohidden"><?php echo lang('gen_hamradio_distance')?>: </div>
<div class="cohidden"><?php echo lang('gen_hamradio_distance')?>:&nbsp;</div>
<div class="cohidden col-auto text-success fw-bold" id="distance"></div>
<div class="cohidden"><?php echo lang('gen_hamradio_bearing')?>: </div>
<div class="cohidden"><?php echo lang('gen_hamradio_bearing')?>:&nbsp;</div>
<div class="cohidden col-auto text-success fw-bold" id="bearing"></div>
</div>
<script>
@ -148,7 +148,9 @@ var visitor = false;
<?php
echo "var jslayer = \"" . $layer ."\";\n";
echo "var jsattribution ='" . $attribution . "';";
echo "var homegrid = \"" . strtoupper($homegrid[0]) . "\";\n";
if ($visitor == false) {
echo "var homegrid = \"" . strtoupper($homegrid[0]) . "\";\n";
}
echo "var gridsquares_gridsquares = \"" . $gridsquares_gridsquares . "\";\n";
echo "var gridsquares_gridsquares_confirmed = \"" . $gridsquares_gridsquares_confirmed . "\";\n";