Complexity of Object.keys(obj).length is O(n) where n is the number of
object keys. Unfortunately, JavaScript have no built-in means of
determining number of object keys in constant time. Therefore, we have
to count object keys using separate counter variable.
It may look ugly (and indeed it is), but it greatly improves smoothness
and overall feel of IITC.
Change:
Extract portal handle process from "handleDataResponse" to "handlePortalData"
Add "action" property to object returned by $.ajax() to identity type of request
Delay low level portal render until no active request of map data.