Commit Graph
83 Commits
Author SHA1 Message Date
Olivier Guyot 8fb6ed5c6f Add a new webgl example with real time feature filtering 2019-04-02 23:46:13 +02:00
Olivier Guyot c6a859d1ed Webgl / clarify premultiplied alpha handling
By default, alpha premultiplying should be done by the initial rendering
(eg quads) and not the final post processing pass.

The default post processing pass expects premultiplied color values and
will not do this operation itself.
2019-04-02 22:12:47 +02:00
Olivier Guyot b955579a9c Webgl / clarified the buffer binding/flushing logic
The Webgl points layer renderer has also been optimized accordingly,
giving out much better performance.
2019-04-02 21:05:31 +02:00
Olivier Guyot 77a1628610 Tests / remove view extent constraint on zoomify tests 2019-03-25 14:03:40 +01:00
Olivier Guyot c08da3c694 Map / resolve view constraints when resized/view changed
This makes the `resolveConstraints` view method public but not part of the
api.
2019-03-25 13:38:51 +01:00
Olivier Guyot 98994cad61 View / tests now pass without smoothResolutionConstraint: false 2019-03-25 13:21:10 +01:00
Olivier Guyot 91dda5e5ca View / refactor initialization with resolution constraint
This also makes it possible to call `solveConstraints_` with a duration of 0,
which means the target values are modified straight away without triggering
an animation or leaving the current flow.
2019-03-25 13:21:10 +01:00
Olivier Guyot b63c4188e4 View / add tests for parameter initialization with constraints 2019-03-25 13:18:49 +01:00
Olivier Guyot 10423ddbe4 Fix View method name in upgrade notes
See #9349
2019-03-25 13:18:49 +01:00
Olivier Guyot 8983ebdc69 Fix View method name in upgrade notes
See #9349
2019-03-22 13:30:58 +01:00
Olivier Guyot 447266cbe8 Better smoothing of resolution and center constraints
Previously the formula for the resolution constraint allowed going way past
the minimum zoom.
Also adjusted the center constraint to avoid a zigzag effect when going out
of resolution bounds.
2019-03-04 10:14:06 +01:00
Olivier Guyot f67baa0dc0 Interactions / fix zoom level when a zoom interaction ends 2019-02-22 15:04:54 +01:00
Olivier Guyot 75c379beeb View / allow specifying an anchor on interaction end
This also fixes a bug where the animation anchor would be lost when outside
the allowed resolution.
2019-02-22 15:04:54 +01:00
Olivier Guyot 405e206717 View / better names for getValid* and applyParameters_ methods 2019-02-22 15:04:54 +01:00
Olivier Guyot c2af03f152 Update the View documentation & document breaking changes 2019-02-22 15:04:54 +01:00
Olivier Guyot 7835869582 Add an extent restriction on the mapbox layer example
This fixes a bug where the OL map would allow much larger resolution than
mapbox.
2019-02-22 15:01:30 +01:00
Olivier Guyot 78e8f23df5 View / add getValidCenter method to improve interactions
The DragPan, KeyboardPan and DragZoom interactions now make sure to
animate to a valid center/resolution target to avoid
a chained "resolve" animation which looks weird.

The `View.fit` method was also fixed to use this.
2019-02-22 15:01:30 +01:00
Olivier Guyot 433bccd207 Linting and fixes for unit tests 2019-02-22 15:01:30 +01:00
Olivier Guyot ef6d17d817 View / add a 'smoothResolutionConstraint' options
When enabled (true by default), the resolution min/max values will be applied with
a smoothing effect for a better user experience.
2019-02-22 15:01:30 +01:00
Olivier Guyot e023c144bb View / add adjust* methods to manipulate the view more easily
API changes:
* (breaking) the `rotate` method is gone
* the `adjustRotation`, `adjustResolution` and `adjustZoom` methods are now
  available and allow using an anchor.

This means interactions do not have to do the anchor computation themselves
and this also fix anchor computation when constraints must be applied.
2019-02-22 15:01:30 +01:00
Olivier Guyot b5273babb5 View / handle resolutions array with length=1 2019-02-22 15:01:30 +01:00
Olivier Guyot 49662b019c View / add a constrainResolution option
This introduces a breaking change.

This options replaces the various `constrainResolution` options on interactions
and the `fit` method.

Since constraints are now the responsibility of the View, the fact that intermediary
zoom levels are allowed or not is now set in the view options.

By default, the view resolution is unconstrained.
2019-02-22 15:01:30 +01:00
Olivier Guyot a6f65df8c4 View / add a resolveConstraints method to end interactions
This will help making sure that the view will come back to a "rested" state
once the interactions are over.

Interactions no longer need to handle the animation back to a rested state,
they simply call `endInteraction` with the desired duration and direction.
2019-02-22 15:01:30 +01:00
Olivier Guyot 1c5fd62e43 View / refactor how zoom and resolution are computed
This commit aims to simplify the computation of zoom and resolution in the
View class.

