Bug fix: selected portal should not remove when zooming/panning out of range

This commit is contained in:
Xelio 2013-05-18 14:52:43 +08:00
parent 87a0a35f74
commit 0c836ccfc2

View File

@ -79,7 +79,14 @@ window.portalRenderLimit.resetPortalsLowerThanPrevMinLv = function() {
window.portalRenderLimit.cleanUpOverLimitPortalLevel = function() {
var currentMinLevel = window.getMinPortalLevel();
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;
// Dont remove if it is selected.
if(itemGuid == window.selectedPortal) return true;
portalsLayers[i].removeLayer(item);
});
}
}