Start a new topic

AR.GeoObject() does not allow onClick event on AR.ImageDrawable and AR.HtmlDrawable

Hi,

I am building a location-based AR app using Xamarin.Forms. I have tested a couple of times on Android the AR.GeoObject that does not allow onClick event when the drawables are objects of AR.ImageDrawable or AR.HtmlDrawable


I am using the latest JavaScript SDK(7.2) for Xamarin and In fact, click event does not work on all those samples with POIs. For demonstration purposes, i have a piece of code bellow:    

 AR.context.onLocationChanged 
=  function locationChangedFn(lat, lon, alt, acc) {
         var markerDrawable_idle = new AR.ImageResource("assets/marker_idle.png");
        var markerLocation = new AR.GeoLocation(49.425518, 7.755948, 100.0);
        var markerImageDrawable_idle = new AR.ImageDrawable(markerDrawable_idle, 2.5, {
            zOrder: 0,
            opacity: 1.0,
            translate : { x: 1 },
            rotate : { z: 190 },
            onClick : function() {//this have no response
              this.rotate.z += 10;
            }
        });

        var markerObject = new AR.GeoObject(markerLocation, {
            drawables: {
                cam: [markerImageDrawable_idle]
            }
        });
    } 

    


How to work with GeoLocation Class nothing special and no in-depth examples.

I also cannot post a comment.

oops, I go by toolbar search and landed here.


I am using it for Wikitude SDK Professional Edition for Android 9.5.0.

Hello Jai,


Are you working with Android or with iOS? And by extensions, I mean are you working with Unity, Xamarin, Cordova? Since you have posted under the Xamarin caregory then, I assume you are working with Xamarin.


You mentioned that you are working with the GEO functionality so, could you please go through this forum post https://support.wikitude.com/support/discussions/topics/5000082719?


Could you also please try and run our sample and see if this is working?


Thanks,

Eva

Could you please provide following details:

Which version of the SDK are you using?

Jai>> version 9.5.0

Are you working with the JS API or the Native API?

Jai>> JS API

Are you using any extensions and if so, which one?

Jai>> extension? Not sure following this example, 08_PointOfInterest_1_PoiAtLocation

Do you have a crash log? What is it exactly that is not working?

Jai>> no crashes, function didn't fire on click.

Can you provide steps to reproduce the crash - ideally with the SDK sample app?

Jai>> no, no crashes.

 

 

 

 

 

 

 

 

 

 

 

Hello,


Could you please provide following details:

  • Which version of the SDK are you using?
  • Are you working with the JS API or the Native API?
  • Are you using any extensions and if so, which one?
  • Do you have a crash log? What is it exactly that is not working?
  • Can you provide steps to reproduce the crash - ideally with the SDK sample app?


Thx and greetings

Eva

Following method not working.


var markerImageDrawableIdle = new AR.ImageDrawable(World.markerDrawableIdle, 3.0, {

            zOrder: 0,

            opacity: 1.0,

            onClick: ontestClick

        });


ontestClick: function ontestClickfn()

    {

        World.onError('test onJaiClickfn');

    }

Hi,


we are still unable to reproduce this issue, the selecting pois sample worked fine on our tests with xamarin. We do not have the Xperia Z2 at the office, but it was tested with the Xperia Z3. 


Best Regards,

Alex

Hi,

Thank you again for the response. I am working with the samples. Consider this sample (hselecting pois) for example, which I have not changed anything and it does not work.


I am using the latest version of the JS SDK (7.2) on Xamarin platform and I have a sony experia z2 device. I also have checked it with the Wikitude App. It works fine there with the same device.


best regards

Eid



Hi,


since i was not able to reproduce this issue, please send me your modified AR Experience so we can take a look at it.


Best Regards,

Alex

Hi,

Thank you very much for the response, and after testing with the remote debugging, I came to know that the problem is with the jQuery/css used in the POI samples. For example, in the sample 08_PointOfInterest_4_SelectingPois the onClick event works well when I remove all the jQuery and css references from index.html. 


Note that I have not made any changes to the original sample, I also have tested with different versions of jQuery and css, still it does not work. I have set style background: none several times.


I need to use jQuery in my application and I am stuck at this point. Please help me with this issue.

Thanks

Hi,


I was unable to reproduce this issue. Please try to activate remote debugging with chrome or safari to see if there are any errors reported in the console.

To see how this can be done please take a look at our documentation for Android or for iOS


Best Regards

Alex

Login or Signup to post a comment