Ability to turn gridsquare map on and off

pull/307/head
Peter Goodhall 2019-06-24 18:21:02 +01:00
rodzic 9fb7051c1a
commit 91dc6dde94
2 zmienionych plików z 17 dodań i 3 usunięć

Wyświetl plik

@ -100,6 +100,7 @@ $(document).ready(function(){
<?php } ?>
<?php if ($this->uri->segment(1) == "logbook" && $this->uri->segment(2) != "view") { ?>
<script type="text/javascript" src="<?php echo base_url();?>assets/js/leaflet/L.Maidenhead.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>assets/js/leaflet/leafembed.js"></script>
<script type="text/javascript">
@ -114,7 +115,12 @@ $(document).ready(function(){
var qso_loc = '<?php echo site_url('logbook/qso_map/25/'.$this->uri->segment(3)); ?>';
var q_zoom = 2;
initmap();
<?php if ($this->config->item('map_gridsquares') != FALSE) { ?>
var grid = "Yes";
<?php } else { ?>
var grid = "No";
<?php } ?>
initmap(grid);
</script>
<?php } ?>

Wyświetl plik

@ -23,11 +23,19 @@ function initmap(ShowGrid = 'No') {
// start the map in South-East England
map.setView(new L.LatLng(q_lat, q_lng), q_zoom);
map.addLayer(osm);
map.addLayer(osm);
askForPlots();
map.on('moveend', onMapMove);
if(ShowGrid == "Yes") {
var maidenhead = L.maidenhead().addTo(map);
}
var layerControl = new L.Control.Layers(null, {
'Gridsquares': maidenhead = L.maidenhead()
}).addTo(map);
}
function getXmlHttpObject() {