Disable elevation module on IE & Edge.
This commit is contained in:
@@ -453,6 +453,7 @@ class Spot extends Main
|
|||||||
public function setAdminSettings($sType, $iId, $sField, $sValue) {
|
public function setAdminSettings($sType, $iId, $sField, $sValue) {
|
||||||
$bSuccess = false;
|
$bSuccess = false;
|
||||||
$sDesc = '';
|
$sDesc = '';
|
||||||
|
$asResult = array();
|
||||||
|
|
||||||
switch($sType) {
|
switch($sType) {
|
||||||
case 'project':
|
case 'project':
|
||||||
|
|||||||
@@ -391,32 +391,35 @@ function initSpotMessages(aoMessages, aoTracks, bNoFeed) {
|
|||||||
oScale = L.control.scale({imperial: false, 'position':'bottomright'}).addTo(oMap);
|
oScale = L.control.scale({imperial: false, 'position':'bottomright'}).addTo(oMap);
|
||||||
|
|
||||||
//Controls: Elevation
|
//Controls: Elevation
|
||||||
var oElev = L.control.elevation({
|
if(!isIE() && !isMobile()) {
|
||||||
collapsed: true,
|
var oElev = L.control.elevation({
|
||||||
position: "bottomright",
|
collapsed: true,
|
||||||
width: getElevWidth(),
|
position: "bottomright",
|
||||||
height: 129,
|
width: getElevWidth(),
|
||||||
hoverNumber: {
|
height: 129,
|
||||||
decimalsX: 0, //distance (km)
|
hoverNumber: {
|
||||||
decimalsY: 0 //elevation (m)
|
decimalsX: 0, //distance (km)
|
||||||
},
|
decimalsY: 0 //elevation (m)
|
||||||
theme: 'spot-theme',
|
},
|
||||||
onExpand: function(){$('.leaflet-control-scale').hide();},
|
theme: 'spot-theme',
|
||||||
onCollapse: function(){$('.leaflet-control-scale').show();}
|
onExpand: function(){$('.leaflet-control-scale').hide();},
|
||||||
}).addTo(oMap);
|
onCollapse: function(){$('.leaflet-control-scale').show();}
|
||||||
self.tmp('elev', oElev);
|
}).addTo(oMap);
|
||||||
|
self.tmp('elev', oElev);
|
||||||
|
}
|
||||||
|
|
||||||
//Controls: Tiles (layers): Add & Move to Settings Panel
|
//Controls: Tiles (layers): Add & Move to Settings Panel
|
||||||
L.control.layers(aoLayers, null, {position: 'topleft'}).addTo(oMap);
|
L.control.layers(aoLayers, null, {position: 'topleft'}).addTo(oMap);
|
||||||
$('#layers').empty().append($('.leaflet-control-layers-list .leaflet-control-layers-base'));
|
$('#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, {
|
var oActualTracks = L.geoJson(aoTracks, {
|
||||||
style: function(oTrack) {
|
style: function(oTrack) {
|
||||||
return self.tmp(['track-type-styles', oTrack.properties.type]);
|
return self.tmp(['track-type-styles', oTrack.properties.type]);
|
||||||
}
|
}
|
||||||
}).addTo(oMap);
|
}).addTo(oMap);
|
||||||
|
|
||||||
|
//"Hover" Tracks: Wider track (thus hover area) to avoid flickering popups
|
||||||
self.tmp('track', L.geoJson(aoTracks, {
|
self.tmp('track', L.geoJson(aoTracks, {
|
||||||
style: {weight: 20, opacity: 0},
|
style: {weight: 20, opacity: 0},
|
||||||
onEachFeature: function(feature, oLayer) {
|
onEachFeature: function(feature, oLayer) {
|
||||||
@@ -501,7 +504,7 @@ function initSpotMessages(aoMessages, aoTracks, bNoFeed) {
|
|||||||
asTrailMarkers.end.remove();
|
asTrailMarkers.end.remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
(oElev.addData.bind(oElev))(feature, oLayer);
|
if(!isIE() && !isMobile()) (oElev.addData.bind(oElev))(feature, oLayer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).addTo(oMap));
|
}).addTo(oMap));
|
||||||
@@ -703,7 +706,7 @@ function getPost(asPost) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getWmtsApiUrl(sMapId, iLat, iLng, iZoom) {
|
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) {
|
function getMediaLink(asData, sType) {
|
||||||
|
|||||||
@@ -15,3 +15,4 @@
|
|||||||
* Fix lightbox portrait mode: push text under
|
* Fix lightbox portrait mode: push text under
|
||||||
* Add mail frequency slider
|
* Add mail frequency slider
|
||||||
* Replace Project Time Zone with browser Time Zone when uploading media?
|
* Replace Project Time Zone with browser Time Zone when uploading media?
|
||||||
|
* Improve elevation module perfs
|
||||||
@@ -355,3 +355,13 @@ $.prototype.onSwipe = function(fCallBack){
|
|||||||
fCallBack({x:iDeltaX, y:iDeltaY});
|
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);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user