forked from Runnect/Runnect-iOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
211 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
Runnect-iOS/Runnect-iOS/Global/UIComponents/MapView/RNMapView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// | ||
// RNMapView.swift | ||
// Runnect-iOS | ||
// | ||
// Created by sejin on 2023/01/02. | ||
// | ||
|
||
import Foundation |
38 changes: 38 additions & 0 deletions
38
Runnect-iOS/Runnect-iOS/Global/UIComponents/MapView/RNMarker.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// | ||
// RNMarker.swift | ||
// Runnect-iOS | ||
// | ||
// Created by sejin on 2023/01/02. | ||
// | ||
|
||
import UIKit | ||
|
||
import NMapsMap | ||
import SnapKit | ||
import Then | ||
|
||
final class RNMarker: NMFMarker { | ||
|
||
// MARK: - initialization | ||
|
||
override init() { | ||
super.init() | ||
setUI() | ||
} | ||
} | ||
|
||
// MARK: - UI & Layout | ||
|
||
extension RNMarker { | ||
private func setUI() { | ||
let image = NMFOverlayImage(image: ImageLiterals.icMapPoint) | ||
self.iconImage = image | ||
|
||
self.width = CGFloat(NMF_MARKER_SIZE_AUTO) | ||
self.height = CGFloat(NMF_MARKER_SIZE_AUTO) | ||
|
||
self.anchor = CGPoint(x: 0.5, y: 0.5) | ||
|
||
self.iconPerspectiveEnabled = true | ||
} | ||
} |
66 changes: 66 additions & 0 deletions
66
Runnect-iOS/Runnect-iOS/Global/UIComponents/MapView/RNStartMarker.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// | ||
// RNStartMarker.swift | ||
// Runnect-iOS | ||
// | ||
// Created by sejin on 2023/01/02. | ||
// | ||
|
||
import UIKit | ||
|
||
import NMapsMap | ||
import SnapKit | ||
import Then | ||
|
||
final class RNStartMarker: NMFMarker { | ||
|
||
// MARK: - UI & Layout | ||
|
||
let startInfoWindow = NMFInfoWindow() | ||
|
||
// MARK: - initialization | ||
|
||
override init() { | ||
super.init() | ||
setUI() | ||
setInfoWindow() | ||
} | ||
} | ||
|
||
// MARK: - UI & Layout | ||
|
||
extension RNStartMarker { | ||
private func setUI() { | ||
let image = NMFOverlayImage(image: ImageLiterals.icMapDeparture) | ||
self.iconImage = image | ||
|
||
self.width = CGFloat(NMF_MARKER_SIZE_AUTO) | ||
self.height = CGFloat(NMF_MARKER_SIZE_AUTO) | ||
|
||
self.anchor = CGPoint(x: 0.5, y: 0.5) | ||
|
||
self.iconPerspectiveEnabled = true | ||
} | ||
|
||
private func setInfoWindow() { | ||
startInfoWindow.dataSource = self | ||
} | ||
|
||
func showInfoWindow() { | ||
startInfoWindow.open(with: self) | ||
} | ||
|
||
func hideInfoWindow() { | ||
startInfoWindow.close() | ||
} | ||
} | ||
|
||
// MARK: - NMFOverlayImageDataSource | ||
|
||
extension RNStartMarker: NMFOverlayImageDataSource { | ||
func view(with overlay: NMFOverlay) -> UIView { | ||
// 마커 위에 보여줄 InfoView 이미지 리턴 | ||
let imageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 58, height: 34)) | ||
imageView.image = ImageLiterals.icMapDeparture | ||
return imageView | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
Runnect-iOS/Runnect-iOS/Global/Utils/convertLocationObject.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// convertLocationObject.swift | ||
// Runnect-iOS | ||
// | ||
// Created by sejin on 2023/01/02. | ||
// | ||
|
||
import Foundation | ||
import CoreLocation | ||
|
||
import NMapsMap | ||
|
||
extension CLLocationCoordinate2D? { | ||
func toNMGLatLng() -> NMGLatLng { | ||
return NMGLatLng(lat: self?.latitude ?? 37.52901832956373, lng: self?.longitude ?? 126.9136196847032) | ||
} | ||
} | ||
|
||
extension CLLocationCoordinate2D { | ||
func toNMGLatLng() -> NMGLatLng { | ||
return NMGLatLng(lat: self.latitude, lng: self.longitude) | ||
} | ||
} | ||
|
||
extension NMGLatLng { | ||
func toCLLocation() -> CLLocation { | ||
return CLLocation(latitude: lat, longitude: lng) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters