From 695804524e99903e08405914323f12b8db21c47b Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Sat, 7 Sep 2013 08:15:02 +0100 Subject: [PATCH] update draw-resonators to remove dependancy on portalsLayers --- plugins/draw-resonators.user.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/plugins/draw-resonators.user.js b/plugins/draw-resonators.user.js index 2d48c4d2..95624e0e 100644 --- a/plugins/draw-resonators.user.js +++ b/plugins/draw-resonators.user.js @@ -169,15 +169,16 @@ window.plugin.drawResonators.Render.prototype.handleResonatorEntitiesAfterZoom = var render = this; - // loop through level of portals, only redraw if the level is shown on map - for(var level in window.portalsLayers) { - var portalsLayer = window.portalsLayers[level]; - - if(!map.hasLayer(portalsLayer)) continue; - portalsLayer.eachLayer(function(portal) { + // loop through level of portals, only draw if the portal is shown on map + for (var guid in window.portals) { + var portal = window.portals[guid]; + // FIXME: need to find a proper way to check if a portal is added to the map without depending on leaflet internals + // (and without depending on portalsLayers either - that's IITC internal) + if (portal._map) { render.createResonatorEntities(portal); - }); + } } + } }