forked from shadowspore/t38c
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgeofence.go
27 lines (22 loc) · 842 Bytes
/
geofence.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package t38c
// Geofence struct
type Geofence struct {
client tile38Client
}
// Within geofence
func (gf *Geofence) Within(key string) GeofenceAreaSelector {
return newGeofenceAreaSelector(gf.client, "WITHIN", key)
}
// Intersects geofence
func (gf *Geofence) Intersects(key string) GeofenceAreaSelector {
return newGeofenceAreaSelector(gf.client, "INTERSECTS", key)
}
// Nearby geofence
func (gf *Geofence) Nearby(key string, lat, lon, meters float64) GeofenceQueryBuilder {
area := newCmd("POINT", floatString(lat), floatString(lon), floatString(meters))
return newGeofenceQueryBuilder(gf.client, "NEARBY", key, area)
}
// Roam geofence
func (gf *Geofence) Roam(key, target, pattern string, meters int, nodewell bool) GeofenceQueryBuilder {
return newGeofenceRoamQueryBuilder(gf.client, key, target, pattern, meters, nodewell)
}