insertVertex_(segmentData, vertex) {
    const segment = segmentData.segment;
    const feature = segmentData.feature;
    const geometry = segmentData.geometry;
    const depth = segmentData.depth;
    const index = segmentData.index;
    let coordinates;

    while (vertex.length < geometry.getStride()) {
      vertex.push(0);
    }

    switch (geometry.getType()) {
      case GeometryType.MULTI_LINE_STRING:
        coordinates = geometry.getCoordinates();
        coordinates[depth[0]].splice(index + 1, 0, vertex);
        break;
      case GeometryType.POLYGON:
        coordinates = geometry.getCoordinates();
        coordinates[depth[0]].splice(index + 1, 0, vertex);
        break;
      case GeometryType.MULTI_POLYGON:
        coordinates = geometry.getCoordinates();
        coordinates[depth[1]][depth[0]].splice(index + 1, 0, vertex);
        break;
      case GeometryType.LINE_STRING:
        coordinates = geometry.getCoordinates();
        coordinates.splice(index + 1, 0, vertex);
        break;
      default:
        return;
    }

    this.setGeometryCoordinates_(geometry, coordinates);
    const rTree = this.rBush_;
    rTree.remove(segmentData);
    this.updateSegmentIndices_(geometry, index, depth, 1);

    /** @type {SegmentData} */
    const newSegmentData = {
      segment: [segment[0], vertex],
      feature: feature,
      geometry: geometry,
      depth: depth,
      index: index,
    };

    rTree.insert(boundingExtent(newSegmentData.segment), newSegmentData);
    this.dragSegments_.push([newSegmentData, 1]);

    /** @type {SegmentData} */
    const newSegmentData2 = {
      segment: [vertex, segment[1]],
      feature: feature,
      geometry: geometry,
      depth: depth,
      index: index + 1,
    };

    rTree.insert(boundingExtent(newSegmentData2.segment), newSegmentData2);
    this.dragSegments_.push([newSegmentData2, 0]);
    this.ignoreNextSingleClick_ = true;
  }
/**
   * @param {SegmentData} segmentData Segment data.
   * @param {import("../coordinate.js").Coordinate} vertex Vertex.
   * @private
   */
@param {SegmentData} segmentData Segment data.
@param { SegmentData } segmentData Segment data .
insertVertex_(segmentData, vertex) {
    const segment = segmentData.segment;
    const feature = segmentData.feature;
    const geometry = segmentData.geometry;
    const depth = segmentData.depth;
    const index = segmentData.index;
    let coordinates;
    while (vertex.length < geometry.getStride()) {
      vertex.push(0);
    }
    switch (geometry.getType()) {
      case GeometryType.MULTI_LINE_STRING:
        coordinates = geometry.getCoordinates();
        coordinates[depth[0]].splice(index + 1, 0, vertex);
        break;
      case GeometryType.POLYGON:
        coordinates = geometry.getCoordinates();
        coordinates[depth[0]].splice(index + 1, 0, vertex);
        break;
      case GeometryType.MULTI_POLYGON:
        coordinates = geometry.getCoordinates();
        coordinates[depth[1]][depth[0]].splice(index + 1, 0, vertex);
        break;
      case GeometryType.LINE_STRING:
        coordinates = geometry.getCoordinates();
        coordinates.splice(index + 1, 0, vertex);
        break;
      default:
        return;
    }
    this.setGeometryCoordinates_(geometry, coordinates);
    const rTree = this.rBush_;
    rTree.remove(segmentData);
    this.updateSegmentIndices_(geometry, index, depth, 1);
    const newSegmentData = {
      segment: [segment[0], vertex],
      feature: feature,
      geometry: geometry,
      depth: depth,
      index: index,
    };
    rTree.insert(boundingExtent(newSegmentData.segment), newSegmentData);
    this.dragSegments_.push([newSegmentData, 1]);
    const newSegmentData2 = {
      segment: [vertex, segment[1]],
      feature: feature,
      geometry: geometry,
      depth: depth,
      index: index + 1,
    };
    rTree.insert(boundingExtent(newSegmentData2.segment), newSegmentData2);
    this.dragSegments_.push([newSegmentData2, 0]);
    this.ignoreNextSingleClick_ = true;
  }
insertVertex_ ( segmentData , vertex ) { const segment = segmentData . segment ; const feature = segmentData . feature ; const geometry = segmentData . geometry ; const depth = segmentData . depth ; const index = segmentData . index ; let coordinates ; while ( vertex . length < geometry . getStride ( ) ) { vertex . push ( 0 ) ; } switch ( geometry . getType ( ) ) { case GeometryType . MULTI_LINE_STRING : coordinates = geometry . getCoordinates ( ) ; coordinates [ depth [ 0 ] ] . splice ( index + 1 , 0 , vertex ) ; break ; case GeometryType . POLYGON : coordinates = geometry . getCoordinates ( ) ; coordinates [ depth [ 0 ] ] . splice ( index + 1 , 0 , vertex ) ; break ; case GeometryType . MULTI_POLYGON : coordinates = geometry . getCoordinates ( ) ; coordinates [ depth [ 1 ] ] [ depth [ 0 ] ] . splice ( index + 1 , 0 , vertex ) ; break ; case GeometryType . LINE_STRING : coordinates = geometry . getCoordinates ( ) ; coordinates . splice ( index + 1 , 0 , vertex ) ; break ; default : return ; } this . setGeometryCoordinates_ ( geometry , coordinates ) ; const rTree = this . rBush_ ; rTree . remove ( segmentData ) ; this . updateSegmentIndices_ ( geometry , index , depth , 1 ) ; const newSegmentData = { segment : [ segment [ 0 ] , vertex ] , feature : feature , geometry : geometry , depth : depth , index : index , } ; rTree . insert ( boundingExtent ( newSegmentData . segment ) , newSegmentData ) ; this . dragSegments_ . push ( [ newSegmentData , 1 ] ) ; const newSegmentData2 = { segment : [ vertex , segment [ 1 ] ] , feature : feature , geometry : geometry , depth : depth , index : index + 1 , } ; rTree . insert ( boundingExtent ( newSegmentData2 . segment ) , newSegmentData2 ) ; this . dragSegments_ . push ( [ newSegmentData2 , 0 ] ) ; this . ignoreNextSingleClick_ = true ; }
@param {SegmentData} segmentData Segment data.
@param { SegmentData } segmentData Segment data .
/** @type {SegmentData} */ /** @type {SegmentData} */