improve destroy function on TilelayerLibrary