Map can be now extended

This commit is contained in:
Szymon Porwolik
2025-11-07 16:44:02 +01:00
parent 015194ecdc
commit 3723dd91e0
2 changed files with 17 additions and 0 deletions

View File

@@ -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"); ?>";

View File

@@ -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);
}