class_docstr: Create a linestring viz
docstr: Update map template variables specific to linestring visual
docstr_tok: ["Update","map","template","variables","specific","to","linestring","visual"]
code: def add_unique_template_variables(self, options):
      """Update map template variables specific to linestring visual"""
  
      # set line stroke dash interval based on line_stroke property
      if self.line_stroke in ["dashed", "--"]:
          self.line_dash_array = [6, 4]
      elif self.line_stroke in ["dotted", ":"]:
          self.line_dash_array = [0.5, 4]
      elif self.line_stroke in ["dash dot", "-."]:
          self.line_dash_array = [6, 4, 0.5, 4]
      elif self.line_stroke in ["solid", "-"]:
          self.line_dash_array = [1, 0]
      else:
          # default to solid line
          self.line_dash_array = [1, 0]
  
      # common variables for vector and geojson-based linestring maps
      options.update(
          dict(
              colorStops=self.color_stops,
              colorProperty=self.color_property,
              colorType=self.color_function_type,
              defaultColor=self.color_default,
              lineColor=self.color_default,
              lineDashArray=self.line_dash_array,
              lineStroke=self.line_stroke,
              widthStops=self.line_width_stops,
              widthProperty=self.line_width_property,
              widthType=self.line_width_function_type,
              defaultWidth=self.line_width_default,
              highlightColor=self.highlight_color,
          )
      )
  
      # vector-based linestring map variables
      if self.vector_source:
          options.update(
              dict(
                  vectorColorStops=[[0, self.color_default]],
                  vectorWidthStops=[[0, self.line_width_default]],
              )
          )
  
          if self.color_property:
              options.update(
                  vectorColorStops=self.generate_vector_color_map()
              )
  
          if self.line_width_property:
              options.update(
                  vectorWidthStops=self.generate_vector_numeric_map(
                      "line_width"
                  )
              )
  
      # geojson-based linestring map variables
      else:
          options.update(
              geojson_data=json.dumps(self.data, ensure_ascii=False)
          )
  
imports: import codecs
  import json
  import os
  from IPython.core.display import HTML, display
  import numpy
  import requests
  from mapboxgl.errors import TokenError, LegendError
  from mapboxgl.utils import color_map, numeric_map, img_encode, geojson_to_dict_list
  from mapboxgl import templates
label_desc: Use image node_id 2 for calling the LinestringViz obj's underlying member method code with example usage: obj.add_unique_template_variables(options) without return types