Skip to content

Commit

Permalink
Shader support for extreme latitude coordinates (#5081)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pessimistress committed Oct 29, 2020
1 parent 49bd63c commit 306099d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/core/src/shaderlib/project/project.glsl.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,10 @@ vec2 project_mercator_(vec2 lnglat) {
if (project_uWrapLongitude) {
x = mod(x - project_uAntimeridian, 360.0) + project_uAntimeridian;
}
float y = clamp(lnglat.y, -89.9, 89.9);
return vec2(
radians(x) + PI,
PI + log(tan_fp32(PI * 0.25 + radians(lnglat.y) * 0.5))
PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))
);
}
Expand Down

0 comments on commit 306099d

Please sign in to comment.