UPDATE: I now see that you use this function in gaLayersPermalinkManager.