Commit f5537347 by Dmitriy Stepanets

Merge branch 'feature/radar'

parents 1460b447 f9b35166
......@@ -170,7 +170,14 @@ class MapTimeControlView: UIView {
let location = gestureRecoginzer.location(in: self)
let progress = max(location.x - stackView.frame.origin.x, 0) / (self.bounds.width - stackView.frame.origin.x)
let targetIndex = Int(CGFloat(currentItems.count) * progress)
let selectedItem = currentItems[max(targetIndex, currentItems.count - 1)]
let selectedItem = currentItems[min(targetIndex, currentItems.count - 1)]
if playButtonState == .pause {
self.handlePlayButton()
}
self.delegate?.didSelect(item: selectedItem)
let progressWithoutOffset = location.x / self.bounds.width
self.updateProgress(value: progressWithoutOffset)
}
}
......
......@@ -178,7 +178,7 @@ class RadarViewController: UIViewController {
}
private func endLoop() {
DispatchQueue.global(qos: .userInitiated).async {
DispatchQueue.main.async {
self.swarmOverlay?.stopAnimating(jumpToLastFrame: false)
}
swarmRenderer?.setNeedsDisplay(mapView.visibleMapRect)
......@@ -418,6 +418,7 @@ extension RadarViewController: MapTimeControlViewDelegate {
}
func didSelect(item: MapTimeControlItem) {
//
swarmOverlay?.setValidTime(date: item.date)
swarmRenderer?.setNeedsDisplay()
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment