@antv/l7-core
Advanced tools
Comparing version 2.0.10 to 2.0.11
@@ -14,2 +14,3 @@ import { Container } from 'inversify'; | ||
addControl(ctr: IControl, sceneContainer: Container): void; | ||
getControlByName(name: string | number): IControl | undefined; | ||
removeControl(ctr: IControl): this; | ||
@@ -16,0 +17,0 @@ addControls(): void; |
@@ -43,2 +43,9 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck"; | ||
}, { | ||
key: "getControlByName", | ||
value: function getControlByName(name) { | ||
return this.controls.find(function (ctr) { | ||
return ctr.controlOption.name === name; | ||
}); | ||
} | ||
}, { | ||
key: "removeControl", | ||
@@ -45,0 +52,0 @@ value: function removeControl(ctr) { |
@@ -8,4 +8,7 @@ import { Container } from 'inversify'; | ||
} | ||
export declare type PositionName = 'topright' | 'topleft' | 'bottomright' | 'bottomleft'; | ||
export interface IControlOption { | ||
position: PositionType; | ||
name: string; | ||
position: PositionName; | ||
[key: string]: any; | ||
} | ||
@@ -19,2 +22,3 @@ export interface IControlServiceCfg { | ||
export interface IControl { | ||
controlOption: IControlOption; | ||
setPosition(pos: PositionType): void; | ||
@@ -34,4 +38,5 @@ addTo(sceneContainer: Container): void; | ||
addControl(ctr: IControl, sceneContainer: Container): void; | ||
getControlByName(name: string | number): IControl | undefined; | ||
removeControl(ctr: IControl): void; | ||
destroy(): void; | ||
} |
@@ -31,2 +31,6 @@ import _initializerDefineProperty from "@babel/runtime/helpers/initializerDefineProperty"; | ||
value: function add(layer) { | ||
if (this.sceneInited) { | ||
layer.init(); | ||
} | ||
this.layers.push(layer); | ||
@@ -84,2 +88,4 @@ } | ||
this.layers.filter(function (layer) { | ||
return layer.inited; | ||
}).filter(function (layer) { | ||
return layer.isVisible(); | ||
@@ -86,0 +92,0 @@ }).forEach(function (layer) { |
@@ -46,2 +46,3 @@ import { ILayer } from '../layer/ILayerService'; | ||
setLayer(layer: ILayer): void; | ||
destroy(): void; | ||
} |
@@ -35,2 +35,3 @@ import { ILayer } from '../../layer/ILayerService'; | ||
insert<T>(pass: IPass<T>, config: Partial<T>, index: number): void; | ||
destroy(): void; | ||
} |
@@ -150,2 +150,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator"; | ||
} | ||
}, { | ||
key: "destroy", | ||
value: function destroy() { | ||
this.passes.length = 0; | ||
} | ||
}]); | ||
@@ -152,0 +157,0 @@ |
@@ -19,2 +19,4 @@ import { ILayer } from '../../layer/ILayerService'; | ||
private layer; | ||
private width; | ||
private height; | ||
/** | ||
@@ -21,0 +23,0 @@ * 简单的 throttle,防止连续触发 hover 时导致频繁渲染到 picking framebuffer |
@@ -47,2 +47,4 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray"; | ||
_this.layer = void 0; | ||
_this.width = 0; | ||
_this.height = 0; | ||
_this.alreadyInRendering = false; | ||
@@ -202,6 +204,12 @@ | ||
this.alreadyInRendering = true; | ||
this.pickingFBO.resize({ | ||
width: width, | ||
height: height | ||
}); | ||
if (this.width !== width || this.height !== height) { | ||
this.pickingFBO.resize({ | ||
width: width, | ||
height: height | ||
}); | ||
this.width = width; | ||
this.height = height; | ||
} | ||
useFramebuffer(this.pickingFBO, function () { | ||
@@ -208,0 +216,0 @@ clear({ |
@@ -233,3 +233,3 @@ import _regeneratorRuntime from "@babel/runtime/regenerator"; | ||
if (this.inited) { | ||
_context3.next = 10; | ||
_context3.next = 11; | ||
break; | ||
@@ -243,2 +243,3 @@ } | ||
this.logger.info(' render inited'); | ||
this.layerService.initLayers(); | ||
this.controlService.addControls(); | ||
@@ -248,4 +249,3 @@ this.emit('loaded'); | ||
case 10: | ||
this.layerService.initLayers(); | ||
case 11: | ||
this.layerService.renderLayers(); | ||
@@ -252,0 +252,0 @@ this.logger.debug("scene ".concat(this.id, " render")); |
@@ -55,2 +55,9 @@ "use strict"; | ||
}, { | ||
key: "getControlByName", | ||
value: function getControlByName(name) { | ||
return this.controls.find(function (ctr) { | ||
return ctr.controlOption.name === name; | ||
}); | ||
} | ||
}, { | ||
key: "removeControl", | ||
@@ -57,0 +64,0 @@ value: function removeControl(ctr) { |
@@ -44,2 +44,6 @@ "use strict"; | ||
value: function add(layer) { | ||
if (this.sceneInited) { | ||
layer.init(); | ||
} | ||
this.layers.push(layer); | ||
@@ -97,2 +101,4 @@ } | ||
this.layers.filter(function (layer) { | ||
return layer.inited; | ||
}).filter(function (layer) { | ||
return layer.isVisible(); | ||
@@ -99,0 +105,0 @@ }).forEach(function (layer) { |
@@ -165,2 +165,7 @@ "use strict"; | ||
} | ||
}, { | ||
key: "destroy", | ||
value: function destroy() { | ||
this.passes.length = 0; | ||
} | ||
}]); | ||
@@ -167,0 +172,0 @@ return MultiPassRenderer; |
@@ -72,2 +72,4 @@ "use strict"; | ||
_this.layer = void 0; | ||
_this.width = 0; | ||
_this.height = 0; | ||
_this.alreadyInRendering = false; | ||
@@ -226,6 +228,12 @@ | ||
this.alreadyInRendering = true; | ||
this.pickingFBO.resize({ | ||
width: width, | ||
height: height | ||
}); | ||
if (this.width !== width || this.height !== height) { | ||
this.pickingFBO.resize({ | ||
width: width, | ||
height: height | ||
}); | ||
this.width = width; | ||
this.height = height; | ||
} | ||
useFramebuffer(this.pickingFBO, function () { | ||
@@ -232,0 +240,0 @@ clear({ |
@@ -245,3 +245,3 @@ "use strict"; | ||
if (this.inited) { | ||
_context3.next = 10; | ||
_context3.next = 11; | ||
break; | ||
@@ -255,2 +255,3 @@ } | ||
this.logger.info(' render inited'); | ||
this.layerService.initLayers(); | ||
this.controlService.addControls(); | ||
@@ -260,4 +261,3 @@ this.emit('loaded'); | ||
case 10: | ||
this.layerService.initLayers(); | ||
case 11: | ||
this.layerService.renderLayers(); | ||
@@ -264,0 +264,0 @@ this.logger.debug("scene ".concat(this.id, " render")); |
{ | ||
"name": "@antv/l7-core", | ||
"version": "2.0.10", | ||
"version": "2.0.11", | ||
"description": "", | ||
@@ -25,3 +25,3 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@antv/l7-utils": "^2.0.10", | ||
"@antv/l7-utils": "^2.0.11", | ||
"@babel/runtime": "^7.7.7", | ||
@@ -50,3 +50,3 @@ "@mapbox/tiny-sdf": "^1.1.1", | ||
}, | ||
"gitHead": "1ca88167e1decb83b6ac8b5ccd6756ff13ed7491", | ||
"gitHead": "6579611559625a33bf991dc13f42d79fdc9aba76", | ||
"publishConfig": { | ||
@@ -53,0 +53,0 @@ "access": "public" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1277110
13947
Updated@antv/l7-utils@^2.0.11