ol-deckgl

ol deckgl binding

OTHER License

Stars
5
Committers
1

ol-deckgl

  • ol-deckgl openlayers5(ol package)

Start

npm run website

node_moudles @deck.gl/core dist/esm/lib/deck.js

{
    key: "_checkForCanvasSizeChange",
    value: function _checkForCanvasSizeChange() {
      var canvas = this.canvas;

      if (canvas && (this.width !== canvas.clientWidth || this.height !== canvas.clientHeight)) {
        this.width = canvas.clientWidth;
        this.height = canvas.clientHeight;
        return true;
      }

      return false;
    }
  }

clientWidth => width; clientHeight => height

@deck.gl/core dist/esm/lib/draw-layers.js

var getGLViewport = function getGLViewport(gl, _ref2) {
  var viewport = _ref2.viewport,
      pixelRatio = _ref2.pixelRatio;
  // TODO - dummy default for node
  var height = gl.canvas ? gl.canvas.clientHeight : 100; // Convert viewport top-left CSS coordinates to bottom up WebGL coordinates

  var dimensions = viewport;
  return [dimensions.x * pixelRatio, (height - dimensions.y - dimensions.height) * pixelRatio, dimensions.width * pixelRatio, dimensions.height * pixelRatio];
}; // Helper functions

clientHeight height;

npm run website