I have this code for the htmldrawable. So what I have to do is onEnterFieldOfVision = weatherWidget; Like that?
almost 7 years ago
You have either attached the drawable "weatherWidget" to a AR.GeoObject or AR.Trackable2DObject depending on if you are using Geo based AR or image recognition.
Both of these objects have an onEnterFieldOfVision trigger property that you can assign a function to. This function will be executed when the object becomes visible in the field of view.
Here is a quick example for doing what you asked assuming you are using image recognition.