class_docstr: Widget for a drawing layer
  
  Add this to a :class:`gmaps.Map` or :class:`gmaps.Figure` instance to let
  you draw on the map.
  
  You should not need to instantiate this directly. Instead, use the
  :func:`gmaps.drawing_layer` factory function.
  
  :Examples:
  
  {examples}
  
  {params}
  
  :param mode:
      Initial drawing mode. One of ``DISABLED``, ``MARKER``, ``LINE``,
      ``POLYGON``, ``CIRCLE`` or ``DELETE``. Defaults to ``MARKER`` if
      ``toolbar_controls.show_controls`` is True, otherwise defaults to
      ``DISABLED``.
  :type mode: str, optional
  
  :param toolbar_controls:
      Widget representing the drawing toolbar.
  :type toolbar_controls: :class:`gmaps.DrawingControls`, optional
class_docstr_tok: ["Widget","for","a","drawing","layer","Add","this","to","a",":","class",":","`","gmaps.Map","`","or",":","class",":","`","gmaps.Figure","`","instance","to","let","you","draw","on","the","map",".","You","should","not","need","to","instantiate","this","directly",".","Instead",",","use","the",":","func",":","`","gmaps.drawing_layer","`","factory","function",".",":","Examples",":","{","examples","}","{","params","}",":","param","mode",":","Initial","drawing","mode",".","One","of","``","DISABLED","``",",","``","MARKER","``",",","``","LINE","``",",","``","POLYGON","``",",","``","CIRCLE","``","or","``","DELETE","``",".","Defaults","to","``","MARKER","``","if","``","toolbar_controls.show_controls","``","is","True",",","otherwise","defaults","to","``","DISABLED","``",".",":","type","mode",":","str",",","optional",":","param","toolbar_controls",":","Widget","representing","the","drawing","toolbar",".",":","type","toolbar_controls",":",":","class",":","`","gmaps.DrawingControls","`",",","optional"]
docstr: Register a callback called when new features are added
  
  :param callback:
      Callable to be called when a new feature is added.
      The callback should take a single argument, the
      feature that has been added. This can be an instance
      of :class:`gmaps.Line`, :class:`gmaps.Marker` or
      :class:`gmaps.Polygon`.
  :type callback: callable
docstr_tok: ["Register","a","callback","called","when","new","features","are","added",":","param","callback",":","Callable","to","be","called","when","a","new","feature","is","added",".","The","callback","should","take","a","single","argument",",","the","feature","that","has","been","added",".","This","can","be","an","instance","of",":","class",":","`","gmaps.Line","`",",",":","class",":","`","gmaps.Marker","`","or",":","class",":","`","gmaps.Polygon","`",".",":","type","callback",":","callable"]
code: def on_new_feature(self, callback):
      """
      Register a callback called when new features are added
  
      :param callback:
          Callable to be called when a new feature is added.
          The callback should take a single argument, the
          feature that has been added. This can be an instance
          of :class:`gmaps.Line`, :class:`gmaps.Marker` or
          :class:`gmaps.Polygon`.
      :type callback: callable
      """
      self._new_feature_callbacks.append(callback)
  
imports: import ipywidgets
  from traitlets import Unicode, List, Enum, Instance, HasTraits, Bool, default, observe, Float
  from .None import geotraitlets
  from .maps import GMapsWidgetMixin
  from .marker import MarkerOptions
  from ._docutils import doc_subst
label_desc: Use image node_id 2 for calling the Drawing obj's underlying member method code with example usage: obj.on_new_feature(callback) without return types