Issue #58: refactored to use openLayer()...closeLayer()...deleteLayer()