This is a migrated thread and some comments may be shown as answers.

Click location on Android

4 Answers 73 Views
ImageEditor
This is a migrated thread and some comments may be shown as answers.
Mikko
Top achievements
Rank 1
Veteran
Mikko asked on 25 Mar 2021, 06:46 PM

Hi,

we have a solution where users can mark locations to architectual drawings simply by clicking the location on the drawing.

Everything works fine with desktop browsers, but not with an Android devices. The problem with Android is that does not get X and Y cordinates.

Click event is fired even with an Adroid but no cordinates.

Please see sample script below:

 

   <script type="text/javascript">
                var imageEditor;

                function onImageLoad(sender, args) {
                    imageEditor = sender;

                    $telerik.$(imageEditor.get_viewport()).on("click", function (e) {
                        var statusBar = imageEditor._statusBar;
                        var posX = statusBar.get_coorX().innerText;
                        var posY = statusBar.get_coorY().innerText;

         
                    })



                }
        </script>

 

4 Answers, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 30 Mar 2021, 01:40 PM

Hi Mikko,

The faced behavior is related to a limitation of the click-event arguments, which do not return the actual X and Y values of the clicked location. As the ImageEditor is also updating itself based on the JavaScript/jQuery events, it cannot provide the coordinates which are not available. 

To illustrate the above explanation, below you can see the coordinates available in a desktop browser click event:

and the same click coords returned on mobile browser:

Regards,
Vessy
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Mikko
Top achievements
Rank 1
Veteran
answered on 31 Mar 2021, 05:11 PM

Hi Vessy,

Thank you for your answer.

Do you know if there are any work arounds for this? Ex. use Touch events or similar.

Best regards, Mikko

0
Mikko
Top achievements
Rank 1
Veteran
answered on 04 Apr 2021, 07:06 PM

Hi Vessy,

We noticed that we can get cordinates without using ImageEditor.

jQuery supports tab events, that also contains cordinates, with images.

Best regards, Mikko

0
Vessy
Telerik team
answered on 05 Apr 2021, 01:37 PM

Hi Mikko,

You can handle the mobile device touchstart/touchend event, but the ImageEditor click coordinates will be not available there. Optionally, you can implement your own logic for taking the current touch coordinates, substracting the x/u position of the image editor.

If you decide, you can also add a feature request for such improvement in RadImageEditor here:
https://feedback.telerik.com/aspnet-ajax

Regards,
Vessy
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
ImageEditor
Asked by
Mikko
Top achievements
Rank 1
Veteran
Answers by
Vessy
Telerik team
Mikko
Top achievements
Rank 1
Veteran
Share this question
or