Webgl points / fix unit tests

This commit is contained in:
Olivier Guyot
2019-05-18 18:29:10 +02:00
parent 03e70bd10e
commit 698816030e
2 changed files with 27 additions and 12 deletions

View File

@@ -383,7 +383,7 @@ class WebGLPointsLayerRenderer extends WebGLLayerRenderer {
const features = vectorSource.getFeatures();
const totalInstructionsCount = POINT_INSTRUCTIONS_COUNT * features.length;
if (this.renderInstructions_.length !== totalInstructionsCount) {
if (!this.renderInstructions_ || this.renderInstructions_.length !== totalInstructionsCount) {
this.renderInstructions_ = new Float32Array(totalInstructionsCount);
}
@@ -427,6 +427,7 @@ class WebGLPointsLayerRenderer extends WebGLLayerRenderer {
message['projectionTransform'] = projectionTransform;
this.worker_.postMessage(message, [this.renderInstructions_.buffer]);
this.renderInstructions_ = null;
}