mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Map can be now extended
This commit is contained in:
@@ -90,6 +90,7 @@
|
||||
|
||||
// DX Map translation strings
|
||||
var lang_bandmap_draw_spotters = "<?= __("Draw Spotters"); ?>";
|
||||
var lang_bandmap_extend_map = "<?= __("Extend Map"); ?>";
|
||||
var lang_bandmap_your_qth = "<?= __("Your QTH"); ?>";
|
||||
var lang_bandmap_callsign = "<?= __("Callsign"); ?>";
|
||||
var lang_bandmap_frequency = "<?= __("Frequency"); ?>";
|
||||
|
||||
@@ -3508,6 +3508,7 @@ $(function() {
|
||||
legend.onAdd = function(map) {
|
||||
const div = L.DomUtil.create("div", "legend");
|
||||
div.innerHTML = '<input type="checkbox" id="toggleSpotters" style="outline: none;"><span> ' + lang_bandmap_draw_spotters + '</span><br>';
|
||||
div.innerHTML += '<input type="checkbox" id="extendMapCheckbox" style="outline: none;"><span> ' + lang_bandmap_extend_map + '</span><br>';
|
||||
return div;
|
||||
};
|
||||
legend.addTo(dxMap);
|
||||
@@ -3517,6 +3518,21 @@ $(function() {
|
||||
showSpotters = this.checked;
|
||||
updateDxMap();
|
||||
});
|
||||
|
||||
$('#extendMapCheckbox').on('change', function() {
|
||||
const mapContainer = $('#dxMap');
|
||||
if (this.checked) {
|
||||
// Double the height (345px -> 690px)
|
||||
mapContainer.css('height', '690px');
|
||||
} else {
|
||||
// Restore original height
|
||||
mapContainer.css('height', '345px');
|
||||
}
|
||||
// Invalidate map size to ensure it redraws properly
|
||||
if (dxMap) {
|
||||
dxMap.invalidateSize();
|
||||
}
|
||||
});
|
||||
}, 100);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user