fileprivate func moveCamera(latitude: Double, longitude: Double) {
let cameraPosition = NMFCameraPosition(
NMGLatLng(
lat: latitude,
lng: longitude
),
zoom: self.mapView.zoomLevel
)
let cameraUpdate = NMFCameraUpdate(position: cameraPosition)
cameraUpdate.animation = .easeIn
self.mapView.moveCamera(cameraUpdate)
}
}
extension Reactive where Base: LocationView {
var cameraPosition: Binder<(Double, Double)> {
return Binder(self.base) { view, cameraPosition in
let (latitude, longitude) = cameraPosition
view.moveCamera(latitude: latitude, longitude: longitude)
}
}
}
"didupdatelocations" [core] "error returned from daemon: error domain=com.apple.accounts code=7
"Error Domain=com.apple.accounts C… | Apple Developer Forums
Converting between coordinates and user-friendly place names | Apple Developer Documentation
[x] MapView UI 구현
section.visibleItemsInvalidationHandler = { (visibleItems, offset, env) in
visibleItems.forEach { item in
let intersectedRect = item.frame.intersection(CGRect(x: offset.x, y: offset.y, width: env.container.contentSize.width, height: item.frame.height))
let percentVisible = intersectedRect.width / item.frame.width
let scale = 0.7 + (0.3 * percentVisible)
item.transform = CGAffineTransform(scaleX: 0.98, y: scale)
}
let scale = 0.7 + (0.3 * percentVisible)
: **scale
**을 계산하여, 스케일이 0.7에서 시작하여 최대 0.3만큼 더 증가하도록 합니다. 이 값을 조절하여 스케일을 변경item.transform = CGAffineTransform(scaleX: 0.98, y: scale)
: 계산된 **scale
**을 적용하여 셀의 크기를 조정합니다. 여기서 x 축 방향으로는 0.98로 고정된 스케일을 적용하고, y 축 방향으로는 계산된 scale
값을 적용하여 셀의 크기를 조절 (1.0으로 설정 시 직사각형 너비의 백분율이 화면의 보여지는 셀에 스케일이 맞아서 좌 우의 약간씩 보이는 셀들이 보여지지 않음)Scale cell according to visibility percentage
[x] 내위치 버튼 선택 시 내 위치로 이동하는 로직 구현