Skip to content

Commit 77b609b

Browse files
committed
Added function that hides Cesium's compass and zooming buttons on mobile.
1 parent 674fe0b commit 77b609b

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

3dwebclient/MobileController.js

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
this.watchInfoboxVisibility();
1919

2020
this.hideCredits();
21+
this.hideNavigationDiv();
2122
this.hideInspector();
2223

2324
this.setInfoboxFullscreen();
@@ -103,6 +104,23 @@
103104
}
104105
}
105106

107+
/**
108+
* Hide navigation tools (compass + zooming).
109+
*
110+
* @returns {undefined}
111+
*/
112+
MobileController.prototype.hideNavigationDiv = function () {
113+
var scope = this;
114+
115+
var loop = window.setInterval(function () {
116+
var navDiv = document.getElementById("navigationDiv");
117+
if (Cesium.defined(navDiv)) {
118+
navDiv.parentNode.removeChild(navDiv);
119+
clearInterval(loop);
120+
}
121+
}, 10);
122+
}
123+
106124
/**
107125
* Hide inspector that shows number of cached and loaded tiles.
108126
*
@@ -112,8 +130,11 @@
112130
var scope = this;
113131

114132
if (scope._isMobile) {
115-
document.getElementById("citydb_cachedTilesInspector").style.display = "none";
116-
document.getElementById("citydb_showedTilesInspector").style.display = "none";
133+
var cachedTiles = document.getElementById("citydb_cachedTilesInspector");
134+
cachedTiles.style.display = "none";
135+
136+
var showedTiles = document.getElementById("citydb_showedTilesInspector");
137+
showedTiles.style.display = "none";
117138
}
118139
}
119140

3dwebclient/css/MobileFullscreenStyles.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
width: 95vw!important;
3333
overflow: hidden;
3434
position: absolute;
35+
margin-top: 15px;
3536
z-index: 1!important;
3637
}
3738

0 commit comments

Comments
 (0)