Refactor to map.updateLayers