Bug fix: selected portal should not remove when zooming/panning out of range
This commit is contained in:
parent
87a0a35f74
commit
0c836ccfc2
@ -79,7 +79,14 @@ window.portalRenderLimit.resetPortalsLowerThanPrevMinLv = function() {
|
|||||||
window.portalRenderLimit.cleanUpOverLimitPortalLevel = function() {
|
window.portalRenderLimit.cleanUpOverLimitPortalLevel = function() {
|
||||||
var currentMinLevel = window.getMinPortalLevel();
|
var currentMinLevel = window.getMinPortalLevel();
|
||||||
for(var i = 0; i < currentMinLevel; i++) {
|
for(var i = 0; i < currentMinLevel; i++) {
|
||||||
portalsLayers[i].clearLayers();
|
portalsLayers[i].eachLayer(function(item) {
|
||||||
|
var itemGuid = item.options.guid;
|
||||||
|
// check if 'item' is a portal
|
||||||
|
if(getTypeByGuid(itemGuid) != TYPE_PORTAL) return true;
|
||||||
|
// Don’t remove if it is selected.
|
||||||
|
if(itemGuid == window.selectedPortal) return true;
|
||||||
|
portalsLayers[i].removeLayer(item);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user