1 (edited by cilkamib 2021-04-07 18:23:50)

Topic: Creation of Geofences

Good day. Need help. Is it possible to implement the binding of objects to a specific geolocation zone? For example, when our marker (Location service) enters a certain circle geofence on the map, we automatically have an object - "You are in the square" and the like. I'll be very thankful

Re: Creation of Geofences

Hello.

To do this, calculate the distance between the object and the target coordinate.
If the distance is less than a certain threshold, trigger the event you want.
https://infinity-code.com/doxygen/onlin … bc84a165f2

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Creation of Geofences

Hi, I've try several time but can't understand how to calculate the real distance (location gps) from 1 marker and the player (location service). Or how to create a geo fence around a Marker so when the Player (location service) enter in this area can activate a function.

I would like to activate a function ONLY when I'm near to specific marker, about 3 meters (or inside a radius range, or inside a geo fence).

I've try the Collider (with Rigidbody) mode but when I zoom out the collider of the Marker and the collider of the player collision together.

Thank you very much if you can help with an example code,
Paolo smile

Re: Creation of Geofences

Example:
https://infinity-code.com/atlas/online- … ample.html

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Creation of Geofences

Thank you. I've already seen this script but I can't understand how copy the GPS location Marker and the GPS location Player (location service) to X and Y in both field.

I've instantiate 1 marker and I can see it on Maps/Markers and i've add Player 3D and I see it in Maps Marker3D hierarchy.

How to copy the 2 location GPS to this script?

Thanks,
Paolo

Re: Creation of Geofences

To get the coordinates of a marker, use marker.GetPosition or marker.position.
https://infinity-code.com/doxygen/onlin … 20d4968b61
https://infinity-code.com/doxygen/onlin … 0a8c559dcd

To get current GPS coordinates use OnlineMapsLocationService.instance.position
https://infinity-code.com/doxygen/onlin … 444f547053

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

7 (edited by voceradio 2022-02-09 05:15:11)

Re: Creation of Geofences

Thanks. It work on Editor!

Now I go to test on street. smile

EDIT:

On street:
Work perfectly in both iPhone 6 Plus with iOS 12 and on iPhone 11 Pro Max with latest iOS 15.3.

Thanks!
Paolo smile