From 9d96f06de1313f9cf2ea49c451bbb84e1e1f1dfe Mon Sep 17 00:00:00 2001 From: EunsuSeo01 Date: Mon, 30 Dec 2024 08:52:07 +0900 Subject: [PATCH] =?UTF-8?q?[Feat]=20#319=20-=20=EC=83=81=EC=84=B8=20?= =?UTF-8?q?=EC=A7=80=EB=8F=84=EC=97=90=20=ED=95=9C=EB=81=BC=20=ED=95=80=20?= =?UTF-8?q?=EB=9D=84=EC=9A=B0=EA=B3=A0=20=EC=B9=B4=EB=A9=94=EB=9D=BC=20?= =?UTF-8?q?=EC=9D=B4=EB=8F=99=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Present/HankkiDetail/View/DetailMapView.swift | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Hankkijogbo/Hankkijogbo/Present/HankkiDetail/View/DetailMapView.swift b/Hankkijogbo/Hankkijogbo/Present/HankkiDetail/View/DetailMapView.swift index 04942280..606ff31b 100644 --- a/Hankkijogbo/Hankkijogbo/Present/HankkiDetail/View/DetailMapView.swift +++ b/Hankkijogbo/Hankkijogbo/Present/HankkiDetail/View/DetailMapView.swift @@ -81,6 +81,7 @@ final class DetailMapView: BaseView { } mapView.do { + $0.zoomLevel = 16 $0.clipsToBounds = true $0.layer.cornerRadius = 12 $0.layer.maskedCorners = CACornerMask(arrayLiteral: .layerMinXMinYCorner, .layerMaxXMinYCorner) @@ -130,6 +131,8 @@ extension DetailMapView { func bindData(latitude: Double, longitude: Double) { addressLabel.text = "\(latitude) \(longitude)" + addMapMarker(latitude: latitude, longitude: longitude) + moveMapCamera(latitude: latitude, longitude: longitude) } } @@ -145,6 +148,18 @@ private extension DetailMapView { UIPasteboard.general.string = addressLabel.text } + func addMapMarker(latitude: Double, longitude: Double) { + let marker = NMFMarker() + marker.position = NMGLatLng(lat: latitude, lng: longitude) + marker.iconImage = NMFOverlayImage(image: .icPin) + marker.mapView = mapView + } + + func moveMapCamera(latitude: Double, longitude: Double) { + let cameraUpdate = NMFCameraUpdate(scrollTo: NMGLatLng(lat: latitude, lng: longitude)) + mapView.moveCamera(cameraUpdate) + } + // MARK: - @objc Func @objc func copyButtonDidTap() {