sort portal layers so they're above links/fields - but only when there's not that many
a lot of redrawing occurs when sorting portals - so only ordering when there's a low number keeps things reasonably fast
This commit is contained in:
parent
cae60c0843
commit
563258a897
@ -4,6 +4,10 @@
|
|||||||
|
|
||||||
|
|
||||||
window.Render = function() {
|
window.Render = function() {
|
||||||
|
// below this many portals displayed, we reorder the SVG at the end of the render pass to put portals above fields/links
|
||||||
|
this.LOW_PORTAL_COUNT = 350;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -93,6 +97,19 @@ window.Render.prototype.endRenderPass = function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// reorder portals to be after links/fields, but only if the number is low
|
||||||
|
if (Object.keys(window.portals).length <= this.LOW_PORTAL_COUNT) {
|
||||||
|
for (var i in window.portalsLayers) {
|
||||||
|
var layer = window.portalsLayers[i];
|
||||||
|
if (window.map.hasLayer(layer)) {
|
||||||
|
layer.eachLayer (function(p) {
|
||||||
|
p.bringToFront();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
this.isRendering = false;
|
this.isRendering = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user