Skip to content

Commit

Permalink
Merge pull request #244 from L-j-h-c/feature/#239
Browse files Browse the repository at this point in the history
[Feat] #239 - 지도 핀 아래 캡션 텍스트 추가 및 스크랩 버튼 터치영역 수정
  • Loading branch information
L-j-h-c authored Sep 6, 2022
2 parents 9a56261 + d2b7d54 commit 125e357
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 10 deletions.
2 changes: 1 addition & 1 deletion HealthFoodMe/HealthFoodMe.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@
EB6A44D028737CC400749582 /* MainDetailEntity.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainDetailEntity.swift; sourceTree = "<group>"; };
EB6A44E82873BED500749582 /* MainMapUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainMapUseCase.swift; sourceTree = "<group>"; };
EB6A44E92873BED500749582 /* MainMapRepository.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainMapRepository.swift; sourceTree = "<group>"; };
EB6A44EA2873BED500749582 /* MainMapModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainMapModel.swift; sourceTree = "<group>"; };
EB6A44EA2873BED500749582 /* MainMapModel.swift */ = {isa = PBXFileReference; indentWidth = 2; lastKnownFileType = sourcecode.swift; path = MainMapModel.swift; sourceTree = "<group>"; };
EB6A44EB2873BED500749582 /* MainMapVC.swift */ = {isa = PBXFileReference; indentWidth = 4; lastKnownFileType = sourcecode.swift; path = MainMapVC.swift; sourceTree = "<group>"; tabWidth = 4; };
EB6A44EC2873BED500749582 /* MainMapViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainMapViewModel.swift; sourceTree = "<group>"; };
EB6A44ED2873BED500749582 /* MainMapEntity.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainMapEntity.swift; sourceTree = "<group>"; };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ struct MainMapEntity: Codable {
} else {
pointerType = .normalFood
}
return MapPointDataModel.init(latitude: latitude, longtitude: longitude, type: pointerType)
return MapPointDataModel.init(latitude: latitude, longtitude: longitude, restaurantName: nil, type: pointerType)
}

func toDomainWithCaption() -> MapPointDataModel {
var pointerType: PointerType
if isDietRestaurant {
pointerType = .healthFood
} else {
pointerType = .normalFood
}
return MapPointDataModel.init(latitude: latitude, longtitude: longitude, restaurantName: name, type: pointerType)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct ScrapListEntity: Codable {
let latitude, longtitude: Double

func toDomain() -> MapPointDataModel {
let model = MapPointDataModel.init(latitude: latitude, longtitude: longtitude, type: .healthFood)
let model = MapPointDataModel.init(latitude: latitude, longtitude: longtitude, restaurantName: name, type: .healthFood)
return model
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import UIKit
struct MapPointDataModel {
let latitude: Double
let longtitude: Double
let restaurantName: String?
let type: PointerType
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ extension MainMapVC {
var models = [MapPointDataModel]()

models = data.map({ entity in
entity.toDomain()
entity.toDomainWithCaption()
})
if self.scrapButton.isSelected {
self.mapView.scrapButtonSelected.accept(self.currentScrapList)
Expand Down Expand Up @@ -708,7 +708,7 @@ extension MainMapVC {
self.restaurantData = data
var models = [MapPointDataModel]()
models = data.map({ entity in
entity.toDomain()
entity.toDomainWithCaption()
})
if self.scrapButton.isSelected {
var filterList: [ScrapListEntity] = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ extension MapDetailSummaryView {
}

scrapButton.snp.makeConstraints { make in
make.top.equalToSuperview().inset(35)
make.trailing.equalToSuperview().inset(20)
make.width.height.equalTo(24)
make.top.equalToSuperview().inset(23)
make.trailing.equalToSuperview().inset(8)
make.width.height.equalTo(48)
}

titleTagStackView.addArrangedSubviews(restaurantNameLabel, starRateStackView, tagCollectionView)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ extension NaverMapContainerView {

private func setPointMarkers(_ points: [MapPointDataModel]) {
DispatchQueue.global(qos: .default).async {
for point in points {
for (index, point) in points.enumerated() {
let marker = NMFMarker()
marker.position = NMGLatLng.init(lat: point.latitude, lng: point.longtitude)
switch point.type {
Expand Down Expand Up @@ -232,6 +232,15 @@ extension NaverMapContainerView {
return true
}
}
if let caption = point.restaurantName {
marker.captionText = caption
marker.captionTextSize = 14
marker.captionMinZoom = 12
marker.captionColor = .helfmeBlack
}
marker.isHideCollidedMarkers = false
marker.isHideCollidedCaptions = true
marker.isHideCollidedSymbols = true
self.markers.append(marker)
}
DispatchQueue.main.async { [weak self] in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ extension ScrapVC: UICollectionViewDelegate {
pointList.append(entity.toDomain())
}
let initialPoint = scrapList[indexPath.row]
vc.initialPoint = MapPointDataModel.init(latitude: initialPoint.latitude, longtitude: initialPoint.longtitude, type: .normalFood)
vc.initialPoint = MapPointDataModel.init(latitude: initialPoint.latitude, longtitude: initialPoint.longtitude, restaurantName: nil, type: .normalFood)
vc.targetMarkerPointList = pointList
self.navigationController?.pushViewController(vc, animated: true)
}
Expand Down

0 comments on commit 125e357

Please sign in to comment.