Skip to content

Commit

Permalink
elevation outside, fix in component
Browse files Browse the repository at this point in the history
  • Loading branch information
astridx committed Apr 23, 2022
1 parent 6bebc73 commit e16db99
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 5 deletions.
4 changes: 2 additions & 2 deletions aggpxtrack-update4.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
<maintainer>Astrid Günther</maintainer>
<maintainerurl>https://astrid-guenther.de</maintainerurl>
<targetplatform name="joomla" version="4.*"/>
<sha256></sha256>
<sha384></sha384>
<sha256>ed8c3dd2f80f279758d4753e61950c3c0d255da83b319c4fc6535ca7595c7bbf</sha256>
<sha384>830321c8a8e4907b23de751f2d220bbc36e69004098192a57943402a81a2dba8261f6687abef8060f6dc3695fdcdd39f</sha384>
</update>
</updates>
2 changes: 1 addition & 1 deletion changelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<version>4.0.5</version>
<note>
<item>Fix (not needed anymore) component.</item>
<item>.</item>
<item>Make it posible to show elevation outside the map.</item>
</note>
</changelog>
</changelogs>
2 changes: 1 addition & 1 deletion j4/pkg_aggpxtrack/jorobo.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
extension = aggpxtrack
version = 4.0.5
version = 4.0.6
source = src
target = package

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@
<option value="bottomright">PLG_FIELDS_AGGPXTRACK_PARAMS_CONTROL_POSITION_BOTTOMRIGHT</option>
<option value="topleft">PLG_FIELDS_AGGPXTRACK_PARAMS_CONTROL_POSITION_TOPLEFT</option>
<option value="topright">PLG_FIELDS_AGGPXTRACK_PARAMS_CONTROL_POSITION_TOPRIGHT</option>
<option value="under">PLG_FIELDS_AGGPXTRACK_PARAMS_CONTROL_POSITION_UNDER</option>
<option value="above">PLG_FIELDS_AGGPXTRACK_PARAMS_CONTROL_POSITION_ABOVE</option>
</field>

<field type="list" name="elevantioncontrol_theme" default="elevation-lime" label="PLG_FIELDS_AGGPXTRACK_PARAMS_CONTROL_THEME_LABEL" description="PLG_FIELDS_AGGPXTRACK_PARAMS_CONTROL_THEME_DESC" showon="show_elevantioncontrol:1" validate="options">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
$defaultArray = [];

$skriptstring = "";
$skriptstring .= "<div class='aggpxtrackabove' id='aggpxtrackabove" . $unique . "'></div><br>";
$skriptstring .= "<div id='map" . $unique . "'";
$skriptstring .= " class = 'leafletmap'";
$skriptstring .= " style='z-index:1;height: " . $fieldParams->get('map_height', '400') . "px;'";
Expand Down Expand Up @@ -205,6 +206,7 @@

$skriptstring .= " %s>";
$skriptstring .= "</div>";
$skriptstring .= "<div class='aggpxtrackunder' id='aggpxtrackunder" . $unique . "'></div>";

JText::script('PLG_AGGPXTRACK_CURRENTPOSITION_STRING');

Expand Down

0 comments on commit e16db99

Please sign in to comment.