簡體   English   中英

是否可以在iOS中為多邊形地理圍欄創建和獲取觸發器(進入和退出)

[英]Is it possible to create and get triggers (enter and exit) for polygon geofencing in iOS

我想創建一個應用程序,當用戶點擊mapview時,它將為該位置創建地理圍欄(可以是圓形,多邊形或任何類型)。 每當用戶進入或退出創建的區域時,我都希望得到通知。 我設法用圓形區域實現,但也想用多邊形或用戶定義的區域來實現。

請提出建議。

使用CLLocationManager:創建一個區域並使用startMonitoringForRegion:對其進行startMonitoringForRegion: 對於通知,請使用委托方法

locationManager:didEnterRegion:
locationManager:didExitRegion:
locationManager:didDetermineState:forRegion:

https://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLLocationManager_Class/index.html

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM