breunigs/ingress-intel-total-conversion — pull request #302 by Xelio (2013-02-25 09:38:53+00:00)
Title: New Feature: Remove lower level portal when portal render limit reached

I could not reopen the previous Pull Request so I create a new one.

About ```cachedPortalsCount```
I made some benchmarks on following line in ```window.handleDataResponse```
```$.each(ppp, function(ind, portal) { renderPortal(portal); });```

First I use geoseach to go to New York, after all request rendered, wait it to fire a few ```_callOnRefreshFunctions```.

Without ```cachedPortalsCount```, when the ```ppp``` has about 4700 item, the time need to run ```$.each(ppp...``` stable to about 4400ms.

With ```cachedPortalsCount```, it only need about 2300ms.

(I will put the benchmark function in another Pull Request)

About resonators
Because I use the count of layers in each portalsLayer as count of portals to control hidden or redraw in the two while loop. Resonators is added to portalsLayer and may make the count of portals wrong. (I changed render limit to 50 to test the function so I found this problem. )
I think it's unlikely to has 1000 portals in such zoom level. So I simply skip the hiding logic and let all layer re-show.