Previously zoom levels and resolution computations were mixed in different places,
ie resolution constraints, initial values, etc.

Now the View class only has the `getZoomForResolution` and `getResolutionForZoom`
methods to convert from one system to another.

Other than that, most computations use the resolution system internally.

The `constrainResolution` method also does not exist anymore, and is replaced
by `getValidResolution` and `getValidZoomLevel` public methods.
2019-02-22 15:01:30 +01:00
Olivier Guyot 1f379a06a4 View / add support for viewport extent constraint
This introduces a breaking change:

The `extent` view option now constrains the whole viewport and not just the
view center.
The option `constrainOnlyCenter` was added to keep the previous behaviour.

Constraining the whole viewport and not only the view center means
that the center and resolution constraints must be applied with a knowledge of
the viewport size.
2019-02-22 15:01:30 +01:00
Olivier Guyot e6c4b2ffd1 View / make the constrainResolution function private
Other classes should not need to worry about constraining the resolution
or not, as the View will eventually do this on its own.
2019-02-22 15:01:30 +01:00
Olivier Guyot 3c1e3779e2 View / add a method to compute a valid zoom level
The `getValidZoomLevel` apply the current resolution constraint to return
a value that is guaranteed valid.

This is used for interactions & controls which need a target value to work:
the +/- buttons, the zoom clider, the dragbox zoom and the mouse wheel zoom.
2019-02-22 15:01:30 +01:00
Olivier Guyot 4e1ece16ed View / implemented begin- and endInteraction methods 2019-02-22 15:01:30 +01:00
Olivier Guyot 1cb934dbe3 View / implement intermediate values for center/rot/res
The view now has targetCenter, targetRotation and targetResolution members.

These hold the new values given by set* methods. The actual view parameters are then changed by
calling `applyParameters_`.
2019-02-22 15:01:30 +01:00
Olivier Guyot 831c23d212 Fix heatmap example for IE 2018-12-28 16:24:56 +01:00
Olivier Guyot 33c717e159 Use a cleaner way to create a webgl context 2018-12-28 16:10:38 +01:00
Olivier Guyot 62c7a49943 Webgl points / added a texture option & improved doc 2018-12-28 15:53:07 +01:00
Olivier Guyot 0acfd7ab59 WebGL points / Added a color attribute 2018-12-28 15:53:07 +01:00
Olivier Guyot 27b0cf18e7 Update default shaders in documentation of webgl classes 2018-12-07 09:32:52 +01:00
Olivier Guyot 8e4c66a49e Regenerate new test renders & remove the --ignore-gpu-blacklist flag 2018-12-07 09:09:19 +01:00
Olivier Guyot 2c4a959e55 Generally fixed the webgl heatmap layer
Things done:
- stay closer to the original rendering in canvas
- get rid of the intermediary blur step
- use the new callbacks in the webgl points renderer
- premultiply alpha in the last postprocessing step
2018-12-07 09:02:02 +01:00
Olivier Guyot b532a489d4 Webgl points / fix weird glitches by premultiplying alpha 2018-12-07 09:02:02 +01:00
Olivier Guyot f177a2bcd5 Simple handling of layer opacity in webgl points layer
Now the layer opacity is simply handled by a CSS property on the layer DOM element. As such it does not have to be
taken into account in shaders.
2018-12-07 09:02:02 +01:00
Olivier Guyot a6989af00a Webgl points layer / added callbacks for attributes
Now opacity, rotateWithView and tex coords can be set with callbacks per feature.
2018-12-07 08:57:12 +01:00
Olivier Guyot 2367fbb1ea Webgl / do not enable missing attributes
Some expected attributes might not end up in the compiled shader. In this case, skip calling enableVertexAttrib
2018-12-07 08:57:03 +01:00
Olivier Guyot 662d9122f5 Use --ignore-gpu-blacklist to fix Webgl rendering in CircleCI 2018-11-20 11:52:32 +01:00
Olivier Guyot 0b23e94a2a Fixed internal var name on WebGLPoints renderer. 2018-11-19 13:11:23 +01:00
jahow 6b82cf0b84 Simplified the API of WebGLHelper
Now the shader and program caches are simply arrays of native WebGL created objects.
The WebGLHelper simply takes the sources of the frag and vert shader and produces a program.

This removes 2 classes & reduces the general verbosity of the API.

