-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Location selector: Move location on map click #22198
Location selector: Move location on map click #22198
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
Thanks for bringing this up. The team discussed this and we decided a better UX would be to move the marker on single press. So you tap/click the map anywhere to place the marker there. Obviously this shouldn't interfere with panning the map or resizing the circle. |
I poked at this for a bit but so far I've been unsuccessful in figuring out how to generate a click event on the base map. I may come back to it to try again sometime but I'm not sure. Right now the map shows the grab cursor on hover, would it be changed to the pointer cursor instead? |
@matthiasdebaat what do you think? |
Yes, I think this is needed to make this interaction work. On drag it should switch to the grab cursor. We have to check if this also works on mobile. Alternative for touch interfaces could be to have the marker in a fixed center position of the map, allowing users to drag the map underneath instead of dragging the marker itself. |
Hi @karwosts, you can add event listeners to the leaflet map object in
then you can handle the click somewhere. |
Great thanks, I can test it tomorrow on my iPhone. |
LGTM. Will leave it for @wendevlin to merge after trying iOS |
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
iOS works fine ✔️ |
Added double-click handling. |
requested changes have been addressed
Proposed change
Add an icon-button to ha-selector-location which drops the marker at the center of the current viewport.Move marker on click for location selector.
This is much faster than the old method (which I find very cumbersome), where you have to:
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: