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

Interacting with the Map's canvas from an Input Element #9134

Closed
yonzmeer opened this issue Sep 4, 2020 · 3 comments
Closed

Interacting with the Map's canvas from an Input Element #9134

yonzmeer opened this issue Sep 4, 2020 · 3 comments

Comments

@yonzmeer
Copy link
Contributor

yonzmeer commented Sep 4, 2020

Hi,

My application provides a special HTML-input which can get its value from clicking on the map's canvas:

  1. The user click on the input.
  2. the input is focused and subscribes to the 'click' event from the map's canvas.
  3. the user click on the map.
  4. the input is filled with the lat-long coordinates from the click position.
  5. when the input is blurred, it unsubscribes from the 'click' event from the map's canvas.

PR-8662 broke this behavior because it blurs my input before the 'click' event emits, since it does that on 'mousedown' which always come before 'click'.

I fully understand the reasoning behind the PR, but I think the behavior should be configurable.

I suggest making this behavior configurable by passing blurActiveElementOnInteraction via the ViewerConstructorOptions or via the CesiumWidget's options parameter.
blurActiveElementOnInteraction should obviously default to true to preserve the current behavior.

Please tell me what you think is the best solution for this problem.

Thanks a lot

@yonzmeer yonzmeer changed the title Interacting with cesium map from Input Element Interacting with the Map's canvas from an Input Element Sep 4, 2020
@OmarShehata
Copy link
Contributor

Couldn't this be done by using CesiumJS's screen space event handler?

Here's a Sandcastle that puts the location in a textbox when you click.

@yonzmeer
Copy link
Contributor Author

yonzmeer commented Sep 4, 2020

Couldn't this be done by using CesiumJS's screen space event handler?

Here's a Sandcastle that puts the location in a textbox when you click.

This is not the behavior I mentioned.
The Input should get the values only after it was focused.
And it should not get values if the input is not the active element.

@ggetz
Copy link
Contributor

ggetz commented Jul 8, 2022

Fixed in #10518

@ggetz ggetz closed this as completed Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants