类 TencentGeofence
- java.lang.Object
-
- com.tencent.map.geolocation.TencentGeofence
-
public class TencentGeofence extends java.lang.Object地理围栏.地理围栏表示一片地理位置区域, 用户设备进入或退出该区域后会触发相应的地理围栏事件, 应用程序可捕获感兴趣的地理围栏事件并执行相应操作(比如通过声音或振动提示用户).
地理围栏支持圆形地理围栏和多边形地理围栏两种。 公共参数包括:
- Tag: 唯一的字符串. 用于标识和区分当前各个已设置的地理围栏
- 有效期: 单位为 ms(毫秒). 超过有效期的围栏会被自动清除, 应根据使用场景选择合理的值, 建议取值 3-6小时
- 类型:包括Circle和Polygon两种类型
- 中心点坐标: GCJ-02 坐标系下经纬度. 用于指定目的地的精确位置
- 半径: 表示区域大小, 单位为 m(米). 考虑到实际定位精度水平, 建议取值 500-1500米
- 边界坐标点 :GCJ-02 坐标系下经纬度边界坐标,最少传3个,且不能重复经纬度
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static classTencentGeofence.Builder用于生成 TencentGeofence 的 Builder.static classTencentGeofence.CircleFence圆形地理围栏类static classTencentGeofence.FencePoint地理围栏点类型static classTencentGeofence.PolygonFence多边形地理围栏
-
字段概要
字段 修饰符和类型 字段 说明 static intGEOFENCE_TYPE_CIRCLEstatic intGEOFENCE_TYPE_POLYGON
-
方法概要
所有方法 实例方法 具体方法 已过时的方法 修饰符和类型 方法 说明 booleanequals(java.lang.Object obj)TencentGeofence.CircleFencegetCircleFence()返回圆形围栏对象 仅当Type为GEOFENCE_TYPE_CIRCLE有效longgetDuration()返回有效期, 单位为 ms(毫秒).longgetExpireAt()返回过期时间, 过期时间 = 有效期 + SystemClock.elapsedRealtime()doublegetLatitude()已过时。doublegetLongitude()已过时。TencentGeofence.PolygonFencegetPolygonFence()返回多边形围栏对象 仅当Type为GEOFENCE_TYPE_POLYGON有效floatgetRadius()已过时。java.lang.StringgetTag()返回唯一标识.intgetType()返回地理围栏类型inthashCode()java.lang.StringtoString()
-
-
-
方法详细资料
-
getLatitude
@Deprecated public double getLatitude()
已过时。返回纬度 仅当Type为GEOFENCE_TYPE_CIRCLE有效 废弃,建议使用getCircleFence.getLatitude
-
getLongitude
@Deprecated public double getLongitude()
已过时。返回经度 仅当Type为GEOFENCE_TYPE_CIRCLE有效 废弃,建议使用getCircleFence.getLongitude
-
getRadius
@Deprecated public float getRadius()
已过时。返回半径, 单位为 m(米) 仅当Type为GEOFENCE_TYPE_CIRCLE有效 废弃,建议使用getCircleFence.getRadius
-
getCircleFence
public TencentGeofence.CircleFence getCircleFence()
返回圆形围栏对象 仅当Type为GEOFENCE_TYPE_CIRCLE有效
-
getPolygonFence
public TencentGeofence.PolygonFence getPolygonFence()
返回多边形围栏对象 仅当Type为GEOFENCE_TYPE_POLYGON有效
-
getExpireAt
public long getExpireAt()
返回过期时间, 过期时间 = 有效期 + SystemClock.elapsedRealtime()- 另请参阅:
SystemClock.elapsedRealtime()
-
getDuration
public long getDuration()
返回有效期, 单位为 ms(毫秒).
-
getType
public int getType()
返回地理围栏类型
-
getTag
public java.lang.String getTag()
返回唯一标识.
-
equals
public boolean equals(java.lang.Object obj)
- 覆盖:
equals在类中java.lang.Object
-
hashCode
public int hashCode()
- 覆盖:
hashCode在类中java.lang.Object
-
toString
public java.lang.String toString()
- 覆盖:
toString在类中java.lang.Object
-
-