Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Globe Projection Bug: Circle Layers have smaller hover/click area than visually represented #5255

Open
ingalls opened this issue Dec 21, 2024 · 3 comments
Labels
bug Something isn't working globe Globe related issues PR is more than welcomed Extra attention is needed

Comments

@ingalls
Copy link

ingalls commented Dec 21, 2024

maplibre-gl-js version: 5.0.0-pre10

browser: Reproduced in Chrome and Firefox on Ubuntu 24.10

Steps to Trigger Behavior

  1. Create a Circle Layer with Icons OR actual circles
  2. When using in mercator mode the hover/click events match the rendered symbol's bounds
  3. Turning on globe projects seems to only allow a very small point within the rendered circle or icon that hovers or clicks

Link to Demonstration

https://codepen.io/ingalls-the-bold/pen/jENmLGe

Expected Behavior

MouseEnter/Leave & Click covers entire rendered feature

Actual Behavior

MouseEnter/Lease & Click is much smaller than actual rendered feature in the new Globe projection

@HarelM HarelM added bug Something isn't working PR is more than welcomed Extra attention is needed globe Globe related issues labels Dec 22, 2024
@HarelM
Copy link
Collaborator

HarelM commented Dec 22, 2024

Thanks for taking the time to report this issue!
I think this is related to missing implementation in queryRenderFeatures for globe.

function getPixelPosMatrix(transform, tileID) {
const t = mat4.create();
mat4.translate(t, t, [1, 1, 0]);
mat4.scale(t, t, [transform.width * 0.5, transform.height * 0.5, 1]);
if (transform.calculatePosMatrix) { // Globe: TODO: remove this hack once queryRendererFeatures supports globe properly
return mat4.multiply(t, t, transform.calculatePosMatrix(tileID.toUnwrapped()));
} else {
return t;
}

CC: @kubapelc

@HarelM HarelM added the showstopper Preventing from releasing a pre-release version as non-pre-release label Dec 22, 2024
@HarelM
Copy link
Collaborator

HarelM commented Dec 25, 2024

This seems to apply only for circles.
While this bug needs a solution, since it does not apply to every type of layer, I'm reducing its severity.

@HarelM HarelM removed the showstopper Preventing from releasing a pre-release version as non-pre-release label Dec 25, 2024
@bp2030
Copy link

bp2030 commented Jan 6, 2025

Clusters with globe projection gives a very small clickable area as well. I'm guessing this is linked to this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working globe Globe related issues PR is more than welcomed Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants