The new Location API in Google allows for creating and monitoring a Geofence that's a circular region with the Geofence.Builder
class. This class only has methods defined for creating a geofence with a circular shape. I was wondering if it was possible to extend the Geofence.Builder
class and create a custom shape. What I wanted to do was have a triangular shape defined instead of a circular one.
If that's not possible does the Geofence class provide for a way to monitor only a certain segment of the circle?
Update: What I want to do is extend a triangle from the users position with one of the vertices being the users location. I want the height of the triangle to be 50 meters and the base of the triangle to be 10 meters. What I want to do afterwards is to detect whenever another user enters this triangle extended from the current users position.
Good question. Alas, you probably won't be pleased with the answer.
Location Services doesn't support non-circular geofences, nor can you monitor only a segment of the circle. Since Geofence.Builder doesn't have a method for creating a non-circular Geofence, there's no way to provide your own extension.
If you post a description of your use case, perhaps someone can figure out an answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With