Hi,
How can I get the location of a click/touch event? I would like to know where the user clicks on an image from a coordinate standpoint (x, y), not via a hot spot that could be handled by having a control on the hot spots.
Is there a way to get to the mouse-click/press/selcted coordinates?
Thank you,
Olivier
Thanks! I don't use it for getting screen coordinates (well.. I use the X) but instead of putting a bunch of controls in a gallery to display a table, I'm generating the table with a ForAll() loop in an HTML Text control, and I'm using the slider to figure out which column the user is clicking on so that I can move (the proper) input control to that location and simulate their 'Excel functionality' for them. The HTMLText control has auto-height, and works quite well to present my table data to my users in the format they are familiar with.
Thanks, ultra efficient despite the number of controls, very nice trick!
Nice solution, but for a page size map 768x1366, you have 770 controls.
I would like to see a single control do this so I added it to the ideas list.
You can find the coordinates of a grid using the OnSelect property of a slider control inside a gallery that is on top of what you want the user to "click" on. Use the template height of the gallery to set the Y coordinate size.. Add an ID to be able to identify the Y coordinate.
An example table for a map coordinate:
ForAll(
Sequence(100) As _seq,
{Y:_seq.Value}
)
Set the slider control's value range from 1 to the width of your content. Use it's OnSelect property to process the click action.
If you put everything inside a horizontal/vertical container, you can even get it all to scroll, and still have the click events give you the correct coordinates. Make sure to set all the colors to transparent on the gallery/slider.
PCF has a custom integration that gives a click coordinate input.
https://pcf.gallery/click-coordinates/
No the icon isn't required. X and Y coordinates are loaded into a variable this is what the labels show. I have already found a work around for this issue that doesn't require map input. PCF has a custom integration that gives a click coordinate input. Works fine for me and it doesn't require a power apps premium connector that the map input needs.
https://pcf.gallery/click-coordinates/
Hey, please could you advise further on this? Do we need to have an icon for the X and Y co-ords clicked on the map for them to show in the label?
Hi @Pzork !
One flaw I did find with this solution is that actually you can "move" the map with the mouse, thus all the coordinates will change.
But it was a good workaround!
What an ingenious idea! Nice one!
WarrenBelz
146,631
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,991
Most Valuable Professional