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

Issue rotate web #790

Closed

Conversation

metafounder
Copy link
Contributor

@metafounder metafounder commented Nov 26, 2021

this should fix: rotateGesturesEnabled seems to be ignored for web #777

@@ -41,6 +38,10 @@ class Convert {
if (options.containsKey('zoomGesturesEnabled')) {
sink.setZoomGesturesEnabled(options['zoomGesturesEnabled']);
}
if (options.containsKey('rotateGesturesEnabled')) {
//Should not be invoked before sink.setZoomGesturesEnabled()
sink.setRotateGesturesEnabled(options['rotateGesturesEnabled']);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could setZoomGesturesEnabled be affected by this modification?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

from what I can tell, it will impact all gestures which may use keyboard :

setZoomGesturesEnabled controls:

  _map.doubleClickZoom.enable();
  _map.boxZoom.enable();
  _map.scrollZoom.enable();
  _map.touchZoomRotate.enable();
  _map.keyboard.enable();  

and then setRotateGesturesEnabled controls:

  _map.dragRotate.enable();
  _map.touchZoomRotate.enableRotation();
  _map.keyboard.enable();

The KeyboardHandler in the current implementation seems to not offer a granular option to disable/enable certain keys or combinations of keys.

I think a quick action is to simply call the methods in the Convert in the order of their likelihood:

How often do you need a map that does not zoom but which you can rotate vs. A map which can be zoomed but you cannot rotate

Copy link
Collaborator

@felix-ht felix-ht Dec 6, 2021

Choose a reason for hiding this comment

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

just to reiterate - after this pr one can:

disable zoom
disable zoom and rotation
but cannot only disable rotation

Is this correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@felix-ht yes, this is correct.

@metafounder
Copy link
Contributor Author

are the mobile fails normal due to the fact I only changed web ?

@felix-ht
Copy link
Collaborator

felix-ht commented Dec 6, 2021

@metafounder not the fails are unrelated - this is a limitation of gitlab actions. They cannot be run on branches on forks.

@felix-ht
Copy link
Collaborator

felix-ht commented Jan 11, 2022

i thought about this a bit more and using groups to enable map interaction are just a bad idea. As there is some overlap there is always unintended consequences based on the order that is complete obscured for the user
We should just expose the api as it is on the upstream side.

@metafounder
Copy link
Contributor Author

hi @felix-ht , I agree yes that would be ideal. No issues if this gets rejected, it was a quick temporary fix anyway.

@felix-ht
Copy link
Collaborator

i took a look at the native implantation there gestures are grouped as we expose them here - so it does make sense. I wanted to add the option to disable double click to zoom gesture. I could fix this properly in the same pr by removing the separate functions and adding one function that sets all these settings and once and has access to the full state of the gestures. If thats fine with you @metafounder

Might have to make the settings non nullable for that, as we might set the groups to a wrong state if one of the settings is null (in an update).

@felix-ht felix-ht mentioned this pull request Jan 12, 2022
@felix-ht
Copy link
Collaborator

resolved by #851

@felix-ht felix-ht closed this Jan 16, 2022
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