Also a `getShaderCompilationErrors` was added on `WebGLHelper` to help debug GLSL errors.
2018-11-19 13:11:23 +01:00
jahow 76b1a7f96b Add a rendering test for basic points rendering in webgl. 2018-11-19 09:41:29 +01:00
jahow d0e0c8fc3a Add rendering test for heatmap layer 2018-11-19 09:41:20 +01:00
Olivier Guyot 1ae1b60308 Rename webgl-new to webgl 2018-11-16 14:05:06 +01:00
Olivier Guyot 40d5f4efe7 Added unit tests for the WebGLHelper class 2018-11-16 14:05:06 +01:00
Olivier Guyot 72cf7b13fa removed existing webgl rendering unit tests 2018-11-16 14:05:04 +01:00
Olivier Guyot 66a74ac019 Renamed WebGLBuffer to WebGLArrayBuffer to avoid conflicts
In the future this should be reworked to have a clearer API in general.
2018-11-16 14:02:10 +01:00
Olivier Guyot a84559d1fb Added documentation & fixed linting for WebGL classes 2018-11-16 14:02:10 +01:00
Olivier Guyot cb77e10179 Removed the legacy shader build system 2018-11-16 14:02:10 +01:00
Olivier Guyot 874047a928 The heatmap layer now has a configurable blur 2018-11-16 14:02:10 +01:00
Olivier Guyot 530bcd0c88 Improve handling of uniforms in webgl helper 2018-11-16 14:02:10 +01:00
Olivier Guyot 94524fb431 Webgl Helper now handles uniforms with framestate as input 2018-11-16 14:02:10 +01:00
Olivier Guyot 716256e8f3 Cleaned up the heatmap layer & use dynamic radius 2018-11-16 14:02:10 +01:00
Olivier Guyot fb8bf785dd Use the gradient texture in the heatmap layer 2018-11-16 14:02:10 +01:00
Olivier Guyot 4a275c543a Use post-processes in the heatmap example 2018-11-16 14:02:10 +01:00
Olivier Guyot 0c1424c5bb Added the concept of post process passes for webgl 2018-11-16 14:02:10 +01:00
Olivier Guyot 7fa2189fe9 Remove the bulk of the WebGL legacy code.
Things left to do:
* redo an icon layer example
* redo a clipping layer example
* update docs where WebGL renderers are mentioned
2018-11-16 14:02:08 +01:00
Olivier Guyot d3294730f1 Renamed WebGLContext to Helper for clarity 2018-11-16 14:01:21 +01:00
Olivier Guyot 494b817f47 Use the new webgl renderer in the heatmap layer 2018-11-16 14:01:21 +01:00
Olivier Guyot 51becf1c2e Allow custom post processing & improve blending 2018-11-16 14:01:21 +01:00
Olivier Guyot 298af9ca0f added the concept of frame buffer in webgl context 2018-11-16 14:01:21 +01:00
Olivier Guyot 81807c5910 Added size & position callbacks 2018-11-16 14:01:21 +01:00
Olivier Guyot 3c5eac13c9 Handle alpha & custom shaders in renderer 2018-11-16 14:01:21 +01:00
Olivier Guyot 154a046130 Added texcoord in default shader 2018-11-16 14:01:20 +01:00
Olivier Guyot 583dfb8e9d Actually make the renderer work 2018-11-16 14:01:20 +01:00
Olivier Guyot 1c11dc5311 Improved shader compilation & fixed PointsLayer ones 2018-11-16 14:01:20 +01:00
Olivier Guyot 97b16be572 Added attribute handling 2018-11-16 14:01:20 +01:00
Olivier Guyot fc20dc986c Better handle uniform locations in shaders 2018-11-16 14:01:20 +01:00
Olivier Guyot 66efee9e22 Add vertex shaders to pointslayer 2018-11-16 14:01:20 +01:00
Olivier Guyot 71270efa75 Added a new WebGLPointsRenderer 2018-11-16 14:01:20 +01:00
Olivier Guyot 0a0d6c22f5 Modified the WebGLContext to be used independantly 2018-11-16 14:01:20 +01:00
Olivier Guyot a3f9c6b724 Update change log w/ breaking changes 2018-11-15 17:13:46 +01:00
Olivier Guyot 3ac46ad10b Removed old control 2018-11-15 17:12:40 +01:00
Olivier Guyot d5c390e726 Fixed tests & linting 2018-11-15 17:12:40 +01:00
Olivier Guyot 1b8a6baa35 Added extent handling to graticule layer 2018-11-15 17:12:40 +01:00
Olivier Guyot 94bcb8a0f6 Added wrapX option on graticule 2018-11-15 17:12:40 +01:00
Olivier Guyot c69366ec0a Updated the sphere mollweide example 2018-11-15 17:12:40 +01:00
Olivier Guyot 4ee75359c0 Implemented a feature pool for lines and labels 2018-11-15 17:12:40 +01:00
Olivier Guyot adb1bd7a31 First version to handle lines only 2018-11-15 17:12:40 +01:00
Olivier Guyot dbd6dad4f3 Add a new Graticule layer, nothing rendered for now 2018-11-15 17:12:40 +01:00
Olivier Guyot 593632daea Fix the OverviewMap control & example
Layers must now always be specified for the control.
Base example was amended to reflect that.

The breaking change was added in the update notes.
2018-11-15 12:04:49 +01:00