catch errors while instantiating layers, prevent map dragging from layer switcher