prepareFrame(frameState) {
    const layer = this.getLayer();
    const vectorSource = layer.getSource();
    const viewState = frameState.viewState;
    const viewNotMoving =
      !frameState.viewHints[ViewHint.ANIMATING] &&
      !frameState.viewHints[ViewHint.INTERACTING];
    const extentChanged = !equals(this.previousExtent_, frameState.extent);
    const sourceChanged = this.sourceRevision_ < vectorSource.getRevision();

    if (sourceChanged) {
      this.sourceRevision_ = vectorSource.getRevision();
    }

    if (viewNotMoving && (extentChanged || sourceChanged)) {
      const projection = viewState.projection;
      const resolution = viewState.resolution;

      const renderBuffer =
        layer instanceof BaseVector ? layer.getRenderBuffer() : 0;
      const extent = buffer(frameState.extent, renderBuffer * resolution);
      vectorSource.loadFeatures(extent, resolution, projection);

      this.rebuildBuffers_(frameState);
      this.previousExtent_ = frameState.extent.slice();
    }

    // apply the current projection transform with the invert of the one used to fill buffers
    this.helper.makeProjectionTransform(frameState, this.currentTransform_);
    multiplyTransform(this.currentTransform_, this.invertRenderTransform_);

    this.helper.useProgram(this.program_);
    this.helper.prepareDraw(frameState);

    // write new data
    this.helper.bindBuffer(this.verticesBuffer_);
    this.helper.bindBuffer(this.indicesBuffer_);

    this.helper.enableAttributes(this.attributes);

    return true;
  }
/**
   * Determine whether render should be called.
   * @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
   * @return {boolean} Layer is ready to be rendered.
   */
Determine whether render should be called.
Determine whether render should be called .
prepareFrame(frameState) {
    const layer = this.getLayer();
    const vectorSource = layer.getSource();
    const viewState = frameState.viewState;
    const viewNotMoving =
      !frameState.viewHints[ViewHint.ANIMATING] &&
      !frameState.viewHints[ViewHint.INTERACTING];
    const extentChanged = !equals(this.previousExtent_, frameState.extent);
    const sourceChanged = this.sourceRevision_ < vectorSource.getRevision();
    if (sourceChanged) {
      this.sourceRevision_ = vectorSource.getRevision();
    }
    if (viewNotMoving && (extentChanged || sourceChanged)) {
      const projection = viewState.projection;
      const resolution = viewState.resolution;
      const renderBuffer =
        layer instanceof BaseVector ? layer.getRenderBuffer() : 0;
      const extent = buffer(frameState.extent, renderBuffer * resolution);
      vectorSource.loadFeatures(extent, resolution, projection);
      this.rebuildBuffers_(frameState);
      this.previousExtent_ = frameState.extent.slice();
    }
    this.helper.makeProjectionTransform(frameState, this.currentTransform_);
    multiplyTransform(this.currentTransform_, this.invertRenderTransform_);
    this.helper.useProgram(this.program_);
    this.helper.prepareDraw(frameState);
    this.helper.bindBuffer(this.verticesBuffer_);
    this.helper.bindBuffer(this.indicesBuffer_);
    this.helper.enableAttributes(this.attributes);
    return true;
  }
prepareFrame ( frameState ) { const layer = this . getLayer ( ) ; const vectorSource = layer . getSource ( ) ; const viewState = frameState . viewState ; const viewNotMoving = ! frameState . viewHints [ ViewHint . ANIMATING ] && ! frameState . viewHints [ ViewHint . INTERACTING ] ; const extentChanged = ! equals ( this . previousExtent_ , frameState . extent ) ; const sourceChanged = this . sourceRevision_ < vectorSource . getRevision ( ) ; if ( sourceChanged ) { this . sourceRevision_ = vectorSource . getRevision ( ) ; } if ( viewNotMoving && ( extentChanged || sourceChanged ) ) { const projection = viewState . projection ; const resolution = viewState . resolution ; const renderBuffer = layer instanceof BaseVector ? layer . getRenderBuffer ( ) : 0 ; const extent = buffer ( frameState . extent , renderBuffer * resolution ) ; vectorSource . loadFeatures ( extent , resolution , projection ) ; this . rebuildBuffers_ ( frameState ) ; this . previousExtent_ = frameState . extent . slice ( ) ; } this . helper . makeProjectionTransform ( frameState , this . currentTransform_ ) ; multiplyTransform ( this . currentTransform_ , this . invertRenderTransform_ ) ; this . helper . useProgram ( this . program_ ) ; this . helper . prepareDraw ( frameState ) ; this . helper . bindBuffer ( this . verticesBuffer_ ) ; this . helper . bindBuffer ( this . indicesBuffer_ ) ; this . helper . enableAttributes ( this . attributes ) ; return true ; }
Determine whether render should be called.
Determine whether render should be called .
// apply the current projection transform with the invert of the one used to fill buffers // write new data