Don't rotate the points of the heatmap layer
This commit is contained in:
@@ -183,24 +183,18 @@ class Heatmap extends VectorLayer {
|
|||||||
precision mediump float;
|
precision mediump float;
|
||||||
attribute vec2 a_position;
|
attribute vec2 a_position;
|
||||||
attribute vec2 a_texCoord;
|
attribute vec2 a_texCoord;
|
||||||
attribute float a_rotateWithView;
|
|
||||||
attribute vec2 a_offsets;
|
attribute vec2 a_offsets;
|
||||||
attribute float a_opacity;
|
attribute float a_opacity;
|
||||||
|
|
||||||
uniform mat4 u_projectionMatrix;
|
uniform mat4 u_projectionMatrix;
|
||||||
uniform mat4 u_offsetScaleMatrix;
|
uniform mat4 u_offsetScaleMatrix;
|
||||||
uniform mat4 u_offsetRotateMatrix;
|
|
||||||
uniform float u_size;
|
uniform float u_size;
|
||||||
|
|
||||||
varying vec2 v_texCoord;
|
varying vec2 v_texCoord;
|
||||||
varying float v_opacity;
|
varying float v_opacity;
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
mat4 offsetMatrix = u_offsetScaleMatrix;
|
vec4 offsets = u_offsetScaleMatrix * vec4(a_offsets, 0.0, 0.0);
|
||||||
if (a_rotateWithView == 1.0) {
|
|
||||||
offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;
|
|
||||||
}
|
|
||||||
vec4 offsets = offsetMatrix * vec4(a_offsets, 0.0, 0.0);
|
|
||||||
gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets * u_size;
|
gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets * u_size;
|
||||||
v_texCoord = a_texCoord;
|
v_texCoord = a_texCoord;
|
||||||
v_opacity = a_opacity;
|
v_opacity = a_opacity;
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ const HIT_FRAGMENT_SHADER = `
|
|||||||
* source to compute the opacity of the quad on screen (from 0 to 1). This is only done on source change.
|
* source to compute the opacity of the quad on screen (from 0 to 1). This is only done on source change.
|
||||||
* Note: this is multiplied with the color of the point which can also have an alpha value < 1.
|
* Note: this is multiplied with the color of the point which can also have an alpha value < 1.
|
||||||
* @property {function(import("../../Feature").default):boolean} [rotateWithViewCallback] Will be called on every feature in the
|
* @property {function(import("../../Feature").default):boolean} [rotateWithViewCallback] Will be called on every feature in the
|
||||||
* source to compute whether the quad on screen must stay upwards (`false`) or follow the view rotation (`true`).
|
* source to compute whether the quad on screen must stay upwards (`false`) or follow the view rotation (`true`). Default is `false`.
|
||||||
* This is only done on source change.
|
* This is only done on source change.
|
||||||
* @property {HTMLCanvasElement|HTMLImageElement|ImageData} [texture] Texture to use on points. `texCoordCallback` and `sizeCallback`
|
* @property {HTMLCanvasElement|HTMLImageElement|ImageData} [texture] Texture to use on points. `texCoordCallback` and `sizeCallback`
|
||||||
* must be defined for this to have any effect.
|
* must be defined for this to have any effect.
|
||||||
|
|||||||
Reference in New Issue
Block a user