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

Lock MapImages #332

Closed
ClFeSc opened this issue Apr 27, 2022 · 3 comments · Fixed by #545
Closed

Lock MapImages #332

ClFeSc opened this issue Apr 27, 2022 · 3 comments · Fixed by #545
Assignees
Labels
BP2022HG1 - Good First Issue enhancement New feature or request frontend Issues mainly related to the frontend shared Issues mainly related to shared

Comments

@ClFeSc
Copy link
Contributor

ClFeSc commented Apr 27, 2022

Currently, when a mapImage takes up the whole screen, no movement for trainers with the mouse is possible. There should be a way to still move, e.g. by locking the mapImage.

@ClFeSc ClFeSc added enhancement New feature or request frontend Issues mainly related to the frontend labels Apr 27, 2022
@Dassderdie Dassderdie changed the title MapImage Drag-and-Drop improvement Lock MapImages Sep 29, 2022
@Dassderdie Dassderdie added the shared Issues mainly related to shared label Oct 4, 2022
@lukasrad02
Copy link
Contributor

We're currently working on this and do not find the right place in the code to disable movements.

Taking a look at frontend/src/app/pages/exercises/exercise/shared/exercise-map/feature-managers/map-images-feature-manager.ts, there is a onFeatueClicked-handler, but this does not get triggered when you move the image.
There also is the arrow function for proposeMovementAction passed to the super constructor, but passing an empty function just prevents sending the proposal to the server, not the movement itself.

Comparing the map image feature (which cannot be moved by a participant) to the vehicle feature (which can be moved by a participant), we did not find any differences that could reveal some kind of locking mechanism.

Even the translatestart-listener, registered in frontend/src/app/pages/exercises/exercise/shared/exercise-map/utility/translate-helper.ts, does not fire when a participant tries to drag an image, so the locking mechanism seems to be implemented earlier.

Could someone please give us a hint how to implement a locking mechanism?

@Dassderdie
Copy link
Collaborator

Could someone please give us a hint how to implement a locking mechanism?

I'll look into this, this evening - please try a different issue in the meantime. This one is a bit trickier than I anticipated :/

@Dassderdie
Copy link
Collaborator

Could someone please give us a hint how to implement a locking mechanism?

Please have a look at #545 and try to understand what I did there. In OpenLayers the TranslationInteraction itself is the only thing that has control over the translation stuff. Because we don't want to think from the perspective of the Interaction, but from the perspective of an element/feature (represented via the FeatureManager interface) we have to build our own logic to convert between these APIs.

If you haven't pushed your branch yet, I would propose you push your local changes on my branch and continue working from #545

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BP2022HG1 - Good First Issue enhancement New feature or request frontend Issues mainly related to the frontend shared Issues mainly related to shared
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants