Webgl / minor function renaming

This commit is contained in:
Olivier Guyot
2019-05-15 11:29:54 +02:00
parent c705775d75
commit e11e3c5f6e
3 changed files with 13 additions and 13 deletions

View File

@@ -61,7 +61,7 @@ class WebGLLayerRenderer extends LayerRenderer {
/**
* Pushes vertices and indices in the given buffers using the geometry coordinates and the following properties
* Pushes vertices and indices to the given buffers using the geometry coordinates and the following properties
* from the feature:
* - `color`
* - `opacity`
@@ -79,13 +79,13 @@ class WebGLLayerRenderer extends LayerRenderer {
* feature and pushed in the buffer in the given order. Note: attributes can only be numerical! Any other type or
* NaN will result in `0` being pushed in the buffer.
*/
export function pushFeatureInBuffer(vertexBuffer, indexBuffer, geojsonFeature, opt_attributes) {
export function pushFeatureToBuffer(vertexBuffer, indexBuffer, geojsonFeature, opt_attributes) {
if (!geojsonFeature.geometry) {
return;
}
switch (geojsonFeature.geometry.type) {
case 'Point':
pushPointGeomInBuffer_(vertexBuffer, indexBuffer, geojsonFeature, opt_attributes);
pushPointFeatureToBuffer_(vertexBuffer, indexBuffer, geojsonFeature, opt_attributes);
return;
default:
return;
@@ -102,7 +102,7 @@ const tmpArray_ = [];
* @param {Array<string>} [opt_attributes] Custom attributes
* @private
*/
function pushPointGeomInBuffer_(vertexBuffer, indexBuffer, geojsonFeature, opt_attributes) {
function pushPointFeatureToBuffer_(vertexBuffer, indexBuffer, geojsonFeature, opt_attributes) {
const stride = 12 + (opt_attributes !== undefined ? opt_attributes.length : 0);
const x = geojsonFeature.geometry.coordinates[0];

View File

@@ -5,7 +5,7 @@ import WebGLArrayBuffer from '../../webgl/Buffer';
import {DYNAMIC_DRAW, ARRAY_BUFFER, ELEMENT_ARRAY_BUFFER, FLOAT} from '../../webgl';
import {DefaultAttrib, DefaultUniform} from '../../webgl/Helper';
import GeometryType from '../../geom/GeometryType';
import WebGLLayerRenderer, {getBlankTexture, pushFeatureInBuffer} from './Layer';
import WebGLLayerRenderer, {getBlankTexture, pushFeatureToBuffer} from './Layer';
import GeoJSON from '../../format/GeoJSON';
import {getUid} from '../../util';
import ViewHint from '../../ViewHint';
@@ -391,7 +391,7 @@ class WebGLPointsLayerRenderer extends WebGLLayerRenderer {
geojsonFeature.properties.opacity = this.opacityCallback_(feature);
geojsonFeature.properties.rotateWithView = this.rotateWithViewCallback_(feature) ? 1 : 0;
pushFeatureInBuffer(this.verticesBuffer_, this.indicesBuffer_, geojsonFeature);
pushFeatureToBuffer(this.verticesBuffer_, this.indicesBuffer_, geojsonFeature);
}
this.helper_.flushBufferData(ARRAY_BUFFER, this.verticesBuffer_);