Skip to content

Commit 7f94890

Browse files
committed
Website updates
1 parent 1e07485 commit 7f94890

7 files changed

Lines changed: 32 additions & 23 deletions

File tree

dist/en/main/examples/common.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/examples/common.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/dist/ol.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/dist/ol.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/render/webgl/VectorStyleRenderer.d.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ export type WebGLBuffers = {
5353
/**
5454
* Array containing indices and vertices buffers for polygons
5555
*/
56-
polygonBuffers: WebGLArrayBufferSet;
56+
polygonBuffers: WebGLArrayBufferSet | null;
5757
/**
5858
* Array containing indices and vertices buffers for line strings
5959
*/
60-
lineStringBuffers: WebGLArrayBufferSet;
60+
lineStringBuffers: WebGLArrayBufferSet | null;
6161
/**
6262
* Array containing indices and vertices buffers for points
6363
*/
64-
pointBuffers: WebGLArrayBufferSet;
64+
pointBuffers: WebGLArrayBufferSet | null;
6565
/**
6666
* Inverse of the transform applied when generating buffers
6767
*/
@@ -155,9 +155,9 @@ export type RenderPass = {
155155
*/
156156
/**
157157
* @typedef {Object} WebGLBuffers
158-
* @property {WebGLArrayBufferSet} polygonBuffers Array containing indices and vertices buffers for polygons
159-
* @property {WebGLArrayBufferSet} lineStringBuffers Array containing indices and vertices buffers for line strings
160-
* @property {WebGLArrayBufferSet} pointBuffers Array containing indices and vertices buffers for points
158+
* @property {WebGLArrayBufferSet|null} polygonBuffers Array containing indices and vertices buffers for polygons
159+
* @property {WebGLArrayBufferSet|null} lineStringBuffers Array containing indices and vertices buffers for line strings
160+
* @property {WebGLArrayBufferSet|null} pointBuffers Array containing indices and vertices buffers for points
161161
* @property {import("../../transform.js").Transform} invertVerticesTransform Inverse of the transform applied when generating buffers
162162
*/
163163
/**
@@ -252,9 +252,9 @@ declare class VectorStyleRenderer {
252252
/**
253253
* @param {import('./MixedGeometryBatch.js').default} geometryBatch Geometry batch
254254
* @param {import("../../transform.js").Transform} transform Transform to apply to coordinates
255-
* @return {Promise<WebGLBuffers|null>} A promise resolving to WebGL buffers; returns null if buffers are empty
255+
* @return {Promise<WebGLBuffers>} A promise resolving to WebGL buffers; buffer sets are set to `null` if nothing to render
256256
*/
257-
generateBuffers(geometryBatch: import("./MixedGeometryBatch.js").default, transform: import("../../transform.js").Transform): Promise<WebGLBuffers | null>;
257+
generateBuffers(geometryBatch: import("./MixedGeometryBatch.js").default, transform: import("../../transform.js").Transform): Promise<WebGLBuffers>;
258258
/**
259259
* @param {import('./MixedGeometryBatch.js').default} geometryBatch Geometry batch
260260
* @param {import("../../transform.js").Transform} transform Transform to apply to coordinates

dist/en/main/ol/render/webgl/VectorStyleRenderer.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/render/webgl/VectorStyleRenderer.js

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ export const Attributes = {
6868

6969
/**
7070
* @typedef {Object} WebGLBuffers
71-
* @property {WebGLArrayBufferSet} polygonBuffers Array containing indices and vertices buffers for polygons
72-
* @property {WebGLArrayBufferSet} lineStringBuffers Array containing indices and vertices buffers for line strings
73-
* @property {WebGLArrayBufferSet} pointBuffers Array containing indices and vertices buffers for points
71+
* @property {WebGLArrayBufferSet|null} polygonBuffers Array containing indices and vertices buffers for polygons
72+
* @property {WebGLArrayBufferSet|null} lineStringBuffers Array containing indices and vertices buffers for line strings
73+
* @property {WebGLArrayBufferSet|null} pointBuffers Array containing indices and vertices buffers for points
7474
* @property {import("../../transform.js").Transform} invertVerticesTransform Inverse of the transform applied when generating buffers
7575
*/
7676

@@ -325,11 +325,22 @@ class VectorStyleRenderer {
325325
/**
326326
* @param {import('./MixedGeometryBatch.js').default} geometryBatch Geometry batch
327327
* @param {import("../../transform.js").Transform} transform Transform to apply to coordinates
328-
* @return {Promise<WebGLBuffers|null>} A promise resolving to WebGL buffers; returns null if buffers are empty
328+
* @return {Promise<WebGLBuffers>} A promise resolving to WebGL buffers; buffer sets are set to `null` if nothing to render
329329
*/
330330
async generateBuffers(geometryBatch, transform) {
331+
// also return the inverse of the transform that was applied when generating buffers
332+
const invertVerticesTransform = makeInverseTransform(
333+
createTransform(),
334+
transform,
335+
);
336+
331337
if (geometryBatch.isEmpty()) {
332-
return null;
338+
return {
339+
polygonBuffers: null,
340+
lineStringBuffers: null,
341+
pointBuffers: null,
342+
invertVerticesTransform: invertVerticesTransform,
343+
};
333344
}
334345
const renderInstructions = this.generateRenderInstructions_(
335346
geometryBatch,
@@ -354,11 +365,6 @@ class VectorStyleRenderer {
354365
),
355366
],
356367
);
357-
// also return the inverse of the transform that was applied when generating buffers
358-
const invertVerticesTransform = makeInverseTransform(
359-
createTransform(),
360-
transform,
361-
);
362368
return {
363369
polygonBuffers: polygonBuffers,
364370
lineStringBuffers: lineStringBuffers,
@@ -505,6 +511,7 @@ class VectorStyleRenderer {
505511
render(buffers, frameState, preRenderCallback) {
506512
for (const renderPass of this.renderPasses_) {
507513
renderPass.fillRenderPass &&
514+
buffers.polygonBuffers &&
508515
this.renderInternal_(
509516
buffers.polygonBuffers[0],
510517
buffers.polygonBuffers[1],
@@ -514,6 +521,7 @@ class VectorStyleRenderer {
514521
preRenderCallback,
515522
);
516523
renderPass.strokeRenderPass &&
524+
buffers.lineStringBuffers &&
517525
this.renderInternal_(
518526
buffers.lineStringBuffers[0],
519527
buffers.lineStringBuffers[1],
@@ -523,6 +531,7 @@ class VectorStyleRenderer {
523531
preRenderCallback,
524532
);
525533
renderPass.symbolRenderPass &&
534+
buffers.pointBuffers &&
526535
this.renderInternal_(
527536
buffers.pointBuffers[0],
528537
buffers.pointBuffers[1],

0 commit comments

Comments
 (0)