電子圍籬

SAILS SDK內有一個LocationRegion的class可以用來支援客製化的電子圍籬。

設定經緯度集合

產生一個LocationRegion物件後,可透過以下method進行經緯度集合設定:

void setVertexList(List<GeoNode> vertexList)

GeoNode是向量地圖專用的經緯度類別,在GeoNode物件創建初期給定經緯度座標即可。

判別是否在區域內

透過以下方式判別是否在本LocationRegion的區域範圍內:

boolean isInRegion(double lon, double lat)

您可以將用戶目前所在經緯度位置放入進行判別,若在區域內會return true,反之為false。

取得區域的中心點

當設定完經緯度集合後,可透過以下方式取得中心點:

double getCenterLongitude()
double getCenterLatitude()

results matching ""

    No results matching ""