Start a new topic

htmlDrawable onClick problem

htmlDrawable onClick problem

1 person has this problem


Hi all,

how onClick work in htmlDrawable?
In myMarker.html how listen for onClick event?

document.addEventListener("onClick", doSomething());

 

Thi is the code:

function creaPoiHtml(luogo) {
        
        // CREO MARKER CON HTML
        //create a new html drawable and pass some setup parameters to it
        
        poiHTMLdrawable = new AR.HtmlDrawable({uri:"myMarker.html?var1="},
                                                  5,
                                                  {
                                              enabled: true,
                                              viewportWidth: 512,
                                              scale:1,
                                              updateRate:AR.HtmlDrawable.UPDATE_RATE.STATIC,
                                              clickThroughEnabled: true,
                                              onClick: function() {
                                                                    return true;
                                                                    }
                                              });
        
        new AR.GeoObject(luogo, {drawables: {cam: poiHTMLdrawable, radar: radarCircle}});
    }

 

 

Thanks all.

You will need to pass clickThroughEnabled: true in the constructor to activate clicking on the HTML content. Addtionally you need to use a dynamic drawable (AR.HtmlDrawable.UPDATE_RATE.LOW).

However setting the update rate to anything else than STATIC might introduce rendering jiggers. Thus it is currently not advised to use any other update rate than STATIC.

Hi,

after change AR.htmlDrawable.UPDATE_RATE.LOW with clickThroughEnabled, how can i listen for onClick event into myMarker.html?

Thanks.
Login or Signup to post a comment