code: def _plot_map_background(
      ax, locations, api_key, map_type, show_scale_bar
  ):
      min_lon, min_lat = locations.min(axis=0)
      max_lon, max_lat = locations.max(axis=0)
  
      kwargs = {}
      if api_key is not None:
          kwargs["key"] = api_key
  
      google_map = salem.GoogleVisibleMap(
          x=[min_lon, max_lon],
          y=[min_lat, max_lat],
          scale=2,  # 1 or 2, resolution factor
          maptype=map_type,
          **kwargs,
      )
      img = google_map.get_vardata()
  
      salem_map = salem.Map(google_map.grid, factor=1, countries=False)
      salem_map.set_rgb(img)
      if show_scale_bar:
          salem_map.set_scale_bar(location=(0.88, 0.94))
  
      salem_map.visualize(ax=ax)
  
      # Transform into axis coordinates
      x, y = locations[:, 0], locations[:, 1]
      x, y = salem_map.grid.transform(x, y)
      locations = np.stack((x, y), axis=1)
  
      return locations
  
imports: import itertools
  import logging
  import numpy
  import matplotlib
  from matplotlib.widgets import Button, LassoSelector
  from matplotlib.path import Path
  import matplotlib.pyplot
  from mpl_toolkits.axes_grid1 import make_axes_locatable
  from mpl_toolkits.axes_grid1.inset_locator import InsetPosition
  from mpl_toolkits.mplot3d import Axes3D
  import sklearn.metrics.pairwise
  import sklearn.metrics
  import eta.core.utils
  import fiftyone.core.context
  import fiftyone.core.utils
  from .base import InteractivePlot
  from .utils import best_fit_line, load_button_icon, parse_lines_inputs, parse_locations, parse_scatter_inputs
label_desc: Use image node_id 12 for calling a global function with example usage: _plot_map_background(ax, locations, api_key, map_type, show_scale_bar) and returns: locations