code: def build_map_options(
      df, type="choropleth", loc=None, lat=None, lon=None, map_val=None
  ):
      dtypes = get_dtypes(df)
      cols = sorted(dtypes.keys())
      lat_cols, lon_cols, str_cols, num_cols = [], [], [], []
      for c in cols:
          dtype = dtypes[c]
          classification = classify_type(dtype)
          if classification == "S":
              str_cols.append(c)
              continue
          if classification in ["F", "I"]:
              num_cols.append(c)
              coord = coord_type(df[c])
              if coord == "lat":
                  lat_cols.append(c)
              elif coord == "lon":
                  lon_cols.append(c)
  
      lat_options = [
          build_option(c)
          for c in lat_cols
          if c not in build_selections(lon, map_val)
      ]
      lon_options = [
          build_option(c)
          for c in lon_cols
          if c not in build_selections(lat, map_val)
      ]
      loc_options = [
          build_option(c)
          for c in str_cols
          if c not in build_selections(map_val)
      ]
  
      if type == "choropleth":
          val_options = [
              build_option(c)
              for c in num_cols
              if c not in build_selections(loc)
          ]
      else:
          val_options = [
              build_option(c)
              for c in num_cols
              if c not in build_selections(lon, lat)
          ]
      return loc_options, lat_options, lon_options, val_options
  
imports: import json
  import dash_bootstrap_components
  import dash_colorscales
  import dash_daq
  import os
  import plotly
  from pkg_resources import parse_version
  from six import PY3
  from dtale.dash_application import dcc, html
  import dtale.dash_application.custom_geojson
  import dtale.dash_application.extended_aggregations
  import dtale.global_state
  from dtale.charts.utils import AGGS, ANIMATION_CHARTS, ANIMATE_BY_CHARTS, YAXIS_CHARTS, ZAXIS_CHARTS, NON_EXT_AGGREGATION, build_final_cols, find_group_vals
  from dtale.column_builders import get_cleaner_configs
  from dtale.constants import CHART_JOINER_CHAR
  from dtale.dash_application.layout.utils import build_input, build_option, build_tab, build_cols, build_hoverable, build_selections, show_style, FREQS, FREQ_LABELS
  from dtale.translations import text
  from dtale.query import build_query, handle_predefined, inner_build_query, run_query
  from dtale.utils import ChartBuildingError, classify_type, coord_type, get_dtypes, is_app_root_defined, make_list
label_desc: Use image node_id 21 for calling a global function with example usage: build_map_options(df, type, loc, lat, lon, map_val) and returns: loc_options,  lat_options,  lon_options,  val_options