code: def test_overlay(self):
      # Base layer is mapbox vector layer
      tiles = Tiles("").opts(
          mapboxstyle="dark", accesstoken="token-str"
      )
  
      # Raster tile layer
      stamen_raster = StamenTerrain().opts(alpha=0.7)
  
      # RGB layer
      rgb_data = np.random.rand(10, 10, 3)
      rgb = RGB(
          rgb_data,
          bounds=(
              self.x_range[0],
              self.y_range[0],
              self.x_range[1],
              self.y_range[1],
          ),
      ).opts(opacity=0.5)
  
      # Points layer
      points = Points(
          [(0, 0), (self.x_range[1], self.y_range[1])]
      ).opts(show_legend=True)
  
      # Bounds
      bounds = Bounds((self.x_range[0], self.y_range[0], 0, 0))
  
      # Overlay
      overlay = (
          tiles * stamen_raster * rgb * points * bounds
      ).redim.range(x=self.x_range, y=self.y_range)
  
      # Render to plotly figure dictionary
      fig_dict = plotly_renderer.get_plot_state(overlay)
  
      # Check number of traces and layers
      traces = fig_dict["data"]
      subplot = fig_dict["layout"]["mapbox"]
      layers = subplot["layers"]
  
      self.assertEqual(len(traces), 5)
      self.assertEqual(len(layers), 2)
  
      # Check vector layer
      dummy_trace = traces[0]
      self.assertEqual(dummy_trace["type"], "scattermapbox")
      self.assertEqual(dummy_trace["lon"], [])
      self.assertEqual(dummy_trace["lat"], [])
      self.assertFalse(dummy_trace["showlegend"])
  
      self.assertEqual(subplot["style"], "dark")
      self.assertEqual(subplot["accesstoken"], "token-str")
      self.assertEqual(
          subplot["center"],
          {"lat": self.lat_center, "lon": self.lon_center},
      )
  
      # Check raster layer
      dummy_trace = traces[1]
      raster_layer = layers[0]
      self.assertEqual(dummy_trace["type"], "scattermapbox")
      self.assertEqual(dummy_trace["lon"], [])
      self.assertEqual(dummy_trace["lat"], [])
      self.assertFalse(dummy_trace["showlegend"])
  
      # Check raster_layer
      self.assertEqual(raster_layer["below"], "traces")
      self.assertEqual(raster_layer["opacity"], 0.7)
      self.assertEqual(raster_layer["sourcetype"], "raster")
      self.assertEqual(
          raster_layer["source"][0].lower(), stamen_raster.data.lower()
      )
  
      # Check RGB layer
      dummy_trace = traces[2]
      rgb_layer = layers[1]
      self.assertEqual(dummy_trace["type"], "scattermapbox")
      self.assertEqual(dummy_trace["lon"], [None])
      self.assertEqual(dummy_trace["lat"], [None])
      self.assertFalse(dummy_trace["showlegend"])
  
      # Check rgb_layer
      self.assertEqual(rgb_layer["below"], "traces")
      self.assertEqual(rgb_layer["opacity"], 0.5)
      self.assertEqual(rgb_layer["sourcetype"], "image")
      self.assertTrue(
          rgb_layer["source"].startswith("data:image/png;base64,iVBOR")
      )
      self.assertEqual(
          rgb_layer["coordinates"],
          [
              [self.lon_range[0], self.lat_range[1]],
              [self.lon_range[1], self.lat_range[1]],
              [self.lon_range[1], self.lat_range[0]],
              [self.lon_range[0], self.lat_range[0]],
          ],
      )
  
      # Check Points layer
      points_trace = traces[3]
      self.assertEqual(points_trace["type"], "scattermapbox")
      self.assertEqual(
          points_trace["lon"], np.array([0, self.lon_range[1]])
      )
      self.assertEqual(
          points_trace["lat"], np.array([0, self.lat_range[1]])
      )
      self.assertEqual(points_trace["mode"], "markers")
      self.assertTrue(points_trace.get("showlegend", True))
  
      # Check Bounds layer
      bounds_trace = traces[4]
      self.assertEqual(bounds_trace["type"], "scattermapbox")
      self.assertEqual(
          bounds_trace["lon"],
          np.array(
              [
                  self.lon_range[0],
                  self.lon_range[0],
                  0,
                  0,
                  self.lon_range[0],
              ]
          ),
      )
      self.assertEqual(
          bounds_trace["lat"],
          np.array(
              [
                  self.lat_range[0],
                  0,
                  0,
                  self.lat_range[0],
                  self.lat_range[0],
              ]
          ),
      )
      self.assertEqual(bounds_trace["mode"], "lines")
      self.assertTrue(points_trace["showlegend"], False)
  
      # No xaxis/yaxis
      self.assertNotIn("xaxis", fig_dict["layout"])
      self.assertNotIn("yaxis", fig_dict["layout"])
  
file_path: holoviews/holoviews/tests/plotting/plotly/test_tiles.py
imports: import numpy
  import pytest
  from holoviews.element import RGB, Bounds, Points, Tiles
  from holoviews.element.tiles import _ATTRIBUTIONS, StamenTerrain
  from .test_plot import TestPlotlyPlot, plotly_renderer
label_desc: Use image node_id 6 for calling the TestMapboxTilesPlot obj's underlying member method code with example usage: obj.test_overlay() without return types