diff --git a/css/gpxedit.css b/css/gpxedit.css index c2ea71e..7082f77 100644 --- a/css/gpxedit.css +++ b/css/gpxedit.css @@ -861,45 +861,18 @@ div#ho button { } #optiontop { display: grid; - grid-template: 1fr 1fr 1fr 1fr / 1fr 1fr; + grid-template-columns: 65% 35%; text-align: center; } -#optiontop label, #optiontop input[type=checkbox] { +#optiontop select { + width: 100% !important; +} +#optiontop label { margin-top: auto; margin-bottom: auto; } #optiontop input[type=checkbox] { margin-right: auto; -} -label[for=markerstyleselect] { - grid-column: 1; - grid-row: 1; -} -#markerstyleselect { - grid-column: 2; - grid-row: 1; -} -label[for=tooltipstyleselect] { - grid-column: 1; - grid-row: 2; -} -#tooltipstyleselect { - grid-column: 2; - grid-row: 2; -} -#symboloverwrite { - grid-column: 2; - grid-row: 3; -} -label[for=symboloverwrite] { - grid-column: 1; - grid-row: 3; -} -#clearbeforeload { - grid-column: 2; - grid-row: 4; -} -label[for=clearbeforeload] { - grid-column: 1; - grid-row: 4; + margin-top: 3px; + margin-bottom: 3px; } diff --git a/js/gpxedit.js b/js/gpxedit.js index 9b6b703..5145acf 100644 --- a/js/gpxedit.js +++ b/js/gpxedit.js @@ -1235,6 +1235,10 @@ if (optionsValues.symboloverwrite !== undefined) { $('#symboloverwrite').prop('checked', optionsValues.symboloverwrite); } + if (optionsValues.approximateele !== undefined) { + $('#approximateele').prop('checked', optionsValues.approximateele); + L.drawLocal.edit.approximateElevations = $('#approximateele').is(':checked'); + } if (optionsValues.tilelayer !== undefined) { gpxedit.restoredTileLayer = optionsValues.tilelayer; } @@ -1247,6 +1251,7 @@ optionsValues.tooltipstyle = $('#tooltipstyleselect').val(); optionsValues.clearbeforeload = $('#clearbeforeload').is(':checked'); optionsValues.symboloverwrite = $('#symboloverwrite').is(':checked'); + optionsValues.approximateele = $('#approximateele').is(':checked'); optionsValues.tilelayer = gpxedit.activeLayers.getActiveBaseLayer().name; //alert('to save: '+JSON.stringify(optionsValues)); @@ -1380,6 +1385,10 @@ $('body').on('change', '#clearbeforeload', function() { saveOptions(); }); + $('body').on('change', '#approximateele', function() { + L.drawLocal.edit.approximateElevations = $(this).is(':checked'); + saveOptions(); + }); $('body').on('click', 'button.popupOkButton', function(e) { var id = parseInt($(this).attr('layerid')); var name = $(this).parent().find('.layerName').val(); diff --git a/js/leaflet.draw-src.js b/js/leaflet.draw-src.js index faa1e9e..e2b84cb 100644 --- a/js/leaflet.draw-src.js +++ b/js/leaflet.draw-src.js @@ -2029,6 +2029,11 @@ L.Edit.PolyVerticesEdit = L.Handler.extend({ this._updatePrevNext(marker, marker2); this._poly.fire('editstart'); + if (L.drawLocal.edit.approximateElevations) { + if (marker1._latlng.alt && marker2._latlng.alt) { + marker._latlng.alt = (marker1._latlng.alt + marker2._latlng.alt) / 2; + } + } }; onDragEnd = function () { @@ -2038,6 +2043,11 @@ L.Edit.PolyVerticesEdit = L.Handler.extend({ this._createMiddleMarker(marker1, marker); this._createMiddleMarker(marker, marker2); + if (L.drawLocal.edit.approximateElevations) { + if (marker1._latlng.alt && marker2._latlng.alt) { + marker._latlng.alt = (marker1._latlng.alt + marker2._latlng.alt) / 2; + } + } }; onClick = function () { diff --git a/templates/gpxcontent.php b/templates/gpxcontent.php index 642fd96..7fa7b2b 100644 --- a/templates/gpxcontent.php +++ b/templates/gpxcontent.php @@ -113,12 +113,14 @@ echo ''."\n"; - - + + + +

t('Custom tile servers')); ?>