2017-05-16 93 views
0

我希望在我的Swift項目中實現MapBox's iOS SDK。如果您熟悉MapBox,請提供關於實施標記動畫的最佳方法的建議。我基本上是想標記正是Google地圖iOS版也挖時要做到:MapBox iOS動畫標記

enter image description here

enter image description here

謝謝!

+0

您可以在'GoogleMap'中看到動畫標記,同樣的,您也可以在'MapBox'中動畫,我希望 這會幫助你出來,,,,但是不確定有關'MapBox'的 看看http ://stackoverflow.com/questions/40543095/bounce-animation-on-google-map-marker-in-ios-objective-c – Dhiru

回答

0

我通過創建MGLAnnotationView的子類來完成此操作,我們將其稱爲CustomView

它包含2個UIImageView,其中的幀等於CustomView的幀:1是小引腳,默認alpha = 1,1是大引腳,默認alpha = 0。您必須覆蓋override func setSelected(_ selected: Bool, animated: Bool)方法得到你想要的動畫。然後,執行func mapView(_ mapView: MGLMapView, viewFor annotation: MGLAnnotation) -> MGLAnnotationView?返回您的CustomView