Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Poppool/Poppool.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,8 @@
4EAB809D2D3F78AA0041AF30 /* GMSMapViewDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EAB809C2D3F78AA0041AF30 /* GMSMapViewDelegateProxy.swift */; };
4EAB809F2D3F8EF50041AF30 /* ViewportBounds.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EAB809E2D3F8EF50041AF30 /* ViewportBounds.swift */; };
4EDDEFB42D2D285900CFAFA5 /* DateTimePickerManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EDDEFB32D2D285900CFAFA5 /* DateTimePickerManager.swift */; };
4EDE57012D5E6A5F0014D924 /* MapViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E685ECC2D12CEB6001EF91C /* MapViewController.swift */; };
4EDE57032D5E70650014D924 /* LocationPermissionBottomSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EDE57022D5E70650014D924 /* LocationPermissionBottomSheet.swift */; };
4EE5A3D32D40E4A600A2469A /* MapGuideReactor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EE5A3D22D40E4A600A2469A /* MapGuideReactor.swift */; };
4EEA1D8F2D352012003E7DE9 /* ImageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EEA1D8E2D352012003E7DE9 /* ImageCell.swift */; };
4EEA1D912D352027003E7DE9 /* ExtendedImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EEA1D902D352027003E7DE9 /* ExtendedImage.swift */; };
Expand Down Expand Up @@ -915,6 +917,7 @@
4EAB809C2D3F78AA0041AF30 /* GMSMapViewDelegateProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GMSMapViewDelegateProxy.swift; sourceTree = "<group>"; };
4EAB809E2D3F8EF50041AF30 /* ViewportBounds.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewportBounds.swift; sourceTree = "<group>"; };
4EDDEFB32D2D285900CFAFA5 /* DateTimePickerManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateTimePickerManager.swift; sourceTree = "<group>"; };
4EDE57022D5E70650014D924 /* LocationPermissionBottomSheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationPermissionBottomSheet.swift; sourceTree = "<group>"; };
4EE5A3D22D40E4A600A2469A /* MapGuideReactor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapGuideReactor.swift; sourceTree = "<group>"; };
4EEA1D8E2D352012003E7DE9 /* ImageCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageCell.swift; sourceTree = "<group>"; };
4EEA1D902D352027003E7DE9 /* ExtendedImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtendedImage.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2866,6 +2869,7 @@
4EAB809C2D3F78AA0041AF30 /* GMSMapViewDelegateProxy.swift */,
4EAB809E2D3F8EF50041AF30 /* ViewportBounds.swift */,
4EED9BAB2D22730400B288E7 /* FilterType.swift */,
4EDE57022D5E70650014D924 /* LocationPermissionBottomSheet.swift */,
);
path = Common;
sourceTree = "<group>";
Expand Down Expand Up @@ -3348,6 +3352,7 @@
081898CE2D30D5C60067BF01 /* InfoEditModalReactor.swift in Sources */,
083C865D2D0DEFD5003F441C /* CommentCheckReactor.swift in Sources */,
BD9103632CF6149D00BBCCAE /* BannerPopUpStoreDTO.swift in Sources */,
4EDE57032D5E70650014D924 /* LocationPermissionBottomSheet.swift in Sources */,
081898D62D30F58A0067BF01 /* CategoryEditModalReactor.swift in Sources */,
081898B32D2D20D70067BF01 /* WithdrawlCompleteView.swift in Sources */,
086DD92A2D0086AA00B97D3B /* SearchController.swift in Sources */,
Expand Down Expand Up @@ -3654,6 +3659,7 @@
buildActionMask = 2147483647;
files = (
BDCA41D82CF35AC1005EECF6 /* PoppoolTests.swift in Sources */,
4EDE57012D5E6A5F0014D924 /* MapViewController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
2 changes: 1 addition & 1 deletion Poppool/Poppool/Presentation/Map/ClusteringManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class ClusteringManager {
}
else {
// 그 외는 아직 미구현 or 무시
Logger.log(message: "🔹 기타 지역(도/광역시) - 주소: \(store.address)", category: .debug)
// Logger.log(message: "🔹 기타 지역(도/광역시) - 주소: \(store.address)", category: .debug)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
import UIKit
import SnapKit

final class LocationPermissionBottomSheet: UIViewController {

var onDismiss: (() -> Void)?
var onGoToSettings: (() -> Void)?

// 제목 라벨
private let titleLabel: UILabel = {
let label = UILabel()
label.text = "내 위치를 중심으로\n보기 위한 준비가 필요해요"
label.font = UIFont.KorFont(style: .bold, size: 18)
label.textColor = .g1000
label.numberOfLines = 2
label.textAlignment = .center
return label
}()

// 설명 라벨
private let descriptionLabel: UILabel = {
let label = UILabel()
label.text = "설정 > 위치 권한을 허용하신 후에\n내 주변의 다양한 팝업스토어를 볼 수 있어요."
label.font = UIFont.KorFont(style: .regular, size: 14)
label.textColor = .g600
label.numberOfLines = 2
label.textAlignment = .center
return label
}()

// 취소 버튼
private let cancelButton: UIButton = {
let button = UIButton()
button.setTitle("취소", for: .normal)
button.setTitleColor(.g600, for: .normal)
button.titleLabel?.font = UIFont.KorFont(style: .medium, size: 16)
button.backgroundColor = .g50
button.layer.cornerRadius = 10
return button
}()

// 권한 설정 버튼
private let settingsButton: UIButton = {
let button = UIButton()
button.setTitle("권한설정", for: .normal)
button.setTitleColor(.white, for: .normal)
button.titleLabel?.font = UIFont.KorFont(style: .medium, size: 16)
button.backgroundColor = .blu500
button.layer.cornerRadius = 10
return button
}()

override func viewDidLoad() {
super.viewDidLoad()
setupView()
setupActions()
}

private func setupView() {
view.backgroundColor = .white
view.layer.cornerRadius = 20

let buttonStackView = UIStackView(arrangedSubviews: [cancelButton, settingsButton])
buttonStackView.axis = .horizontal
buttonStackView.spacing = 12
buttonStackView.distribution = .fillEqually

view.addSubview(titleLabel)
view.addSubview(descriptionLabel)
view.addSubview(buttonStackView)

titleLabel.snp.makeConstraints { make in
make.top.equalToSuperview().offset(20)
make.leading.trailing.equalToSuperview().inset(20)
}

descriptionLabel.snp.makeConstraints { make in
make.top.equalTo(titleLabel.snp.bottom).offset(10)
make.leading.trailing.equalToSuperview().inset(20)
}

buttonStackView.snp.makeConstraints { make in
make.top.equalTo(descriptionLabel.snp.bottom).offset(20)
make.leading.trailing.equalToSuperview().inset(20)
make.height.equalTo(48)
make.bottom.equalToSuperview().offset(-20)
}
}

private func setupActions() {
cancelButton.addTarget(self, action: #selector(didTapCancel), for: .touchUpInside)
settingsButton.addTarget(self, action: #selector(didTapSettings), for: .touchUpInside)
}

@objc private func didTapCancel() {
dismiss(animated: true, completion: onDismiss)
}

@objc private func didTapSettings() {
guard let settingsURL = URL(string: UIApplication.openSettingsURLString) else { return }
if UIApplication.shared.canOpenURL(settingsURL) {
UIApplication.shared.open(settingsURL)
}
dismiss(animated: true, completion: onGoToSettings)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,94 +7,112 @@ import GoogleMaps

final class FullScreenMapViewController: MapViewController {

override func viewDidLoad() {
super.viewDidLoad()
override func viewDidLoad() {
super.viewDidLoad()

self.navigationController?.navigationBar.isHidden = false
setupNavigation()
self.navigationController?.navigationBar.isHidden = false
setupNavigation()

mainView.searchFilterContainer.isHidden = true
mainView.filterChips.isHidden = true
mainView.listButton.isHidden = true
carouselView.isHidden = false
}
mainView.searchFilterContainer.isHidden = true
mainView.filterChips.isHidden = true
mainView.listButton.isHidden = true
carouselView.isHidden = false

override func bind(reactor: Reactor) {
super.bind(reactor: reactor)
// 지도 델리게이트 재설정
mainView.mapView.delegate = self
}

// override func bindViewport(reactor: MapReactor) {
// // 뷰포트 바인딩 무시
// }

override func bind(reactor: Reactor) {
reactor.state
.map { $0.searchResult }
.distinctUntilChanged()
.compactMap { $0 }
.map { store -> (store: MapPopUpStore, coordinate: CLLocationCoordinate2D) in
return (
store: store,
coordinate: CLLocationCoordinate2D(latitude: store.latitude, longitude: store.longitude)
)
}
.observe(on: MainScheduler.instance)
.bind { [weak self] data in
.bind { [weak self] store in
guard let self = self else { return }

// 기존 상태 초기화
self.mainView.mapView.clear()
self.currentMarker?.map = nil
self.currentMarker = nil

// 마커 설정
let marker = GMSMarker()
marker.position = data.coordinate
marker.userData = data.store
marker.position = store.coordinate
marker.userData = store
marker.groundAnchor = CGPoint(x: 0.5, y: 1.0)

let markerView = MapMarker()
// store.mainImageUrl이 있다면 여기서 setPPImage를 사용하여 처리
markerView.injection(with: .init(isSelected: true))
marker.iconView = markerView
marker.map = self.mainView.mapView
self.currentMarker = marker

// 카메라 이동
let camera = GMSCameraPosition.camera(
withLatitude: data.coordinate.latitude,
longitude: data.coordinate.longitude,
withLatitude: store.latitude,
longitude: store.longitude,
zoom: 16
)
self.mainView.mapView.animate(to: camera)

// 캐러셀뷰 바로 업데이트
self.carouselView.updateCards([data.store])
self.currentCarouselStores = [data.store]
// 캐러셀 업데이트 - setPPImage 사용
self.carouselView.updateCards([store])
self.currentCarouselStores = [store]
self.carouselView.isHidden = false
}
.disposed(by: disposeBag)
}


override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.navigationController?.navigationBar.isHidden = false
}

private func setupNavigation() {
navigationItem.title = "찾아가는 길"

let appearance = UINavigationBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.shadowColor = .clear
appearance.backgroundColor = .white
appearance.titleTextAttributes = [
.foregroundColor: UIColor.black,
.font: UIFont.systemFont(ofSize: 15, weight: .regular)
]

navigationController?.navigationBar.standardAppearance = appearance
navigationController?.navigationBar.scrollEdgeAppearance = appearance

navigationItem.leftBarButtonItem = UIBarButtonItem(
image: UIImage(named: "bakcbutton")?.withRenderingMode(.alwaysOriginal),
style: .plain,
target: self,
action: #selector(backButtonTapped)
)
navigationItem.leftBarButtonItem?.imageInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
}

@objc private func backButtonTapped() {
dismiss(animated: true)
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.navigationController?.navigationBar.isHidden = false
}

// GMSMapViewDelegate 메서드들 override
override func mapView(_ mapView: GMSMapView, didTap marker: GMSMarker) -> Bool {
return true // 마커 탭 이벤트 중단
}

override func mapView(_ mapView: GMSMapView, didChange position: GMSCameraPosition) {
// 뷰포트 변경 이벤트 중단
}

override func mapView(_ mapView: GMSMapView, didTapAt coordinate: CLLocationCoordinate2D) {
// 지도 탭 이벤트 중단
}

private func setupNavigation() {
navigationItem.title = "찾아가는 길"

let appearance = UINavigationBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.shadowColor = .clear
appearance.backgroundColor = .white
appearance.titleTextAttributes = [
.foregroundColor: UIColor.black,
.font: UIFont.systemFont(ofSize: 15, weight: .regular)
]

navigationController?.navigationBar.standardAppearance = appearance
navigationController?.navigationBar.scrollEdgeAppearance = appearance

navigationItem.leftBarButtonItem = UIBarButtonItem(
image: UIImage(named: "bakcbutton")?.withRenderingMode(.alwaysOriginal),
style: .plain,
target: self,
action: #selector(backButtonTapped)
)
navigationItem.leftBarButtonItem?.imageInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
}

@objc private func backButtonTapped() {
dismiss(animated: true)
}
}
Loading