fix releaseMem ...
this time without flashing icons
This commit is contained in:
@@ -967,7 +967,7 @@ PlaneObject.prototype.updateIcon = function() {
|
|||||||
|
|
||||||
let styleKey = (webgl ? '' : svgKey) + '!' + labelText + '!' + this.scale;
|
let styleKey = (webgl ? '' : svgKey) + '!' + labelText + '!' + this.scale;
|
||||||
|
|
||||||
if (this.styleKey != styleKey) {
|
if (this.styleKey != styleKey || !this.marker.getStyle()) {
|
||||||
this.styleKey = styleKey;
|
this.styleKey = styleKey;
|
||||||
let style;
|
let style;
|
||||||
if (labelText) {
|
if (labelText) {
|
||||||
@@ -1667,10 +1667,14 @@ PlaneObject.prototype.clearMarker = function() {
|
|||||||
PlaneIconFeatures.removeFeature(this.marker);
|
PlaneIconFeatures.removeFeature(this.marker);
|
||||||
this.marker.visible = false;
|
this.marker.visible = false;
|
||||||
}
|
}
|
||||||
|
delete this.marker;
|
||||||
if (this.glMarker && this.glMarker.visible) {
|
if (this.glMarker && this.glMarker.visible) {
|
||||||
webglFeatures.removeFeature(this.glMarker);
|
webglFeatures.removeFeature(this.glMarker);
|
||||||
this.glMarker.visible = false;
|
this.glMarker.visible = false;
|
||||||
}
|
}
|
||||||
|
delete this.glMarker;
|
||||||
|
delete this.styleKey;
|
||||||
|
delete this.olPoint;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Update our marker on the map
|
// Update our marker on the map
|
||||||
|
|||||||
@@ -3395,14 +3395,15 @@ function removeHighlight() {
|
|||||||
// OpenLayers might have some slight memory retention issues
|
// OpenLayers might have some slight memory retention issues
|
||||||
// recreating all OpenLayers Features for the planes every now and then releases that retained memory
|
// recreating all OpenLayers Features for the planes every now and then releases that retained memory
|
||||||
function releaseMem() {
|
function releaseMem() {
|
||||||
|
//console.log('releaseMem()');
|
||||||
for (let i in PlanesOrdered) {
|
for (let i in PlanesOrdered) {
|
||||||
PlanesOrdered[i].clearMarker();
|
PlanesOrdered[i].clearMarker();
|
||||||
PlanesOrdered[i].destroyTrace();
|
PlanesOrdered[i].destroyTrace();
|
||||||
PlanesOrdered[i].destroyTR();
|
PlanesOrdered[i].destroyTR();
|
||||||
}
|
}
|
||||||
refreshFeatures();
|
refreshFeatures();
|
||||||
mapRefresh(true);
|
|
||||||
TAR.planeMan.redraw();
|
TAR.planeMan.redraw();
|
||||||
|
//mapRefresh(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
function refreshFeatures() {
|
function refreshFeatures() {
|
||||||
@@ -7473,7 +7474,9 @@ function showReplayBar(){
|
|||||||
function timeoutFetch() {
|
function timeoutFetch() {
|
||||||
fetchData();
|
fetchData();
|
||||||
timers.checkMove = setTimeout(timeoutFetch, Math.max(RefreshInterval, 10000));
|
timers.checkMove = setTimeout(timeoutFetch, Math.max(RefreshInterval, 10000));
|
||||||
reaper();
|
if (now - lastReap > 120) {
|
||||||
|
reaper();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleVisibilityChange() {
|
function handleVisibilityChange() {
|
||||||
|
|||||||
Reference in New Issue
Block a user