Hi all,
I need to do the below task. How can I do this?
we have a vehicle location with longitude and latitude values. In a map we created a special layer named geofenceLayer. I need to check when this vehicle is coming in and going out from this particular layer. Is it possible to do?
Hi Julie,
You can use Envelope.Intersects method.
Get your vehicle location extent and check if it is intersects with the geofecneLayer.
Something like this
Polygon geoFenceArea = geofenceLAyer.Graphics[0] as Polygon;
if(vehicleLocation.Extent.Intersects(geoFenceArea.Extent))
//The vehicle is in
else
//The vehicle is out
Hope this helps.
Thanks,
Asser