code: def add_layer(self, tilemanager, opacity=1.0):
          
          assert has_pil, _("Cannot blend layers without python PIL")
          assert self.tile_size == tilemanager.tile_size, _("Cannot blend layers whose tile size differs")
          assert 0 <= opacity <= 1, _("Opacity should be between 0.0 (transparent) and 1.0 (opaque)")
          self.cache.basename += '%s%.1f' % (tilemanager.cache.basename, opacity)
          self._layers.append((tilemanager, opacity))
docs: Add a layer to be blended (alpha-composite) on top of the tile.
          tilemanager -- a `TileManager` instance
          opacity -- transparency factor for compositing