This commit is contained in:
Olivier Guyot
2019-05-14 19:14:12 +02:00
parent 9ca75e9d43
commit c705775d75
5 changed files with 35 additions and 35 deletions
+8 -6
View File
@@ -84,8 +84,10 @@ export function pushFeatureInBuffer(vertexBuffer, indexBuffer, geojsonFeature, o
return; return;
} }
switch (geojsonFeature.geometry.type) { switch (geojsonFeature.geometry.type) {
case "Point": case 'Point':
pushPointGeomInBuffer_(vertexBuffer, indexBuffer, geojsonFeature, opt_attributes) pushPointGeomInBuffer_(vertexBuffer, indexBuffer, geojsonFeature, opt_attributes);
return;
default:
return; return;
} }
} }
@@ -94,10 +96,10 @@ const tmpArray_ = [];
/** /**
* Pushes a quad (two triangles) based on a point geometry * Pushes a quad (two triangles) based on a point geometry
* @param vertexBuffer * @param {import("../../webgl/Buffer").default} vertexBuffer WebGL buffer
* @param indexBuffer * @param {import("../../webgl/Buffer").default} indexBuffer WebGL buffer
* @param geojsonFeature * @param {import("../../format/GeoJSON").GeoJSONFeature} geojsonFeature Feature
* @param opt_attributes * @param {Array<string>} [opt_attributes] Custom attributes
* @private * @private
*/ */
function pushPointGeomInBuffer_(vertexBuffer, indexBuffer, geojsonFeature, opt_attributes) { function pushPointGeomInBuffer_(vertexBuffer, indexBuffer, geojsonFeature, opt_attributes) {
+1 -2
View File
@@ -12,7 +12,6 @@ import ViewHint from '../../ViewHint';
import {createEmpty, equals} from '../../extent'; import {createEmpty, equals} from '../../extent';
import { import {
create as createTransform, create as createTransform,
reset as resetTransform,
makeInverse as makeInverseTransform, makeInverse as makeInverseTransform,
multiply as multiplyTransform, multiply as multiplyTransform,
apply as applyTransform apply as applyTransform
@@ -350,7 +349,7 @@ class WebGLPointsLayerRenderer extends WebGLLayerRenderer {
/** /**
* Rebuild internal webgl buffers based on current view extent; costly, should not be called too much * Rebuild internal webgl buffers based on current view extent; costly, should not be called too much
* @param {import("../../PluggableMap.js").FrameState} frameState * @param {import("../../PluggableMap").FrameState} frameState Frame state.
* @private * @private
*/ */
rebuildBuffers_(frameState) { rebuildBuffers_(frameState) {
+11 -11
View File
@@ -38,8 +38,8 @@ describe('ol.renderer.webgl.Layer', function() {
it('does nothing if the feature has no geometry', function() { it('does nothing if the feature has no geometry', function() {
const feature = { const feature = {
type: "Feature", type: 'Feature',
id: "AFG", id: 'AFG',
properties: { properties: {
color: [0.5, 1, 0.2, 0.7], color: [0.5, 1, 0.2, 0.7],
size: 3 size: 3
@@ -53,14 +53,14 @@ describe('ol.renderer.webgl.Layer', function() {
it('adds two triangles with the correct attributes for a point geometry', function() { it('adds two triangles with the correct attributes for a point geometry', function() {
const feature = { const feature = {
type: "Feature", type: 'Feature',
id: "AFG", id: 'AFG',
properties: { properties: {
color: [0.5, 1, 0.2, 0.7], color: [0.5, 1, 0.2, 0.7],
size: 3 size: 3
}, },
geometry: { geometry: {
type: "Point", type: 'Point',
coordinates: [-75, 47] coordinates: [-75, 47]
} }
}; };
@@ -72,14 +72,14 @@ describe('ol.renderer.webgl.Layer', function() {
it('correctly sets indices & coordinates for several features', function() { it('correctly sets indices & coordinates for several features', function() {
const feature = { const feature = {
type: "Feature", type: 'Feature',
id: "AFG", id: 'AFG',
properties: { properties: {
color: [0.5, 1, 0.2, 0.7], color: [0.5, 1, 0.2, 0.7],
size: 3 size: 3
}, },
geometry: { geometry: {
type: "Point", type: 'Point',
coordinates: [-75, 47] coordinates: [-75, 47]
} }
}; };
@@ -110,8 +110,8 @@ describe('ol.renderer.webgl.Layer', function() {
it('correctly adds custom attributes', function() { it('correctly adds custom attributes', function() {
const feature = { const feature = {
type: "Feature", type: 'Feature',
id: "AFG", id: 'AFG',
properties: { properties: {
color: [0.5, 1, 0.2, 0.7], color: [0.5, 1, 0.2, 0.7],
custom: 4, custom: 4,
@@ -120,7 +120,7 @@ describe('ol.renderer.webgl.Layer', function() {
customString2: 'abc' customString2: 'abc'
}, },
geometry: { geometry: {
type: "Point", type: 'Point',
coordinates: [-75, 47] coordinates: [-75, 47]
} }
}; };
+1 -2
View File
@@ -1,7 +1,6 @@
import WebGLHelper from '../../../../src/ol/webgl/Helper'; import WebGLHelper from '../../../../src/ol/webgl/Helper';
import { import {
create as createTransform, create as createTransform,
multiply,
rotate as rotateTransform, rotate as rotateTransform,
scale as scaleTransform, translate as translateTransform scale as scaleTransform, translate as translateTransform
} from '../../../../src/ol/transform'; } from '../../../../src/ol/transform';
@@ -203,7 +202,7 @@ describe('ol.webgl.WebGLHelper', function() {
resolution: 2, resolution: 2,
center: [10, 20] center: [10, 20]
} }
} };
}); });
it('gives out the correct transform', function() { it('gives out the correct transform', function() {