diff --git a/inc/spot.php b/inc/spot.php index 7169356..1540cb1 100755 --- a/inc/spot.php +++ b/inc/spot.php @@ -453,6 +453,7 @@ class Spot extends Main public function setAdminSettings($sType, $iId, $sField, $sValue) { $bSuccess = false; $sDesc = ''; + $asResult = array(); switch($sType) { case 'project': diff --git a/masks/project.html b/masks/project.html index 8622b13..11e018e 100644 --- a/masks/project.html +++ b/masks/project.html @@ -391,32 +391,35 @@ function initSpotMessages(aoMessages, aoTracks, bNoFeed) { oScale = L.control.scale({imperial: false, 'position':'bottomright'}).addTo(oMap); //Controls: Elevation - var oElev = L.control.elevation({ - collapsed: true, - position: "bottomright", - width: getElevWidth(), - height: 129, - hoverNumber: { - decimalsX: 0, //distance (km) - decimalsY: 0 //elevation (m) - }, - theme: 'spot-theme', - onExpand: function(){$('.leaflet-control-scale').hide();}, - onCollapse: function(){$('.leaflet-control-scale').show();} - }).addTo(oMap); - self.tmp('elev', oElev); + if(!isIE() && !isMobile()) { + var oElev = L.control.elevation({ + collapsed: true, + position: "bottomright", + width: getElevWidth(), + height: 129, + hoverNumber: { + decimalsX: 0, //distance (km) + decimalsY: 0 //elevation (m) + }, + theme: 'spot-theme', + onExpand: function(){$('.leaflet-control-scale').hide();}, + onCollapse: function(){$('.leaflet-control-scale').show();} + }).addTo(oMap); + self.tmp('elev', oElev); + } //Controls: Tiles (layers): Add & Move to Settings Panel L.control.layers(aoLayers, null, {position: 'topleft'}).addTo(oMap); $('#layers').empty().append($('.leaflet-control-layers-list .leaflet-control-layers-base')); - //Tracks, colors & popup + //Actual Tracks: Track with corresponding colors var oActualTracks = L.geoJson(aoTracks, { style: function(oTrack) { return self.tmp(['track-type-styles', oTrack.properties.type]); } }).addTo(oMap); + //"Hover" Tracks: Wider track (thus hover area) to avoid flickering popups self.tmp('track', L.geoJson(aoTracks, { style: {weight: 20, opacity: 0}, onEachFeature: function(feature, oLayer) { @@ -501,7 +504,7 @@ function initSpotMessages(aoMessages, aoTracks, bNoFeed) { asTrailMarkers.end.remove(); }); - (oElev.addData.bind(oElev))(feature, oLayer); + if(!isIE() && !isMobile()) (oElev.addData.bind(oElev))(feature, oLayer); } } }).addTo(oMap)); @@ -703,7 +706,7 @@ function getPost(asPost) { } function getWmtsApiUrl(sMapId, iLat, iLng, iZoom) { - return self.consts.geo_server+'/?a=tile&id='+sMapId+'&z='+iZoom+'&x='+iLng+'&y='+iLat; + return self.consts.geo_server+'?a=tile&id='+sMapId+'&z='+iZoom+'&x='+iLng+'&y='+iLat; } function getMediaLink(asData, sType) { diff --git a/readme.md b/readme.md index c3074be..8a43791 100644 --- a/readme.md +++ b/readme.md @@ -14,4 +14,5 @@ * Fix video fullscreen button on ios * Fix lightbox portrait mode: push text under * Add mail frequency slider -* Replace Project Time Zone with browser Time Zone when uploading media? \ No newline at end of file +* Replace Project Time Zone with browser Time Zone when uploading media? +* Improve elevation module perfs \ No newline at end of file diff --git a/script/spot.js b/script/spot.js index 5313b94..c0282a2 100755 --- a/script/spot.js +++ b/script/spot.js @@ -355,3 +355,13 @@ $.prototype.onSwipe = function(fCallBack){ fCallBack({x:iDeltaX, y:iDeltaY}); }); }; + +function isIE() { + var sUA = window.navigator.userAgent; + //IE 10: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0) + //IE 11: Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko + //Edge 12 (Spartan): Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0 + //Edge 13: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586 + //Edge 18: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.18363 + return (sUA.indexOf('MSIE ') > 0 || sUA.indexOf('Trident/') > 0 || sUA.indexOf('Edge/') > 0); +}