From 87893c0d6b92e36fb5046cc9e2c8b5506ee03d0d Mon Sep 17 00:00:00 2001 From: Mykola Dvornik Date: Thu, 14 Jul 2022 23:03:57 +0200 Subject: [PATCH] Improve map rendering by making Cesium fetch higher resolution tiles more aggressively as suggested in https://github.com/CesiumGS/cesium/issues/3279#issuecomment-271481280 --- df-aggregator.py | 8 ++++++-- views/cesium.tpl | 25 +++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/df-aggregator.py b/df-aggregator.py index 96a8022..64ebcea 100755 --- a/df-aggregator.py +++ b/df-aggregator.py @@ -54,7 +54,7 @@ d = 40000 # draw distance of LOBs in meters max_age = 5000 receivers = [] - +hqmaprendering = False ############################################### # Stores settings realted to intersect capture @@ -790,7 +790,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 ""}) ############################################### @@ -799,6 +800,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( @@ -811,6 +813,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": diff --git a/views/cesium.tpl b/views/cesium.tpl index 51991c3..364e84e 100644 --- a/views/cesium.tpl +++ b/views/cesium.tpl @@ -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"; @@ -453,6 +456,17 @@ Enabling this can cause longer load times. +
+ +

Enable High Quality Map Rendering:

+ + +
+ Enables or disables high quality map rendering. +
@@ -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() { @@ -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"); + } + } +