modules/arcgis/src/arcgis-deck-layer-view-2d.js
// Called every time that the layer view must be rendered.
Called every time that the layer view must be rendered.
Called every time that the layer view must be rendered .
render(renderParameters) {
      const gl = renderParameters.context;
      const screenFbo = gl.getParameter(gl.FRAMEBUFFER_BINDING);
      const dpr = window.devicePixelRatio;
      this.createOrResizeFramebuffer(
        gl,
        Math.round(this.view.state.size[0] * dpr),
        Math.round(this.view.state.size[1] * dpr)
      );
      const state = renderParameters.state;
      this.deckgl.setProps({
        viewState: {
          latitude: this.view.center.latitude,
          longitude: this.view.center.longitude,
          zoom: this.view.featuresTilingScheme.scaleToLevel(state.scale),
          bearing: -state.rotation,
          pitch: 0
        }
      });
      this.deckgl.redraw(true);
      withParameters(
        gl,
        {
          blend: true,
          blendFunc: [gl.ONE, gl.ONE_MINUS_SRC_ALPHA],
          framebuffer: screenFbo,
          viewport: [
            0,
            0,
            Math.round(this.view.state.size[0] * dpr),
            Math.round(this.view.state.size[1] * dpr)
          ]
        },
        () => {
          this.model.setUniforms({u_texture: this.deckFbo}).draw();
        }
      );
    }
render ( renderParameters ) { const gl = renderParameters . context ; const screenFbo = gl . getParameter ( gl . FRAMEBUFFER_BINDING ) ; const dpr = window . devicePixelRatio ; this . createOrResizeFramebuffer ( gl , Math . round ( this . view . state . size [ 0 ] * dpr ) , Math . round ( this . view . state . size [ 1 ] * dpr ) ) ; const state = renderParameters . state ; this . deckgl . setProps ( { viewState : { latitude : this . view . center . latitude , longitude : this . view . center . longitude , zoom : this . view . featuresTilingScheme . scaleToLevel ( state . scale ) , bearing : - state . rotation , pitch : 0 } } ) ; this . deckgl . redraw ( true ) ; withParameters ( gl , { blend : true , blendFunc : [ gl . ONE , gl . ONE_MINUS_SRC_ALPHA ] , framebuffer : screenFbo , viewport : [ 0 , 0 , Math . round ( this . view . state . size [ 0 ] * dpr ) , Math . round ( this . view . state . size [ 1 ] * dpr ) ] } , ( ) => { this . model . setUniforms ( { u_texture : this . deckFbo } ) . draw ( ) ; } ) ; }
Called every time that the layer view must be rendered.
Called every time that the layer view must be rendered .
// eslint-disable-next-line // The view state must be kept in-sync with the MapView of the ArcGIS API. // We redraw the deck immediately. // We overlay the texture on top of the map using the full-screen quad.