diff --git a/aggpxtrack-update4.xml b/aggpxtrack-update4.xml index 0c585b5..a0621cd 100644 --- a/aggpxtrack-update4.xml +++ b/aggpxtrack-update4.xml @@ -119,7 +119,7 @@ Astrid Günther https://astrid-guenther.de - - + ed8c3dd2f80f279758d4753e61950c3c0d255da83b319c4fc6535ca7595c7bbf + 830321c8a8e4907b23de751f2d220bbc36e69004098192a57943402a81a2dba8261f6687abef8060f6dc3695fdcdd39f \ No newline at end of file diff --git a/changelog.xml b/changelog.xml index 73b2daa..7e4807e 100644 --- a/changelog.xml +++ b/changelog.xml @@ -30,7 +30,7 @@ 4.0.5 Fix (not needed anymore) component. - . + Make it posible to show elevation outside the map. diff --git a/j4/pkg_aggpxtrack/jorobo.ini b/j4/pkg_aggpxtrack/jorobo.ini index 29925c6..2c9c040 100644 --- a/j4/pkg_aggpxtrack/jorobo.ini +++ b/j4/pkg_aggpxtrack/jorobo.ini @@ -1,5 +1,5 @@ extension = aggpxtrack -version = 4.0.5 +version = 4.0.6 source = src target = package diff --git a/j4/pkg_aggpxtrack/src/media/plg_fields_aggpxtrack/js/aggpxtrack.js b/j4/pkg_aggpxtrack/src/media/plg_fields_aggpxtrack/js/aggpxtrack.js index d3d0126..64942b0 100644 --- a/j4/pkg_aggpxtrack/src/media/plg_fields_aggpxtrack/js/aggpxtrack.js +++ b/j4/pkg_aggpxtrack/src/media/plg_fields_aggpxtrack/js/aggpxtrack.js @@ -381,9 +381,14 @@ document.addEventListener('DOMContentLoaded', function () { { elevantioncontrol_width = document.getElementById('map' + unique).offsetWidth * 0.25; } + var position = elevantioncontrol_position; + if (elevantioncontrol_position === "above" || elevantioncontrol_position === "under") + { + position = "topright"; + } window['aggpx_elevation' + unique] = L.control.elevation({ - position: elevantioncontrol_position, + position: position, mapid: '#map' + unique, theme: elevantioncontrol_theme, //default: lime-theme width: elevantioncontrol_width, @@ -495,6 +500,29 @@ document.addEventListener('DOMContentLoaded', function () { }).addTo(window['mymap' + unique]); + // Elevation außerhalb von Karte schieben + if (elevantioncontrol_position === "above") + { + var thismap = document.querySelector('#map' + unique); + var parent = document.getElementById("aggpxtrackabove" + unique); + var elevation = thismap.querySelector(".elevation"); + setParent(elevation, parent); + function setParent(el, newParent) { + if (el) + newParent.appendChild(el); + } + } + if (elevantioncontrol_position === "under") + { + var thismap = document.querySelector('#map' + unique); + var parent = document.getElementById("aggpxtrackunder" + unique); + var elevation = thismap.querySelector(".elevation"); + setParent(elevation, parent); + function setParent(el, newParent) { + if (el) + newParent.appendChild(el); + } + } if (show_easyprint === "1") diff --git a/j4/pkg_aggpxtrack/src/plugins/fields/aggpxtrack/params/aggpxtrack.xml b/j4/pkg_aggpxtrack/src/plugins/fields/aggpxtrack/params/aggpxtrack.xml index 521f014..2fd3284 100644 --- a/j4/pkg_aggpxtrack/src/plugins/fields/aggpxtrack/params/aggpxtrack.xml +++ b/j4/pkg_aggpxtrack/src/plugins/fields/aggpxtrack/params/aggpxtrack.xml @@ -278,6 +278,8 @@ + + diff --git a/j4/pkg_aggpxtrack/src/plugins/fields/aggpxtrack/tmpl/aggpxtrack.php b/j4/pkg_aggpxtrack/src/plugins/fields/aggpxtrack/tmpl/aggpxtrack.php index 583d3b0..98838c4 100644 --- a/j4/pkg_aggpxtrack/src/plugins/fields/aggpxtrack/tmpl/aggpxtrack.php +++ b/j4/pkg_aggpxtrack/src/plugins/fields/aggpxtrack/tmpl/aggpxtrack.php @@ -112,6 +112,7 @@ $defaultArray = []; $skriptstring = ""; + $skriptstring .= "

"; $skriptstring .= "
get('map_height', '400') . "px;'"; @@ -205,6 +206,7 @@ $skriptstring .= " %s>"; $skriptstring .= "
"; + $skriptstring .= "
"; JText::script('PLG_AGGPXTRACK_CURRENTPOSITION_STRING');