src/ol/interaction/Draw.js
function getMode(type) {
  let mode;
  if (type === GeometryType.POINT ||
      type === GeometryType.MULTI_POINT) {
    mode = Mode.POINT;
  } else if (type === GeometryType.LINE_STRING ||
      type === GeometryType.MULTI_LINE_STRING) {
    mode = Mode.LINE_STRING;
  } else if (type === GeometryType.POLYGON ||
      type === GeometryType.MULTI_POLYGON) {
    mode = Mode.POLYGON;
  } else if (type === GeometryType.CIRCLE) {
    mode = Mode.CIRCLE;
  }
  return (
    /** @type {!Mode} */ (mode)
  );
}
function getMode(type) {
  let mode;
  if (type === GeometryType.POINT ||
      type === GeometryType.MULTI_POINT) {
    mode = Mode.POINT;
  } else if (type === GeometryType.LINE_STRING ||
      type === GeometryType.MULTI_LINE_STRING) {
    mode = Mode.LINE_STRING;
  } else if (type === GeometryType.POLYGON ||
      type === GeometryType.MULTI_POLYGON) {
    mode = Mode.POLYGON;
  } else if (type === GeometryType.CIRCLE) {
    mode = Mode.CIRCLE;
  }
  return (
    /** @type {!Mode} */ (mode)
  );
}
function getMode ( type ) { let mode ; if ( type === GeometryType . POINT || type === GeometryType . MULTI_POINT ) { mode = Mode . POINT ; } else if ( type === GeometryType . LINE_STRING || type === GeometryType . MULTI_LINE_STRING ) { mode = Mode . LINE_STRING ; } else if ( type === GeometryType . POLYGON || type === GeometryType . MULTI_POLYGON ) { mode = Mode . POLYGON ; } else if ( type === GeometryType . CIRCLE ) { mode = Mode . CIRCLE ; } return ( /** @type {!Mode} */ ( mode ) ) ; }
Get the drawing mode.  The mode for mult-part geometries is the same as for
their single-part cousins.
@param {GeometryType} type Geometry type.
@return {Mode} Drawing mode.
Get the drawing mode . The mode for mult - part geometries is the same as for their single - part cousins .