Skip to content

Commit

Permalink
Improve map rendering
Browse files Browse the repository at this point in the history
by making Cesium fetch higher resolution tiles more aggressively as
suggested in
CesiumGS/cesium#3279 (comment)
  • Loading branch information
godsic committed Mar 5, 2023
1 parent fe086c4 commit e83192c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
8 changes: 6 additions & 2 deletions df-aggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
heading_d = 20000
max_age = 5000
receivers = []

hqmaprendering = False

###############################################
# Stores settings realted to intersect capture
Expand Down Expand Up @@ -821,7 +821,8 @@ def cesium():
'minpoints': ms.min_samp,
'rx_state': "checked" if ms.receiving is True else "",
'intersect_state': "checked" if ms.plotintersects is True else "",
'receivers': receivers})
'receivers': receivers,
'hqmaprendering_state': "checked" if hqmaprendering else ""})


###############################################
Expand All @@ -830,6 +831,7 @@ def cesium():
###############################################
@get('/update')
def update_cesium():
global hqmaprendering
# eps = float(request.query.eps) if request.query.eps else ms.eps
# min_samp = float(request.query.minpts) if request.query.minpts else ms.min_samp
ms.min_conf = float(
Expand All @@ -842,6 +844,8 @@ def update_cesium():
elif request.query.rx == "false":
ms.receiving = False

hqmaprendering = True if request.query.hqmaprendering == "true" else False

# if request.query.plotpts == "true":
# ms.plotintersects = True
# elif request.query.plotpts == "false":
Expand Down
25 changes: 25 additions & 0 deletions views/cesium.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@
mapProjection : new Cesium.WebMercatorProjection(),
});
viewer.scene.postProcessStages.fxaa.enabled = false;
defaultMaximumScreenSpaceError = viewer.scene.globe.maximumScreenSpaceError;
viewer.infoBox.frame.setAttribute("sandbox", "allow-same-origin allow-popups allow-popups-to-escape-sandbox");
viewer.infoBox.frame.src = "about:blank";
Expand Down Expand Up @@ -453,6 +456,17 @@
Enabling this can cause longer load times.</span>
</span>
</div>
<div class="tooltip">
<span>
<span class="slidetitle"><h4>Enable High Quality Map Rendering:</h4></span>
<span class="slidespan" style="text-align:left;width: 100px;margin: 5px;">
<label class="switch">
<input id="hqmaprendering_en" name="hqmaprendering_en" {{hqmaprendering_state}} type="checkbox">
<span class="switchslider round"></span>
</label></span>
</span>
<span class="tooltiptext">Enables or disables high quality map rendering.</span>
</div>
<div>
<span><input id="refreshbutton" class="slider" type="button" value="Refresh" onclick="updateParams()"></span>
</div>
Expand Down Expand Up @@ -486,6 +500,7 @@
var intersect_en = document.getElementById("intersect_en");
// var clustering_en = document.getElementById("clustering_en");
var hqmaprendering_en = document.getElementById("hqmaprendering_en");
// Update the current slider value (each time you drag the slider handle)
epsslider.oninput = function() {
Expand Down Expand Up @@ -533,6 +548,16 @@
updateParams("");
}
hqmaprendering_en.onchange = function() {
if (hqmaprendering_en.checked) {
viewer.scene.globe.maximumScreenSpaceError = 1.0;
updateParams("hqmaprendering=true");
} else {
viewer.scene.globe.maximumScreenSpaceError = defaultMaximumScreenSpaceError;
updateParams("hqmaprendering=false");
}
}
</script>
</body>
</html>

0 comments on commit e83192c

Please sign in to comment.