class_docstr: Implementation of mercator tile source
  In general, tile sources are used as a required input for ``TileRenderer``.
  
  Parameters
  ----------
  
  x_range : tuple
    full extent of x dimension in data units
  
  y_range : tuple
    full extent of y dimension in data units
  
  max_zoom : int
    A maximum zoom level for the tile layer. This is the most zoomed-in level.
  
  min_zoom : int
    A minimum zoom level for the tile layer. This is the most zoomed-out level.
  
  max_zoom : int
    A maximum zoom level for the tile layer. This is the most zoomed-in level.
  
  x_origin_offset : int
    An x-offset in plot coordinates.
  
  y_origin_offset : int
    An y-offset in plot coordinates.
  
  initial_resolution : int
    Resolution (plot_units / pixels) of minimum zoom level of tileset
    projection. None to auto-compute.
  
  format : int
    An y-offset in plot coordinates.
  
  Output
  ------
  tileScheme: MercatorTileSource
class_docstr_tok: ["Implementation","of","mercator","tile","source","In","general",",","tile","sources","are","used","as","a","required","input","for","``","TileRenderer","``",".","Parameters","--","--","--","--","--","x_range",":","tuple","full","extent","of","x","dimension","in","data","units","y_range",":","tuple","full","extent","of","y","dimension","in","data","units","max_zoom",":","int","A","maximum","zoom","level","for","the","tile","layer",".","This","is","the","most","zoomed-in","level",".","min_zoom",":","int","A","minimum","zoom","level","for","the","tile","layer",".","This","is","the","most","zoomed-out","level",".","max_zoom",":","int","A","maximum","zoom","level","for","the","tile","layer",".","This","is","the","most","zoomed-in","level",".","x_origin_offset",":","int","An","x-offset","in","plot","coordinates",".","y_origin_offset",":","int","An","y-offset","in","plot","coordinates",".","initial_resolution",":","int","Resolution","(","plot_units","\/","pixels",")","of","minimum","zoom","level","of","tileset","projection",".","None","to","auto-compute",".","format",":","int","An","y-offset","in","plot","coordinates",".","Output","--","--","--","tileScheme",":","MercatorTileSource"]
code: def __init__(
      self,
      x_range,
      y_range,
      tile_size=256,
      min_zoom=0,
      max_zoom=30,
      x_origin_offset=20037508.34,
      y_origin_offset=20037508.34,
      initial_resolution=156543.03392804097,
  ):
      self.x_range = x_range
      self.y_range = y_range
      self.tile_size = tile_size
      self.min_zoom = min_zoom
      self.max_zoom = max_zoom
      self.x_origin_offset = x_origin_offset
      self.y_origin_offset = y_origin_offset
      self.initial_resolution = initial_resolution
      self._resolutions = [
          self._get_resolution(z)
          for z in range(self.min_zoom, self.max_zoom + 1)
      ]
  
imports: from __future__ import annotations
  from io import BytesIO
  import math
  import os
  import dask
  import dask.bag
  import numpy
  from PIL.Image import fromarray
label_desc: Use image node_id 1 to create a new MercatorTileDefinition object  with example: obj = MercatorTileDefinition(x_range, y_range, tile_size, min_zoom, max_zoom, x_origin_offset, y_origin_offset, initial_resolution)