code: def trail_map(data):
      lon = (min(data.lon) + max(data.lon)) / 2
      lat = (min(data.lat) + max(data.lat)) / 2
  
      map_options = GMapOptions(lng=lon, lat=lat, zoom=13)
      plot = GMapPlot(
          width=800,
          height=800,
          map_options=map_options,
          api_key=API_KEY,
      )
      plot.title.text = "%s - Trail Map" % name
      plot.x_range = Range1d()
      plot.y_range = Range1d()
      plot.add_tools(PanTool(), WheelZoomTool(), ResetTool())
  
      line_source = ColumnDataSource(
          dict(x=data.lon, y=data.lat, dist=data.dist)
      )
      line = Line(x="x", y="y", line_color="blue", line_width=2)
      plot.add_glyph(line_source, line)
  
      if plot.api_key == "GOOGLE_API_KEY":
          plot.add_layout(
              Label(
                  x=240,
                  y=700,
                  x_units="screen",
                  y_units="screen",
                  text="Replace GOOGLE_API_KEY with your own key",
                  text_color="red",
              )
          )
  
      return plot
  
file_path: bokeh/examples/models/trail.py
imports: from math import atan2, cos, radians, sin, sqrt
  import numpy
  import scipy.ndimage
  from bokeh.document import Document
  from bokeh.embed import file_html
  from bokeh.models import Column, ColumnDataSource, GMapOptions, GMapPlot, Grid, Label, Line, LinearAxis, PanTool, Patches, Plot, Range1d, ResetTool, WheelZoomTool
  from bokeh.sampledata.mtb import obiszow_mtb_xcm
  from bokeh.util.browser import view
label_desc: Use image node_id 4 for calling a global function with example usage: trail_map(data) and returns: plot