Copy link to clipboard
Copied
I've got 7 geolocations points (lat & long) that defines an area like this :
How can I trigger a function when the user is in the area ?
I thought about something like :
if(e.latitude < -20.280442 && e.latitude > -21.414927 && e.longitude < 167.738801 && e.longitude> 166.739045){
do something
}
With this method I'm defining a square (2 latitude points and 2 longitude points).
Do you see another way to do it more precisely ?
Copy link to clipboard
Copied
You should be able to create a shape, make its alpha property 0, and then perform hittests to see if the user object is touching that shape.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now