@antv/l7-renderer 2.5.36 → 2.5.37-mini

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/regl/index.js CHANGED
@@ -17,6 +17,8 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
17
17
 
18
18
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
19
19
 
20
+ var _l7Utils = require("@antv/l7-utils");
21
+
20
22
  var _inversify = require("inversify");
21
23
 
22
24
  var _l7regl = _interopRequireDefault(require("l7regl"));
@@ -126,9 +128,13 @@ var ReglRendererService = (_dec = (0, _inversify.injectable)(), _dec(_class = fu
126
128
  };
127
129
  });
128
130
  (0, _defineProperty2.default)(this, "getContainer", function () {
129
- var _this$canvas;
131
+ if (_l7Utils.isMini) {
132
+ return _this.canvas;
133
+ } else {
134
+ var _this$canvas;
130
135
 
131
- return (_this$canvas = _this.canvas) === null || _this$canvas === void 0 ? void 0 : _this$canvas.parentElement;
136
+ return (_this$canvas = _this.canvas) === null || _this$canvas === void 0 ? void 0 : _this$canvas.parentElement;
137
+ }
132
138
  });
133
139
  (0, _defineProperty2.default)(this, "getCanvas", function () {
134
140
  return _this.canvas;
@@ -162,7 +168,7 @@ var ReglRendererService = (_dec = (0, _inversify.injectable)(), _dec(_class = fu
162
168
  premultipliedAlpha: true,
163
169
  preserveDrawingBuffer: cfg.preserveDrawingBuffer
164
170
  },
165
- extensions: ['OES_element_index_uint', 'OES_standard_derivatives', 'angle_instanced_arrays'],
171
+ extensions: ['OES_element_index_uint', 'OES_standard_derivatives', 'ANGLE_instanced_arrays'],
166
172
  optionalExtensions: ['oes_texture_float_linear', 'OES_texture_float', 'EXT_texture_filter_anisotropic', 'EXT_blend_minmax', 'WEBGL_depth_texture'],
167
173
  profile: true,
168
174
  onDone: function onDone(err, r) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/regl/index.ts"],"names":["ReglRendererService","options","ReglModel","gl","ReglAttribute","ReglBuffer","ReglElements","ReglTexture2D","ReglFramebuffer","framebuffer","drawCommands","get","color","depth","stencil","reglClearOptions","clear","x","y","width","height","_gl","viewport","_refresh","readPixelsOptions","read","drawingBufferWidth","drawingBufferHeight","canvas","parentElement","destroy","cfg","Promise","resolve","reject","attributes","alpha","antialias","premultipliedAlpha","preserveDrawingBuffer","extensions","optionalExtensions","profile","onDone","err","r","extensionObject","OES_texture_float","testExtension","name","getGLContext","getExtension","cull","enable","face","blend","equation","disable","CULL_FACE","flag","isDirty"],"mappings":";;;;;;;;;;;;;;;;;;;AAuBA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;IAMqBA,mB,WADpB,4B;;;;;;;;;;;;uDA8DsB,UAACC,OAAD;AAAA,aACnB,IAAIC,kBAAJ,CAAc,KAAI,CAACC,EAAnB,EAAuBF,OAAvB,CADmB;AAAA,K;2DAGI,UACvBA,OADuB;AAAA,aAER,IAAIG,sBAAJ,CAAkB,KAAI,CAACD,EAAvB,EAA2BF,OAA3B,CAFQ;AAAA,K;wDAIH,UAACA,OAAD;AAAA,aACpB,IAAII,mBAAJ,CAAe,KAAI,CAACF,EAApB,EAAwBF,OAAxB,CADoB;AAAA,K;0DAGE,UACtBA,OADsB;AAAA,aAER,IAAIK,qBAAJ,CAAiB,KAAI,CAACH,EAAtB,EAA0BF,OAA1B,CAFQ;AAAA,K;2DAIC,UACvBA,OADuB;AAAA,aAER,IAAIM,sBAAJ,CAAkB,KAAI,CAACJ,EAAvB,EAA2BF,OAA3B,CAFQ;AAAA,K;6DAIE,UAACA,OAAD;AAAA,aACzB,IAAIO,wBAAJ,CAAoB,KAAI,CAACL,EAAzB,EAA6BF,OAA7B,CADyB;AAAA,K;0DAGH,UACtBQ,WADsB,EAEtBC,YAFsB,EAGnB;AACH,MAAA,KAAI,CAACP,EAAL,CAAQ;AACNM,QAAAA,WAAW,EAAEA,WAAW,GAAIA,WAAD,CAAiCE,GAAjC,EA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AAA,QAAQ,EAAE;AAFL,SAXD;AAeN/C,QAAAA,WAAW,EAAE;AAfP,OAAR;;AAiBA,WAAKN,EAAL,CAAQoB,QAAR;AACD;;;WACD,kCAAgC;AAC9B,UAAMpB,EAAE,GAAG,KAAK+C,YAAL,EAAX;AACA/C,MAAAA,EAAE,CAACsD,OAAH,CAAWtD,EAAE,CAACuD,SAAd;AACD;;;WAED,kBAAgBC,IAAhB,EAAqC;AACnC,WAAKC,OAAL,GAAeD,IAAf;AACD;;;WAED,oBAA2B;AACzB,aAAO,KAAKC,OAAZ;AACD","sourcesContent":["/**\n * render w/ regl\n * @see https://github.com/regl-project/regl/blob/gh-pages/API.md\n */\nimport {\n IAttribute,\n IAttributeInitializationOptions,\n IBuffer,\n IBufferInitializationOptions,\n IClearOptions,\n IElements,\n IElementsInitializationOptions,\n IExtensions,\n IFramebuffer,\n IFramebufferInitializationOptions,\n IModel,\n IModelInitializationOptions,\n IReadPixelsOptions,\n IRenderConfig,\n IRendererService,\n ITexture2D,\n ITexture2DInitializationOptions,\n} from '@antv/l7-core';\nimport { injectable } from 'inversify';\nimport regl from 'l7regl';\nimport 'reflect-metadata';\nimport ReglAttribute from './ReglAttribute';\nimport ReglBuffer from './ReglBuffer';\nimport ReglElements from './ReglElements';\nimport ReglFramebuffer from './ReglFramebuffer';\nimport ReglModel from './ReglModel';\nimport ReglTexture2D from './ReglTexture2D';\n\n/**\n * regl renderer\n */\n@injectable()\nexport default class ReglRendererService implements IRendererService {\n public extensionObject: IExtensions;\n private gl: regl.Regl;\n private $container: HTMLDivElement | null;\n private canvas: HTMLCanvasElement;\n private width: number;\n private height: number;\n private isDirty: boolean;\n\n public async init(\n canvas: HTMLCanvasElement,\n cfg: IRenderConfig,\n ): Promise<void> {\n // this.$container = $container;\n this.canvas = canvas;\n // tslint:disable-next-line:typedef\n this.gl = await new Promise((resolve, reject) => {\n regl({\n canvas: this.canvas,\n attributes: {\n alpha: true,\n // use TAA instead of MSAA\n // @see https://www.khronos.org/registry/webgl/specs/1.0/#5.2.1\n antialias: cfg.antialias,\n premultipliedAlpha: true,\n preserveDrawingBuffer: cfg.preserveDrawingBuffer,\n },\n // TODO: use extensions\n extensions: [\n 'OES_element_index_uint',\n 'OES_standard_derivatives', // wireframe\n 'angle_instanced_arrays', // VSM shadow map\n ],\n optionalExtensions: [\n 'oes_texture_float_linear',\n 'OES_texture_float',\n 'EXT_texture_filter_anisotropic',\n 'EXT_blend_minmax',\n 'WEBGL_depth_texture',\n ],\n profile: true,\n onDone: (err: Error | null, r?: regl.Regl | undefined): void => {\n if (err || !r) {\n reject(err);\n }\n // @ts-ignore\n resolve(r);\n },\n });\n });\n\n this.extensionObject = {\n OES_texture_float: this.testExtension('OES_texture_float'),\n };\n }\n\n public testExtension(name: string) {\n // OES_texture_float\n return !!this.getGLContext().getExtension(name);\n }\n\n public createModel = (options: IModelInitializationOptions): IModel =>\n new ReglModel(this.gl, options);\n\n public createAttribute = (\n options: IAttributeInitializationOptions,\n ): IAttribute => new ReglAttribute(this.gl, options);\n\n public createBuffer = (options: IBufferInitializationOptions): IBuffer =>\n new ReglBuffer(this.gl, options);\n\n public createElements = (\n options: IElementsInitializationOptions,\n ): IElements => new ReglElements(this.gl, options);\n\n public createTexture2D = (\n options: ITexture2DInitializationOptions,\n ): ITexture2D => new ReglTexture2D(this.gl, options);\n\n public createFramebuffer = (options: IFramebufferInitializationOptions) =>\n new ReglFramebuffer(this.gl, options);\n\n public useFramebuffer = (\n framebuffer: IFramebuffer | null,\n drawCommands: () => void,\n ) => {\n this.gl({\n framebuffer: framebuffer ? (framebuffer as ReglFramebuffer).get() : null,\n })(drawCommands);\n };\n\n public clear = (options: IClearOptions) => {\n // @see https://github.com/regl-project/regl/blob/gh-pages/API.md#clear-the-draw-buffer\n const { color, depth, stencil, framebuffer = null } = options;\n const reglClearOptions: regl.ClearOptions = {\n color,\n depth,\n stencil,\n };\n\n reglClearOptions.framebuffer =\n framebuffer === null\n ? framebuffer\n : (framebuffer as ReglFramebuffer).get();\n\n this.gl.clear(reglClearOptions);\n };\n\n public viewport = ({\n x,\n y,\n width,\n height,\n }: {\n x: number;\n y: number;\n width: number;\n height: number;\n }) => {\n // use WebGL context directly\n // @see https://github.com/regl-project/regl/blob/gh-pages/API.md#unsafe-escape-hatch\n this.gl._gl.viewport(x, y, width, height);\n this.width = width;\n this.height = height;\n this.gl._refresh();\n };\n\n public readPixels = (options: IReadPixelsOptions) => {\n const { framebuffer, x, y, width, height } = options;\n const readPixelsOptions: regl.ReadOptions = {\n x,\n y,\n width,\n height,\n };\n if (framebuffer) {\n readPixelsOptions.framebuffer = (framebuffer as ReglFramebuffer).get();\n }\n return this.gl.read(readPixelsOptions);\n };\n\n public getViewportSize = () => {\n return {\n width: this.gl._gl.drawingBufferWidth,\n height: this.gl._gl.drawingBufferHeight,\n };\n };\n\n public getContainer = () => {\n return this.canvas?.parentElement;\n };\n\n public getCanvas = () => {\n // return this.$container?.getElementsByTagName('canvas')[0] || null;\n return this.canvas;\n };\n\n public getGLContext = () => {\n return this.gl._gl;\n };\n\n public setBaseState() {\n this.gl({\n cull: {\n enable: false,\n face: 'back',\n },\n viewport: {\n x: 0,\n y: 0,\n height: this.width,\n width: this.height,\n },\n blend: {\n enable: false,\n equation: 'add',\n },\n framebuffer: null,\n });\n this.gl._refresh();\n }\n public setCustomLayerDefaults() {\n const gl = this.getGLContext();\n gl.disable(gl.CULL_FACE);\n }\n\n public setDirty(flag: boolean): void {\n this.isDirty = flag;\n }\n\n public getDirty(): boolean {\n return this.isDirty;\n }\n\n public destroy = () => {\n // @see https://github.com/regl-project/regl/blob/gh-pages/API.md#clean-up\n this.gl.destroy();\n };\n}\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../src/regl/index.ts"],"names":["ReglRendererService","options","ReglModel","gl","ReglAttribute","ReglBuffer","ReglElements","ReglTexture2D","ReglFramebuffer","framebuffer","drawCommands","get","color","depth","stencil","reglClearOptions","clear","x","y","width","height","_gl","viewport","_refresh","readPixelsOptions","read","drawingBufferWidth","drawingBufferHeight","isMini","canvas","parentElement","destroy","cfg","Promise","resolve","reject","attributes","alpha","antialias","premultipliedAlpha","preserveDrawingBuffer","extensions","optionalExtensions","profile","onDone","err","r","extensionObject","OES_texture_float","testExtension","name","getGLContext","getExtension","cull","enable","face","blend","equation","disable","CULL_FACE","flag","isDirty"],"mappings":";;;;;;;;;;;;;;;;;;;AAuBA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;IAMqBA,mB,WADpB,4B;;;;;;;;;;;;uDA8DsB,UAACC,OAAD;AAAA,aACnB,IAAIC,kBAAJ,CAAc,KAAI,CAACC,EAAnB,EAAuBF,OAAvB,CADmB;AAAA,K;2DAGI,UACvBA,OADuB;AAAA,aAER,IAAIG,sBAAJ,CAAkB,KAAI,CAACD,EAAvB,EAA2BF,OAA3B,CAFQ;AAAA,K;wDAIH,UAACA,OAAD;AAAA,aACpB,IAAII,mBAAJ,CAAe,KAAI,CAACF,EAApB,EAAwBF,OAAxB,CADoB;AAAA,K;0DAGE,UACtBA,OADsB;AAAA,aAER,IAAIK,qBAAJ,CAAiB,KAAI,CAACH,EAAtB,EAA0BF,OAA1B,CAFQ;AAAA,K;2DAIC,UACvBA,OADuB;AAAA,aAER,IAAIM,sBAAJ,CAAkB,KAAI,CAACJ,EAAvB,EAA2BF,OAA3B,CAFQ;AAAA,K;6DAIE,UAACA,OAAD;AAAA,aACzB,IAAIO,wBAAJ,CAAoB,KAAI,CAACL,EAAzB,EAA6BF,OAA7B,CADyB;AAAA,K;0DAGH,UACtBQ,WADsB,EAEtBC,YAFsB,EAGnB;AACH,MAAA,KAAI,CAACP,EAAL,CAAQ;AACNM,QAAAA,WAAW,EAAEA,WAAW,GAAIA,WAAD,CAAiCE,GAAjC,EAAH,GAA4C;AAD9D,OAAR,EAEGD,YAFH;AAGD,K;iDAEc,UAACT,OAAD,EAA4B;AAEzC,UAAQW,KAAR,GAAsDX,OAAtD,CAAQW,K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QAAAA,WAAW,EAAE;AAfP,OAAR;;AAiBA,WAAKN,EAAL,CAAQoB,QAAR;AACD;;;WACD,kCAAgC;AAC9B,UAAMpB,EAAE,GAAG,KAAKgD,YAAL,EAAX;AACAhD,MAAAA,EAAE,CAACuD,OAAH,CAAWvD,EAAE,CAACwD,SAAd;AACD;;;WAED,kBAAgBC,IAAhB,EAAqC;AACnC,WAAKC,OAAL,GAAeD,IAAf;AACD;;;WAED,oBAA2B;AACzB,aAAO,KAAKC,OAAZ;AACD","sourcesContent":["/**\n * render w/ regl\n * @see https://github.com/regl-project/regl/blob/gh-pages/API.md\n */\nimport {\n IAttribute,\n IAttributeInitializationOptions,\n IBuffer,\n IBufferInitializationOptions,\n IClearOptions,\n IElements,\n IElementsInitializationOptions,\n IExtensions,\n IFramebuffer,\n IFramebufferInitializationOptions,\n IModel,\n IModelInitializationOptions,\n IReadPixelsOptions,\n IRenderConfig,\n IRendererService,\n ITexture2D,\n ITexture2DInitializationOptions,\n} from '@antv/l7-core';\nimport { isMini } from '@antv/l7-utils';\nimport { injectable } from 'inversify';\nimport regl from 'l7regl';\nimport 'reflect-metadata';\nimport ReglAttribute from './ReglAttribute';\nimport ReglBuffer from './ReglBuffer';\nimport ReglElements from './ReglElements';\nimport ReglFramebuffer from './ReglFramebuffer';\nimport ReglModel from './ReglModel';\nimport ReglTexture2D from './ReglTexture2D';\n\n/**\n * regl renderer\n */\n@injectable()\nexport default class ReglRendererService implements IRendererService {\n public extensionObject: IExtensions;\n private gl: regl.Regl;\n private $container: HTMLDivElement | null;\n private canvas: HTMLCanvasElement;\n private width: number;\n private height: number;\n private isDirty: boolean;\n\n public async init(\n canvas: HTMLCanvasElement,\n cfg: IRenderConfig,\n ): Promise<void> {\n // this.$container = $container;\n this.canvas = canvas;\n // tslint:disable-next-line:typedef\n this.gl = await new Promise((resolve, reject) => {\n regl({\n canvas: this.canvas,\n attributes: {\n alpha: true,\n // use TAA instead of MSAA\n // @see https://www.khronos.org/registry/webgl/specs/1.0/#5.2.1\n antialias: cfg.antialias,\n premultipliedAlpha: true,\n preserveDrawingBuffer: cfg.preserveDrawingBuffer,\n },\n // TODO: use extensions\n extensions: [\n 'OES_element_index_uint',\n 'OES_standard_derivatives', // wireframe\n 'ANGLE_instanced_arrays', // VSM shadow map\n ],\n optionalExtensions: [\n 'oes_texture_float_linear',\n 'OES_texture_float',\n 'EXT_texture_filter_anisotropic',\n 'EXT_blend_minmax',\n 'WEBGL_depth_texture',\n ],\n profile: true,\n onDone: (err: Error | null, r?: regl.Regl | undefined): void => {\n if (err || !r) {\n reject(err);\n }\n // @ts-ignore\n resolve(r);\n },\n });\n });\n\n this.extensionObject = {\n OES_texture_float: this.testExtension('OES_texture_float'),\n };\n }\n\n public testExtension(name: string) {\n // OES_texture_float\n return !!this.getGLContext().getExtension(name);\n }\n\n public createModel = (options: IModelInitializationOptions): IModel =>\n new ReglModel(this.gl, options);\n\n public createAttribute = (\n options: IAttributeInitializationOptions,\n ): IAttribute => new ReglAttribute(this.gl, options);\n\n public createBuffer = (options: IBufferInitializationOptions): IBuffer =>\n new ReglBuffer(this.gl, options);\n\n public createElements = (\n options: IElementsInitializationOptions,\n ): IElements => new ReglElements(this.gl, options);\n\n public createTexture2D = (\n options: ITexture2DInitializationOptions,\n ): ITexture2D => new ReglTexture2D(this.gl, options);\n\n public createFramebuffer = (options: IFramebufferInitializationOptions) =>\n new ReglFramebuffer(this.gl, options);\n\n public useFramebuffer = (\n framebuffer: IFramebuffer | null,\n drawCommands: () => void,\n ) => {\n this.gl({\n framebuffer: framebuffer ? (framebuffer as ReglFramebuffer).get() : null,\n })(drawCommands);\n };\n\n public clear = (options: IClearOptions) => {\n // @see https://github.com/regl-project/regl/blob/gh-pages/API.md#clear-the-draw-buffer\n const { color, depth, stencil, framebuffer = null } = options;\n const reglClearOptions: regl.ClearOptions = {\n color,\n depth,\n stencil,\n };\n\n reglClearOptions.framebuffer =\n framebuffer === null\n ? framebuffer\n : (framebuffer as ReglFramebuffer).get();\n\n this.gl.clear(reglClearOptions);\n };\n\n public viewport = ({\n x,\n y,\n width,\n height,\n }: {\n x: number;\n y: number;\n width: number;\n height: number;\n }) => {\n // use WebGL context directly\n // @see https://github.com/regl-project/regl/blob/gh-pages/API.md#unsafe-escape-hatch\n this.gl._gl.viewport(x, y, width, height);\n this.width = width;\n this.height = height;\n this.gl._refresh();\n };\n\n public readPixels = (options: IReadPixelsOptions) => {\n const { framebuffer, x, y, width, height } = options;\n const readPixelsOptions: regl.ReadOptions = {\n x,\n y,\n width,\n height,\n };\n if (framebuffer) {\n readPixelsOptions.framebuffer = (framebuffer as ReglFramebuffer).get();\n }\n return this.gl.read(readPixelsOptions);\n };\n\n public getViewportSize = () => {\n return {\n width: this.gl._gl.drawingBufferWidth,\n height: this.gl._gl.drawingBufferHeight,\n };\n };\n\n public getContainer = () => {\n if (isMini) {\n return this.canvas;\n } else {\n return this.canvas?.parentElement;\n }\n };\n\n public getCanvas = () => {\n // return this.$container?.getElementsByTagName('canvas')[0] || null;\n return this.canvas;\n };\n\n public getGLContext = () => {\n return this.gl._gl;\n };\n\n public setBaseState() {\n this.gl({\n cull: {\n enable: false,\n face: 'back',\n },\n viewport: {\n x: 0,\n y: 0,\n height: this.width,\n width: this.height,\n },\n blend: {\n enable: false,\n equation: 'add',\n },\n framebuffer: null,\n });\n this.gl._refresh();\n }\n public setCustomLayerDefaults() {\n const gl = this.getGLContext();\n gl.disable(gl.CULL_FACE);\n }\n\n public setDirty(flag: boolean): void {\n this.isDirty = flag;\n }\n\n public getDirty(): boolean {\n return this.isDirty;\n }\n\n public destroy = () => {\n // @see https://github.com/regl-project/regl/blob/gh-pages/API.md#clean-up\n this.gl.destroy();\n };\n}\n"],"file":"index.js"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/l7-renderer",
3
- "version": "2.5.36",
3
+ "version": "2.5.37-mini",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -26,14 +26,14 @@
26
26
  "gl": "^4.4.0"
27
27
  },
28
28
  "dependencies": {
29
- "@antv/l7-core": "^2.5.36",
29
+ "@antv/l7-core": "^2.5.37-mini",
30
30
  "@babel/runtime": "^7.7.7",
31
31
  "inversify": "^5.0.1",
32
32
  "l7regl": "^0.0.14",
33
33
  "lodash": "^4.17.15",
34
34
  "reflect-metadata": "^0.1.13"
35
35
  },
36
- "gitHead": "6a0a83e2834cd449376315c572ea1a6182b8aa4a",
36
+ "gitHead": "684ba4eb806a798713496d3fc0b4d1e17517dc31",
37
37
  "publishConfig": {
38
38
  "access": "public"
39
39
  }
package/CHANGELOG.md DELETED
@@ -1,350 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ## [2.1.12](https://github.com/antvis/L7/compare/v2.1.11...v2.1.12) (2020-04-10)
7
-
8
- **Note:** Version bump only for package @antv/l7-renderer
9
-
10
-
11
-
12
-
13
-
14
- ## [2.1.11](https://github.com/antvis/L7/compare/v2.1.10...v2.1.11) (2020-04-07)
15
-
16
- **Note:** Version bump only for package @antv/l7-renderer
17
-
18
-
19
-
20
-
21
-
22
- ## [2.1.8](https://github.com/antvis/L7/compare/v2.1.7...v2.1.8) (2020-03-26)
23
-
24
- **Note:** Version bump only for package @antv/l7-renderer
25
-
26
-
27
-
28
-
29
-
30
- ## [2.1.7](https://github.com/antvis/L7/compare/v2.1.6...v2.1.7) (2020-03-26)
31
-
32
- **Note:** Version bump only for package @antv/l7-renderer
33
-
34
-
35
-
36
-
37
-
38
- ## [2.1.5](https://github.com/antvis/L7/compare/v2.1.4...v2.1.5) (2020-03-20)
39
-
40
- **Note:** Version bump only for package @antv/l7-renderer
41
-
42
-
43
-
44
-
45
-
46
- ## [2.1.3](https://github.com/antvis/L7/compare/v2.0.36...v2.1.3) (2020-03-17)
47
-
48
-
49
- ### Bug Fixes
50
-
51
- * ios 12 点击事件问题 & regl 版本锁定 ([ad52e8e](https://github.com/antvis/L7/commit/ad52e8e8fde4a7b4b3e16d86a6035bd7c07fb80c))
52
-
53
-
54
-
55
-
56
-
57
- ## [2.1.2](https://github.com/antvis/L7/compare/v2.0.36...v2.1.2) (2020-03-15)
58
-
59
-
60
- ### Bug Fixes
61
-
62
- * ios 12 点击事件问题 & regl 版本锁定 ([ad52e8e](https://github.com/antvis/L7/commit/ad52e8e8fde4a7b4b3e16d86a6035bd7c07fb80c))
63
-
64
-
65
-
66
-
67
-
68
- ## [2.1.1](https://github.com/antvis/L7/compare/v2.0.36...v2.1.1) (2020-03-15)
69
-
70
-
71
- ### Bug Fixes
72
-
73
- * ios 12 点击事件问题 & regl 版本锁定 ([ad52e8e](https://github.com/antvis/L7/commit/ad52e8e8fde4a7b4b3e16d86a6035bd7c07fb80c))
74
-
75
-
76
-
77
-
78
-
79
- ## [2.0.34](https://github.com/antvis/L7/compare/v2.0.32...v2.0.34) (2020-03-02)
80
-
81
- **Note:** Version bump only for package @antv/l7-renderer
82
-
83
-
84
-
85
-
86
-
87
- # [2.0.0-beta.28](https://github.com/antvis/L7/compare/v2.0.0-beta.16...v2.0.0-beta.28) (2020-01-02)
88
-
89
-
90
- ### Bug Fixes
91
-
92
- * render 将gl模块移动到开发分支, update tslint rule ([fe8b480](https://github.com/antvis/L7/commit/fe8b480895a3d6d919e63f93306a203f5582e5d6))
93
- * 修复webgl 扩展兼容问题 ([cd6f5fc](https://github.com/antvis/L7/commit/cd6f5fc7d202f7db1424f3c8b263a99d39d7c778))
94
- * **scene:** contianer resize ([1c3be82](https://github.com/antvis/L7/commit/1c3be82711999b70a802a7f0c24ff9ccf76e2d94))
95
-
96
-
97
- ### Features
98
-
99
- * add raster layer ([2b28380](https://github.com/antvis/L7/commit/2b2838015198b8586b0c30fdc154116252a76f29))
100
- * **layer:** add blend 效果配置支持 normal,additive ([e0ab4cd](https://github.com/antvis/L7/commit/e0ab4cd386f53ba4e93aaebfb1fa05b6e438710e))
101
-
102
-
103
-
104
-
105
-
106
- # [2.0.0-beta.27](https://github.com/antvis/L7/compare/v2.0.0-beta.16...v2.0.0-beta.27) (2020-01-01)
107
-
108
-
109
- ### Bug Fixes
110
-
111
- * render 将gl模块移动到开发分支, update tslint rule ([fe8b480](https://github.com/antvis/L7/commit/fe8b480895a3d6d919e63f93306a203f5582e5d6))
112
- * 修复webgl 扩展兼容问题 ([cd6f5fc](https://github.com/antvis/L7/commit/cd6f5fc7d202f7db1424f3c8b263a99d39d7c778))
113
- * **scene:** contianer resize ([1c3be82](https://github.com/antvis/L7/commit/1c3be82711999b70a802a7f0c24ff9ccf76e2d94))
114
-
115
-
116
- ### Features
117
-
118
- * **layer:** add blend 效果配置支持 normal,additive ([e0ab4cd](https://github.com/antvis/L7/commit/e0ab4cd386f53ba4e93aaebfb1fa05b6e438710e))
119
-
120
-
121
-
122
-
123
-
124
- # [2.0.0-alpha.28](https://github.com/antvis/L7/compare/v2.0.0-beta.16...v2.0.0-alpha.28) (2020-01-01)
125
-
126
-
127
- ### Bug Fixes
128
-
129
- * render 将gl模块移动到开发分支, update tslint rule ([fe8b480](https://github.com/antvis/L7/commit/fe8b480895a3d6d919e63f93306a203f5582e5d6))
130
- * 修复webgl 扩展兼容问题 ([cd6f5fc](https://github.com/antvis/L7/commit/cd6f5fc7d202f7db1424f3c8b263a99d39d7c778))
131
- * **scene:** contianer resize ([1c3be82](https://github.com/antvis/L7/commit/1c3be82711999b70a802a7f0c24ff9ccf76e2d94))
132
-
133
-
134
- ### Features
135
-
136
- * **layer:** add blend 效果配置支持 normal,additive ([e0ab4cd](https://github.com/antvis/L7/commit/e0ab4cd386f53ba4e93aaebfb1fa05b6e438710e))
137
-
138
-
139
-
140
-
141
-
142
- # [2.0.0-alpha.27](https://github.com/antvis/L7/compare/v2.0.0-beta.16...v2.0.0-alpha.27) (2019-12-31)
143
-
144
-
145
- ### Bug Fixes
146
-
147
- * render 将gl模块移动到开发分支, update tslint rule ([fe8b480](https://github.com/antvis/L7/commit/fe8b480895a3d6d919e63f93306a203f5582e5d6))
148
- * 修复webgl 扩展兼容问题 ([cd6f5fc](https://github.com/antvis/L7/commit/cd6f5fc7d202f7db1424f3c8b263a99d39d7c778))
149
- * **scene:** contianer resize ([1c3be82](https://github.com/antvis/L7/commit/1c3be82711999b70a802a7f0c24ff9ccf76e2d94))
150
-
151
-
152
- ### Features
153
-
154
- * **layer:** add blend 效果配置支持 normal,additive ([e0ab4cd](https://github.com/antvis/L7/commit/e0ab4cd386f53ba4e93aaebfb1fa05b6e438710e))
155
-
156
-
157
-
158
-
159
-
160
- # [2.0.0-beta.26](https://github.com/antvis/L7/compare/v2.0.0-beta.16...v2.0.0-beta.26) (2019-12-30)
161
-
162
-
163
- ### Bug Fixes
164
-
165
- * render 将gl模块移动到开发分支, update tslint rule ([fe8b480](https://github.com/antvis/L7/commit/fe8b480895a3d6d919e63f93306a203f5582e5d6))
166
- * 修复webgl 扩展兼容问题 ([cd6f5fc](https://github.com/antvis/L7/commit/cd6f5fc7d202f7db1424f3c8b263a99d39d7c778))
167
- * **scene:** contianer resize ([1c3be82](https://github.com/antvis/L7/commit/1c3be82711999b70a802a7f0c24ff9ccf76e2d94))
168
-
169
-
170
- ### Features
171
-
172
- * **layer:** add blend 效果配置支持 normal,additive ([e0ab4cd](https://github.com/antvis/L7/commit/e0ab4cd386f53ba4e93aaebfb1fa05b6e438710e))
173
-
174
-
175
-
176
-
177
-
178
- # [2.0.0-beta.25](https://github.com/antvis/L7/compare/v2.0.0-beta.16...v2.0.0-beta.25) (2019-12-27)
179
-
180
-
181
- ### Bug Fixes
182
-
183
- * 修复webgl 扩展兼容问题 ([cd6f5fc](https://github.com/antvis/L7/commit/cd6f5fc7d202f7db1424f3c8b263a99d39d7c778))
184
- * render 将gl模块移动到开发分支, update tslint rule ([fe8b480](https://github.com/antvis/L7/commit/fe8b480895a3d6d919e63f93306a203f5582e5d6))
185
- * **scene:** contianer resize ([1c3be82](https://github.com/antvis/L7/commit/1c3be82711999b70a802a7f0c24ff9ccf76e2d94))
186
-
187
-
188
- ### Features
189
-
190
- * **layer:** add blend 效果配置支持 normal,additive ([e0ab4cd](https://github.com/antvis/L7/commit/e0ab4cd386f53ba4e93aaebfb1fa05b6e438710e))
191
-
192
-
193
-
194
-
195
-
196
- # [2.0.0-beta.24](https://github.com/antvis/L7/compare/v2.0.0-beta.16...v2.0.0-beta.24) (2019-12-23)
197
-
198
-
199
- ### Bug Fixes
200
-
201
- * 修复webgl 扩展兼容问题 ([cd6f5fc](https://github.com/antvis/L7/commit/cd6f5fc7d202f7db1424f3c8b263a99d39d7c778))
202
- * render 将gl模块移动到开发分支, update tslint rule ([fe8b480](https://github.com/antvis/L7/commit/fe8b480895a3d6d919e63f93306a203f5582e5d6))
203
- * **scene:** contianer resize ([1c3be82](https://github.com/antvis/L7/commit/1c3be82711999b70a802a7f0c24ff9ccf76e2d94))
204
-
205
-
206
- ### Features
207
-
208
- * **layer:** add blend 效果配置支持 normal,additive ([e0ab4cd](https://github.com/antvis/L7/commit/e0ab4cd386f53ba4e93aaebfb1fa05b6e438710e))
209
-
210
-
211
-
212
-
213
-
214
- # [2.0.0-beta.23](https://github.com/antvis/L7/compare/v2.0.0-beta.16...v2.0.0-beta.23) (2019-12-23)
215
-
216
-
217
- ### Bug Fixes
218
-
219
- * 修复webgl 扩展兼容问题 ([cd6f5fc](https://github.com/antvis/L7/commit/cd6f5fc7d202f7db1424f3c8b263a99d39d7c778))
220
- * render 将gl模块移动到开发分支, update tslint rule ([fe8b480](https://github.com/antvis/L7/commit/fe8b480895a3d6d919e63f93306a203f5582e5d6))
221
- * **scene:** contianer resize ([1c3be82](https://github.com/antvis/L7/commit/1c3be82711999b70a802a7f0c24ff9ccf76e2d94))
222
-
223
-
224
- ### Features
225
-
226
- * **layer:** add blend 效果配置支持 normal,additive ([e0ab4cd](https://github.com/antvis/L7/commit/e0ab4cd386f53ba4e93aaebfb1fa05b6e438710e))
227
-
228
-
229
-
230
-
231
-
232
- # [2.0.0-beta.21](https://github.com/antvis/L7/compare/v2.0.0-beta.16...v2.0.0-beta.21) (2019-12-18)
233
-
234
-
235
- ### Bug Fixes
236
-
237
- * 修复webgl 扩展兼容问题 ([cd6f5fc](https://github.com/antvis/L7/commit/cd6f5fc7d202f7db1424f3c8b263a99d39d7c778))
238
- * render 将gl模块移动到开发分支, update tslint rule ([fe8b480](https://github.com/antvis/L7/commit/fe8b480895a3d6d919e63f93306a203f5582e5d6))
239
- * **scene:** contianer resize ([1c3be82](https://github.com/antvis/L7/commit/1c3be82711999b70a802a7f0c24ff9ccf76e2d94))
240
-
241
-
242
- ### Features
243
-
244
- * **layer:** add blend 效果配置支持 normal,additive ([e0ab4cd](https://github.com/antvis/L7/commit/e0ab4cd386f53ba4e93aaebfb1fa05b6e438710e))
245
-
246
-
247
-
248
-
249
-
250
- # [2.0.0-beta.20](https://github.com/antvis/L7/compare/v2.0.0-beta.16...v2.0.0-beta.20) (2019-12-12)
251
-
252
-
253
- ### Bug Fixes
254
-
255
- * 修复webgl 扩展兼容问题 ([cd6f5fc](https://github.com/antvis/L7/commit/cd6f5fc7d202f7db1424f3c8b263a99d39d7c778))
256
- * **scene:** contianer resize ([1c3be82](https://github.com/antvis/L7/commit/1c3be82711999b70a802a7f0c24ff9ccf76e2d94))
257
-
258
-
259
-
260
-
261
-
262
- # [2.0.0-beta.19](https://github.com/antvis/L7/compare/v2.0.0-beta.16...v2.0.0-beta.19) (2019-12-08)
263
-
264
-
265
- ### Bug Fixes
266
-
267
- * 修复webgl 扩展兼容问题 ([cd6f5fc](https://github.com/antvis/L7/commit/cd6f5fc7d202f7db1424f3c8b263a99d39d7c778))
268
- * **scene:** contianer resize ([1c3be82](https://github.com/antvis/L7/commit/1c3be82711999b70a802a7f0c24ff9ccf76e2d94))
269
-
270
-
271
-
272
-
273
-
274
- # [2.0.0-beta.18](https://github.com/antvis/L7/compare/v2.0.0-beta.16...v2.0.0-beta.18) (2019-12-08)
275
-
276
-
277
- ### Bug Fixes
278
-
279
- * 修复webgl 扩展兼容问题 ([cd6f5fc](https://github.com/antvis/L7/commit/cd6f5fc7d202f7db1424f3c8b263a99d39d7c778))
280
- * **scene:** contianer resize ([1c3be82](https://github.com/antvis/L7/commit/1c3be82711999b70a802a7f0c24ff9ccf76e2d94))
281
-
282
-
283
-
284
-
285
-
286
- # [2.0.0-beta.17](https://github.com/antvis/L7/compare/v2.0.0-beta.16...v2.0.0-beta.17) (2019-12-08)
287
-
288
-
289
- ### Bug Fixes
290
-
291
- * 修复webgl 扩展兼容问题 ([cd6f5fc](https://github.com/antvis/L7/commit/cd6f5fc7d202f7db1424f3c8b263a99d39d7c778))
292
- * **scene:** contianer resize ([1c3be82](https://github.com/antvis/L7/commit/1c3be82711999b70a802a7f0c24ff9ccf76e2d94))
293
-
294
-
295
-
296
-
297
-
298
- # [2.0.0-beta.16](https://github.com/antvis/L7/compare/v2.0.0-beta.15...v2.0.0-beta.16) (2019-11-29)
299
-
300
- **Note:** Version bump only for package @antv/l7-renderer
301
-
302
-
303
-
304
-
305
-
306
- # [2.0.0-beta.15](https://github.com/antvis/L7/compare/v2.0.0-beta.14...v2.0.0-beta.15) (2019-11-29)
307
-
308
- **Note:** Version bump only for package @antv/l7-renderer
309
-
310
-
311
-
312
-
313
-
314
- # [2.0.0-beta.13](https://github.com/antvis/L7/compare/v2.0.0-beta.12...v2.0.0-beta.13) (2019-11-28)
315
-
316
- **Note:** Version bump only for package @antv/l7-renderer
317
-
318
-
319
-
320
-
321
-
322
- # [2.0.0-beta.12](https://github.com/antvis/L7/compare/v2.0.0-beta.11...v2.0.0-beta.12) (2019-11-28)
323
-
324
-
325
- ### Bug Fixes
326
-
327
- * **component:** fix marker ([14d4818](https://github.com/antvis/L7/commit/14d48184a1579241b077110ed51a8358de25e010))
328
-
329
-
330
-
331
-
332
-
333
- # 2.0.0-beta.11 (2019-11-28)
334
-
335
-
336
- ### Bug Fixes
337
-
338
- * eslint bug ([52e8afc](https://github.com/antvis/L7/commit/52e8afcb345151f4e544a4227590e6eebd7b42bd))
339
- * **layers:** heatmap 3d effect ([c99bb27](https://github.com/antvis/L7/commit/c99bb27d94ad9b6b1e85b7b153953dd2a7455db8))
340
- * **merge:** fix conflict ([07e8505](https://github.com/antvis/L7/commit/07e85059ebd40506623253feb624ee3083f393ae))
341
- * **tslint:** fix tslint error ([aed5e9e](https://github.com/antvis/L7/commit/aed5e9e51b5dd214cc19baece7dd0138b336a5d5))
342
-
343
-
344
- ### Features
345
-
346
- * **add l7 site:** add websites ([0463ff8](https://github.com/antvis/L7/commit/0463ff874eab1c484b593e8c02f73c85a02c000c))
347
- * **layer:** add imagelayer ([a995815](https://github.com/antvis/L7/commit/a995815284652ca5d6e013c547b617fa52039ddc))
348
- * **layers:** add heatmap layer ([e04b3b2](https://github.com/antvis/L7/commit/e04b3b268b9fdc4bea150d2db1fdaae227f51fc8))
349
- * **multi-pass:** support TAA(Temporal Anti-Aliasing) ([2cf0824](https://github.com/antvis/L7/commit/2cf082439ad04eb84b96b2922e45082476452aec))
350
- * **picking:** support PixelPickingPass and highlight the picked feature ([ff0ffa0](https://github.com/antvis/L7/commit/ff0ffa057e2f533dc6ac92f40d3892f9dd57fafb))
package/LICENSE.md DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2017 Alipay.inc
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
package/es/index.d.ts DELETED
@@ -1,5 +0,0 @@
1
- /**
2
- *
3
- */
4
- import ReglRendererService from './regl';
5
- export { ReglRendererService };
package/es/index.js DELETED
@@ -1,3 +0,0 @@
1
- import ReglRendererService from './regl';
2
- export { ReglRendererService };
3
- //# sourceMappingURL=index.js.map
package/es/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":["ReglRendererService"],"mappings":"AAGA,OAAOA,mBAAP,MAAgC,QAAhC;AAEA,SAASA,mBAAT","sourcesContent":["/**\n *\n */\nimport ReglRendererService from './regl';\n\nexport { ReglRendererService };\n"],"file":"index.js"}
@@ -1,16 +0,0 @@
1
- import { IAttribute, IAttributeInitializationOptions } from '@antv/l7-core';
2
- import regl from 'l7regl';
3
- /**
4
- * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#attributes
5
- */
6
- export default class ReglAttribute implements IAttribute {
7
- private attribute;
8
- private buffer;
9
- constructor(gl: regl.Regl, options: IAttributeInitializationOptions);
10
- get(): regl.Attribute;
11
- updateBuffer(options: {
12
- data: number[] | number[][] | Uint8Array | Uint16Array | Uint32Array;
13
- offset: number;
14
- }): void;
15
- destroy(): void;
16
- }
@@ -1,54 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
-
5
- var ReglAttribute = function () {
6
- function ReglAttribute(gl, options) {
7
- _classCallCheck(this, ReglAttribute);
8
-
9
- _defineProperty(this, "attribute", void 0);
10
-
11
- _defineProperty(this, "buffer", void 0);
12
-
13
- var buffer = options.buffer,
14
- offset = options.offset,
15
- stride = options.stride,
16
- normalized = options.normalized,
17
- size = options.size,
18
- divisor = options.divisor;
19
- this.buffer = buffer;
20
- this.attribute = {
21
- buffer: buffer.get(),
22
- offset: offset || 0,
23
- stride: stride || 0,
24
- normalized: normalized || false,
25
- divisor: divisor || 0
26
- };
27
-
28
- if (size) {
29
- this.attribute.size = size;
30
- }
31
- }
32
-
33
- _createClass(ReglAttribute, [{
34
- key: "get",
35
- value: function get() {
36
- return this.attribute;
37
- }
38
- }, {
39
- key: "updateBuffer",
40
- value: function updateBuffer(options) {
41
- this.buffer.subData(options);
42
- }
43
- }, {
44
- key: "destroy",
45
- value: function destroy() {
46
- this.buffer.destroy();
47
- }
48
- }]);
49
-
50
- return ReglAttribute;
51
- }();
52
-
53
- export { ReglAttribute as default };
54
- //# sourceMappingURL=ReglAttribute.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/regl/ReglAttribute.ts"],"names":["ReglAttribute","gl","options","buffer","offset","stride","normalized","size","divisor","attribute","get","subData","destroy"],"mappings":";;;;IAWqBA,a;AAInB,yBAAYC,EAAZ,EAA2BC,OAA3B,EAAqE;AAAA;;AAAA;;AAAA;;AACnE,QAAQC,MAAR,GAA8DD,OAA9D,CAAQC,MAAR;AAAA,QAAgBC,MAAhB,GAA8DF,OAA9D,CAAgBE,MAAhB;AAAA,QAAwBC,MAAxB,GAA8DH,OAA9D,CAAwBG,MAAxB;AAAA,QAAgCC,UAAhC,GAA8DJ,OAA9D,CAAgCI,UAAhC;AAAA,QAA4CC,IAA5C,GAA8DL,OAA9D,CAA4CK,IAA5C;AAAA,QAAkDC,OAAlD,GAA8DN,OAA9D,CAAkDM,OAAlD;AACA,SAAKL,MAAL,GAAcA,MAAd;AACA,SAAKM,SAAL,GAAiB;AACfN,MAAAA,MAAM,EAAGA,MAAD,CAAuBO,GAAvB,EADO;AAEfN,MAAAA,MAAM,EAAEA,MAAM,IAAI,CAFH;AAGfC,MAAAA,MAAM,EAAEA,MAAM,IAAI,CAHH;AAIfC,MAAAA,UAAU,EAAEA,UAAU,IAAI,KAJX;AAKfE,MAAAA,OAAO,EAAEA,OAAO,IAAI;AALL,KAAjB;;AAQA,QAAID,IAAJ,EAAU;AACR,WAAKE,SAAL,CAAeF,IAAf,GAAsBA,IAAtB;AACD;AACF;;;;WAED,eAAa;AACX,aAAO,KAAKE,SAAZ;AACD;;;WAED,sBAAoBP,OAApB,EAKG;AACD,WAAKC,MAAL,CAAYQ,OAAZ,CAAoBT,OAApB;AACD;;;WAED,mBAAiB;AACf,WAAKC,MAAL,CAAYS,OAAZ;AACD;;;;;;SAnCkBZ,a","sourcesContent":["import {\n IAttribute,\n IAttributeInitializationOptions,\n IBuffer,\n} from '@antv/l7-core';\nimport regl from 'l7regl';\nimport ReglBuffer from './ReglBuffer';\n\n/**\n * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#attributes\n */\nexport default class ReglAttribute implements IAttribute {\n private attribute: regl.Attribute;\n private buffer: IBuffer;\n\n constructor(gl: regl.Regl, options: IAttributeInitializationOptions) {\n const { buffer, offset, stride, normalized, size, divisor } = options;\n this.buffer = buffer;\n this.attribute = {\n buffer: (buffer as ReglBuffer).get(),\n offset: offset || 0,\n stride: stride || 0,\n normalized: normalized || false,\n divisor: divisor || 0,\n };\n\n if (size) {\n this.attribute.size = size;\n }\n }\n\n public get() {\n return this.attribute;\n }\n\n public updateBuffer(options: {\n // 用于替换的数据\n data: number[] | number[][] | Uint8Array | Uint16Array | Uint32Array;\n // 原 Buffer 替换位置,单位为 byte\n offset: number;\n }) {\n this.buffer.subData(options);\n }\n\n public destroy() {\n this.buffer.destroy();\n }\n}\n"],"file":"ReglAttribute.js"}
@@ -1,16 +0,0 @@
1
- import { IBuffer, IBufferInitializationOptions } from '@antv/l7-core';
2
- import regl from 'l7regl';
3
- /**
4
- * adaptor for regl.Buffer
5
- * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#buffers
6
- */
7
- export default class ReglBuffer implements IBuffer {
8
- private buffer;
9
- constructor(reGl: regl.Regl, options: IBufferInitializationOptions);
10
- get(): regl.Buffer;
11
- destroy(): void;
12
- subData({ data, offset, }: {
13
- data: number[] | number[][] | Uint8Array | Uint16Array | Uint32Array;
14
- offset: number;
15
- }): void;
16
- }
@@ -1,46 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
- import { gl } from '@antv/l7-core';
5
- import { dataTypeMap, usageMap } from './constants';
6
-
7
- var ReglBuffer = function () {
8
- function ReglBuffer(reGl, options) {
9
- _classCallCheck(this, ReglBuffer);
10
-
11
- _defineProperty(this, "buffer", void 0);
12
-
13
- var data = options.data,
14
- usage = options.usage,
15
- type = options.type;
16
- this.buffer = reGl.buffer({
17
- data: data,
18
- usage: usageMap[usage || gl.STATIC_DRAW],
19
- type: dataTypeMap[type || gl.UNSIGNED_BYTE]
20
- });
21
- }
22
-
23
- _createClass(ReglBuffer, [{
24
- key: "get",
25
- value: function get() {
26
- return this.buffer;
27
- }
28
- }, {
29
- key: "destroy",
30
- value: function destroy() {
31
- this.buffer.destroy();
32
- }
33
- }, {
34
- key: "subData",
35
- value: function subData(_ref) {
36
- var data = _ref.data,
37
- offset = _ref.offset;
38
- this.buffer.subdata(data, offset);
39
- }
40
- }]);
41
-
42
- return ReglBuffer;
43
- }();
44
-
45
- export { ReglBuffer as default };
46
- //# sourceMappingURL=ReglBuffer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/regl/ReglBuffer.ts"],"names":["gl","dataTypeMap","usageMap","ReglBuffer","reGl","options","data","usage","type","buffer","STATIC_DRAW","UNSIGNED_BYTE","destroy","offset","subdata"],"mappings":";;;AAAA,SAASA,EAAT,QAA0D,eAA1D;AAEA,SAASC,WAAT,EAAsBC,QAAtB,QAAsC,aAAtC;;IAMqBC,U;AAGnB,sBAAYC,IAAZ,EAA6BC,OAA7B,EAAoE;AAAA;;AAAA;;AAClE,QAAQC,IAAR,GAA8BD,OAA9B,CAAQC,IAAR;AAAA,QAAcC,KAAd,GAA8BF,OAA9B,CAAcE,KAAd;AAAA,QAAqBC,IAArB,GAA8BH,OAA9B,CAAqBG,IAArB;AACA,SAAKC,MAAL,GAAcL,IAAI,CAACK,MAAL,CAAY;AACxBH,MAAAA,IAAI,EAAJA,IADwB;AAExBC,MAAAA,KAAK,EAAEL,QAAQ,CAACK,KAAK,IAAIP,EAAE,CAACU,WAAb,CAFS;AAGxBF,MAAAA,IAAI,EAAEP,WAAW,CAACO,IAAI,IAAIR,EAAE,CAACW,aAAZ;AAHO,KAAZ,CAAd;AAMD;;;;WAED,eAAa;AACX,aAAO,KAAKF,MAAZ;AACD;;;WAED,mBAAiB;AACf,WAAKA,MAAL,CAAYG,OAAZ;AACD;;;WAED,uBAMG;AAAA,UALDN,IAKC,QALDA,IAKC;AAAA,UAJDO,MAIC,QAJDA,MAIC;AACD,WAAKJ,MAAL,CAAYK,OAAZ,CAAoBR,IAApB,EAA0BO,MAA1B;AACD;;;;;;SA7BkBV,U","sourcesContent":["import { gl, IBuffer, IBufferInitializationOptions } from '@antv/l7-core';\nimport regl from 'l7regl';\nimport { dataTypeMap, usageMap } from './constants';\n\n/**\n * adaptor for regl.Buffer\n * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#buffers\n */\nexport default class ReglBuffer implements IBuffer {\n private buffer: regl.Buffer;\n\n constructor(reGl: regl.Regl, options: IBufferInitializationOptions) {\n const { data, usage, type } = options;\n this.buffer = reGl.buffer({\n data,\n usage: usageMap[usage || gl.STATIC_DRAW],\n type: dataTypeMap[type || gl.UNSIGNED_BYTE],\n // length: 0,\n });\n }\n\n public get() {\n return this.buffer;\n }\n\n public destroy() {\n this.buffer.destroy();\n }\n\n public subData({\n data,\n offset,\n }: {\n data: number[] | number[][] | Uint8Array | Uint16Array | Uint32Array;\n offset: number;\n }) {\n this.buffer.subdata(data, offset);\n }\n}\n"],"file":"ReglBuffer.js"}