improvement: renderservice add setdirty 方法

This commit is contained in:
thinkinggis 2020-04-22 21:16:53 +08:00
parent 42bfc33d77
commit 7ead19302d
8 changed files with 40 additions and 9 deletions

View File

@ -2,11 +2,15 @@
title: 发布日志 title: 发布日志
order: 10 order: 10
--- ---
## 2020.04.20 2.2 正式版本 ## 2020.04.20 2.2 正式版本
###✨ Features ###✨ Features
#### [L7-Draw 地图绘制组件发布](../draw/start) #### [L7-Draw 地图绘制组件发布](../draw/start)
支持基础图形绘制、平移、修改、删除 支持基础图形绘制、平移、修改、删除
- 绘制 UI 组件支持 - 绘制 UI 组件支持
- 绘制圆形 - 绘制圆形
- 绘制矩形 - 绘制矩形
@ -15,18 +19,18 @@ order: 10
- 绘制面 - 绘制面
### 🍏 Improvements ### 🍏 Improvements
- 要素拾取支持添加 buffer - 要素拾取支持添加 buffer
- 图层拾取支持冒泡机制,默认拾取最上层 - 图层拾取支持冒泡机制,默认拾取最上层
### 🐞 Bug Fixes ### 🐞 Bug Fixes
- pointLayer 聚合支持多种数据格式化 - pointLayer 聚合支持多种数据格式化
- 修复热力图移动端不能正常渲染 - 修复热力图移动端不能正常渲染
- 修复 3D 热力图高德地图正使用 - 修复 3D 热力图高德地图正使用
- L7 版本锁定 - L7 版本锁定
- 修复点图层描边模糊问题 - 修复点图层描边模糊问题
## 2020.03.12 2.1 正式版 ## 2020.03.12 2.1 正式版
###✨ Features ###✨ Features

View File

@ -62,5 +62,7 @@ export interface IRendererService {
readPixels(options: IReadPixelsOptions): Uint8Array; readPixels(options: IReadPixelsOptions): Uint8Array;
setBaseState(): void; setBaseState(): void;
setCustomLayerDefaults(): void; setCustomLayerDefaults(): void;
setDirty(flag: boolean): void;
getDirty(): boolean;
destroy(): void; destroy(): void;
} }

View File

@ -1,2 +1,2 @@
const version = '2.1.15'; const version = '2.1.20';
export { version }; export { version };

View File

@ -20,7 +20,9 @@ export default class ImageModel extends BaseModel {
public getUninforms(): IModelUniform { public getUninforms(): IModelUniform {
const { opacity } = this.layer.getLayerConfig() as IImageLayerStyleOptions; const { opacity } = this.layer.getLayerConfig() as IImageLayerStyleOptions;
if (this.rendererService.getDirty()) {
this.texture.update(); this.texture.update();
}
return { return {
u_opacity: opacity || 1.0, u_opacity: opacity || 1.0,
u_texture: this.texture, u_texture: this.texture,

View File

@ -38,6 +38,7 @@ export default class ReglRendererService implements IRendererService {
private $container: HTMLDivElement | null; private $container: HTMLDivElement | null;
private width: number; private width: number;
private height: number; private height: number;
private isDirty: boolean;
public async init( public async init(
$container: HTMLDivElement, $container: HTMLDivElement,
@ -211,6 +212,14 @@ export default class ReglRendererService implements IRendererService {
gl.disable(gl.CULL_FACE); gl.disable(gl.CULL_FACE);
} }
public setDirty(flag: boolean): void {
this.isDirty = flag;
}
public getDirty(): boolean {
return this.isDirty;
}
public destroy = () => { public destroy = () => {
// @see https://github.com/regl-project/regl/blob/gh-pages/API.md#clean-up // @see https://github.com/regl-project/regl/blob/gh-pages/API.md#clean-up
this.gl.destroy(); this.gl.destroy();

View File

@ -39,8 +39,7 @@
}, },
"homepage": "https://github.com/antvis/L7#readme", "homepage": "https://github.com/antvis/L7#readme",
"dependencies": { "dependencies": {
"@antv/l7": "2.2.0",
"@antv/l7": "2.1.15",
"@babel/runtime": "^7.7.7", "@babel/runtime": "^7.7.7",
"rollup": "^2.3.3", "rollup": "^2.3.3",
"rollup-plugin-less": "^1.1.2" "rollup-plugin-less": "^1.1.2"

View File

@ -82,6 +82,7 @@ export default class ThreeJSLayer
mixer.update(this.getTime()); mixer.update(this.getTime());
}); });
this.rendererService.setBaseState(); this.rendererService.setBaseState();
this.rendererService.setDirty(true);
return this; return this;
} }
@ -99,6 +100,7 @@ export default class ThreeJSLayer
mixer.update(this.getTime()); mixer.update(this.getTime());
}); });
this.rendererService.setBaseState(); this.rendererService.setBaseState();
this.rendererService.setDirty(true);
return this; return this;
} }

View File

@ -202,6 +202,19 @@
resolved "https://registry.npmjs.org/@antv/gl-matrix/-/gl-matrix-2.7.1.tgz#acb8e37f7ab3df01345aba4372d7942be42eba14" resolved "https://registry.npmjs.org/@antv/gl-matrix/-/gl-matrix-2.7.1.tgz#acb8e37f7ab3df01345aba4372d7942be42eba14"
integrity sha512-oOWcVNlpELIKi9x+Mm1Vwbz8pXfkbJKykoCIOJ/dNK79hSIANbpXJ5d3Rra9/wZqK6MC961B7sybFhPlLraT3Q== integrity sha512-oOWcVNlpELIKi9x+Mm1Vwbz8pXfkbJKykoCIOJ/dNK79hSIANbpXJ5d3Rra9/wZqK6MC961B7sybFhPlLraT3Q==
"@antv/l7@2.1.15":
version "2.1.15"
resolved "https://registry.npmjs.org/@antv/l7/-/l7-2.1.15.tgz#27121b8f22838b5ad17114a1b2895389b6b0a800"
integrity sha512-goR3M1e2YXXEo5jp/QYd1VF9rKoAy/DlKrJ5KLE/jhzuqgw9Kp0iHSOaGE+M7tFIyL8hCoG8JXHmAK1tVyeaIw==
dependencies:
"@antv/l7-component" "^2.1.15"
"@antv/l7-core" "^2.1.15"
"@antv/l7-layers" "^2.1.15"
"@antv/l7-maps" "^2.1.15"
"@antv/l7-scene" "^2.1.15"
"@antv/l7-utils" "^2.1.15"
"@babel/runtime" "^7.7.7"
"@antv/scale@~0.1.1": "@antv/scale@~0.1.1":
version "0.1.5" version "0.1.5"
resolved "https://registry.npmjs.org/@antv/scale/-/scale-0.1.5.tgz#243266e8b9047cf64b2fdfc40f9834cf0846496e" resolved "https://registry.npmjs.org/@antv/scale/-/scale-0.1.5.tgz#243266e8b9047cf64b2fdfc40f9834cf0846496e"