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

Click tolerence per layer #6445

Merged
merged 8 commits into from
Nov 25, 2020
Merged

Conversation

ger-benjamin
Copy link
Member

@ger-benjamin ger-benjamin commented Nov 13, 2020

For GSGMF-1294

Variation from the specs

I've named the queryTouchMin option to toleranceTouch to be coherant with the tolerance for desktop and tolerancefor the edition (which is use basically for the the same behavior).
I've not seen any queryToleranceTouch to remove.

OpenLayers:

Done, PR here : openlayers/openlayers#11740
We have to wait on a new ol realease

C2cgeoportal:

It looks already done: https://github.com/camptocamp/c2cgeoportal/pull/6512/files
There is no tolerance or toleranceTouch in ngeoQueryOptions from constants of CONST_vars.yaml . And none is needed. A default value exists in ngeo (the same default value as before).

Ngeo:

I've take care of: #4570 (still and always send the simple click with tolerance bbox as GET parameter. A custom bbox can be done at the mapserver side, and I won't sent one bbox per layer).

@ger-benjamin ger-benjamin self-assigned this Nov 13, 2020
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lgtm-com
Copy link

lgtm-com bot commented Nov 13, 2020

This pull request introduces 1 alert when merging 521c375 into 6c14ef1 - view on LGTM.com

new alerts:

  • 1 for Useless conditional

@ger-benjamin ger-benjamin force-pushed the click_tolerence_per_layer_gsgmf-1294 branch 3 times, most recently from bd9d7a6 to 24386b1 Compare November 17, 2020 14:31
@ger-benjamin ger-benjamin marked this pull request as ready for review November 17, 2020 14:41
@ger-benjamin ger-benjamin changed the title [Don't review] Click tolerence per layer gsgmf 1294 Click tolerence per layer gsgmf 1294 Nov 17, 2020
@sbrunner sbrunner changed the title Click tolerence per layer gsgmf 1294 Click tolerence per layer Nov 17, 2020
@sbrunner
Copy link
Member

Looks good but the CI should pass to make it possible to test it on pages :-)

@ger-benjamin
Copy link
Member Author

So, we have to wait on an OpenLayers release.
If I target a commit in the package.json, I get some errors with the dist.

src/query/Querent.js Show resolved Hide resolved
src/query/Querent.js Outdated Show resolved Hide resolved
@ger-benjamin
Copy link
Member Author

What's left is the ol update and this "invert position" requirement.
But I still don't understand this requirement.

First, what do you means by invert ? In the context, I understand flip vertically. it is correct ?
And by, The queryIconPosition specify the positions of the icon you means that the center of the icon is the center (centroid) of the queryIconPosition ? Right ?

Then, okay, the user knows the size of its icon. And he wants to apply the queryIconPosition from the center of this icon. So in this case, I've to shift (and not flip vertically) the queryIconPosition from the point (queryable point). And the amount of pixel to shift would be the computed bottom value of the queryIconPosition ?
It is correct ?

IMO That's complicated for the user. It's easier and more flexible to build the bounding box from the geometry point. But the specs are done, let me know what I've to do.

I don't see a scenario where to flip is the solution. (even if by invert you means flip horizontally, or reverse the bbox).

@arnaud-morvan
Copy link
Member

arnaud-morvan commented Nov 23, 2020

Invert queryIconPosition : invert bottom and top and invert left and right.
That is, if the queryIconPosition represent the icon bbox relative to the geometry (geometry => icon).
To query the geometry after click in the icon we need to do the inverse (icon => geometry).

@ger-benjamin
Copy link
Member Author

ger-benjamin commented Nov 24, 2020

Thanks for the precisions. With this comment and a draw I've understand.
I'll invert the queryIconPosition values logic ( to [bottom, left, top, right] for 4, or,[bottom, left-right, top] for 3, or [bottom-top, left-right] for 2, or [all] for one value)

@arnaud-morvan
Copy link
Member

Note that I'm not sure it is a good idea to mix bbox calculation from css definition, inversion and buffer application.
For comprehension, it might be better to do thing one by one.

@ger-benjamin
Copy link
Member Author

@arnaud-morvan I've splitted the calculation but in the same function.
I hope it suits to you.

Copy link
Member

@arnaud-morvan arnaud-morvan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it suit to me, IMHO it is easier to understand now, thanks.

@ger-benjamin ger-benjamin force-pushed the click_tolerence_per_layer_gsgmf-1294 branch from c401721 to d632fe4 Compare November 25, 2020 10:33
@ger-benjamin ger-benjamin force-pushed the click_tolerence_per_layer_gsgmf-1294 branch from d632fe4 to 47285fd Compare November 25, 2020 10:52
@ger-benjamin ger-benjamin force-pushed the click_tolerence_per_layer_gsgmf-1294 branch from 47285fd to 074147a Compare November 25, 2020 10:57
@ger-benjamin ger-benjamin merged commit 2b0c915 into master Nov 25, 2020
@ger-benjamin ger-benjamin deleted the click_tolerence_per_layer_gsgmf-1294 branch November 25, 2020 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants