Skip to content

Commit

Permalink
Merge pull request #320 from L-j-h-c/feature/#317
Browse files Browse the repository at this point in the history
[Fix] #317 - 축척 변경 및 메뉴 데이터 오류 수정
  • Loading branch information
L-j-h-c committed Oct 6, 2022
2 parents 236ed38 + 4f8dc42 commit bd9643f
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 22 deletions.
4 changes: 2 additions & 2 deletions HealthFoodMe/HealthFoodMe.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2565,7 +2565,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 202209241;
CURRENT_PROJECT_VERSION = 202210071;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = FY8N9XTH66;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = FY8N9XTH66;
Expand Down Expand Up @@ -2609,7 +2609,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 202209241;
CURRENT_PROJECT_VERSION = 202210071;
DEVELOPMENT_TEAM = FY8N9XTH66;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = FY8N9XTH66;
GENERATE_INFOPLIST_FILE = YES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ struct MapLiterals {
extension MapLiterals {
struct Location {
static let gangnamStation: NMGLatLng = NMGLatLng(lat: 37.497952, lng: 127.027619)
static let eonjuStation: NMGLatLng = NMGLatLng(lat: 37.5073, lng: 127.0339)
}

struct ZoomScale {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ extension MenuCellCVC {
menuView.pickImageView.image = menuData.isPick ? UIImage(named: "icn_pick") : .none

menuView.priceLabel.text = "\(menuData.menuPrice)"
if menuData.menuKcal == 0 {
if menuData.menuKcal == -1 {
menuView.kcalView.isHidden = true
} else {
menuView.kcalView.isHidden = false
guard let menuKcal = menuData.menuKcal else { return }
let intKcal = Int(menuKcal)
menuView.kcalLabel.text = "\(intKcal)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,18 @@ extension MenuTabVC {
var notPickModel: [MenuDataModel] = []

models.forEach { data in
if data.isPick {
if data.isPick && data.menuKcal != -1 {
pickModel.append(data)
} else {
} else if data.isPick {
pickModel.insert(data, at: 0)
} else if data.menuKcal != -1 {
notPickModel.append(data)
} else {
notPickModel.insert(data, at: 0)
}
}
pickModel += notPickModel
pickModel = pickModel.reversed()
pickModel += notPickModel.reversed()

self.menuData = pickModel
self.menuBoard = restaurantMenuBoard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,14 +425,18 @@ extension MainMapVC {
private func setIntitialMapPoint() {
if !initialMapOpened {
initialMapOpened = true
let NMGPosition = self.locationManager?.currentLatLng()
if NMGPosition != nil {
self.mapView.moveCameraPositionWithZoom(MapLiterals.Location.gangnamStation, Int(MapLiterals.ZoomScale.KM1_5))
}
self.setInitialMapPointAfterAuth()
isInitialPoint = true
}
}

private func setInitialMapPointAfterAuth() {
let NMGPosition = self.locationManager?.currentLatLng()
if NMGPosition != nil {
self.mapView.moveCameraPositionWithZoom(MapLiterals.Location.eonjuStation, Int(MapLiterals.ZoomScale.KM1))
}
}

private func setMapView() {
locationManager?.add(self)
}
Expand Down Expand Up @@ -849,13 +853,15 @@ extension MainMapVC: CLLocationManagerDelegate {
self.mapView.naverMapView.mapView.positionMode = .normal
self.canUseLocation = true
self.fetchRestaurantList(zoom: MapLiterals.ZoomScale.Maximum)
self.setInitialMapPointAfterAuth()
}
case .authorizedWhenInUse:
locationManager.startUpdatingLocation()
DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
self.mapView.naverMapView.mapView.positionMode = .normal
self.canUseLocation = true
self.fetchRestaurantList(zoom: MapLiterals.ZoomScale.Maximum)
self.setInitialMapPointAfterAuth()
}
@unknown default:
break
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ extension NaverMapContainerView {
naverMapView = NMFNaverMapView(frame: self.frame)
naverMapView.mapView.positionMode = .direction
naverMapView.mapView.locationOverlay.hidden = true
naverMapView.mapView.moveCamera(NMFCameraUpdate(position: NMFCameraPosition(MapLiterals.Location.gangnamStation, zoom: 10.5)))
naverMapView.mapView.moveCamera(NMFCameraUpdate(position: NMFCameraPosition(MapLiterals.Location.eonjuStation, zoom: 10.5)))
naverMapView.showZoomControls = false
addSubview(naverMapView)

Expand Down Expand Up @@ -236,11 +236,12 @@ extension NaverMapContainerView {
marker.captionText = caption
marker.captionHaloColor = .helfmeWhite
marker.isForceShowCaption = false
marker.isForceShowIcon = false
marker.captionTextSize = 12
marker.captionMinZoom = 12
marker.captionColor = .helfmeBlack
}
marker.isHideCollidedMarkers = false
marker.isHideCollidedMarkers = true
marker.isHideCollidedCaptions = true
marker.isHideCollidedSymbols = true
self.markers.append(marker)
Expand All @@ -263,6 +264,7 @@ extension NaverMapContainerView {
if let seletedMark = self.selectedMarker,
let type = selectedMarkerType?.type {
seletedMark.isForceShowCaption = false
seletedMark.isForceShowIcon = false
seletedMark.zIndex = 0
switch type {
case .healthFood:
Expand All @@ -280,6 +282,7 @@ extension NaverMapContainerView {
self.selectedMarker = marker
self.selectedMarker?.zIndex = 100
self.selectedMarker?.isForceShowCaption = true
self.selectedMarker?.isForceShowIcon = true
self.selectedMarkerType = selectedPoint
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ extension SupplementMapVC {
if let id = initialId {
self.setInitialPointForSearchVC(id: id, needShowSummary: needShowSummary)
} else {
self.mapView.moveCameraPositionWithZoom(MapLiterals.Location.gangnamStation, 200)
self.mapView.moveCameraPositionWithZoom(MapLiterals.Location.eonjuStation, 200)
}
case .scrap:
if let initial = self.initialPoint {
Expand All @@ -175,7 +175,7 @@ extension SupplementMapVC {
}
}
} else {
self.mapView.moveCameraPositionWithZoom(MapLiterals.Location.gangnamStation, 200)
self.mapView.moveCameraPositionWithZoom(MapLiterals.Location.eonjuStation, 200)
}
}
}
Expand Down Expand Up @@ -322,7 +322,7 @@ extension SupplementMapVC {
self.currentLocation = Location(latitude: position.latitude, longitude: position.longtitude)
self.currentSelectedPosition = position
} else {
self.setCurrentPositionToGangnam()
self.setCurrentPositionToEonju()
}

if needShowSummary {
Expand Down Expand Up @@ -359,9 +359,9 @@ extension SupplementMapVC {
}
}

private func setCurrentPositionToGangnam() {
self.mapView.moveCameraPositionWithZoom(MapLiterals.Location.gangnamStation, 200)
self.currentLocation = Location(latitude: MapLiterals.Location.gangnamStation.lat, longitude: MapLiterals.Location.gangnamStation.lng)
private func setCurrentPositionToEonju() {
self.mapView.moveCameraPositionWithZoom(MapLiterals.Location.eonjuStation, 200)
self.currentLocation = Location(latitude: MapLiterals.Location.eonjuStation.lat, longitude: MapLiterals.Location.eonjuStation.lng)
}

private func bindSetSelectPointForSearchVC(dataModel: MapPointDataModel) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ extension SearchResultVC {
lng = position.lng
lat = position.lat
} else {
lng = MapLiterals.Location.gangnamStation.lng
lat = MapLiterals.Location.gangnamStation.lat
lng = MapLiterals.Location.eonjuStation.lng
lat = MapLiterals.Location.eonjuStation.lat
}
if let text = searchTextField.text {
searchContent = text
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ extension SearchVC {
lng = position.lng
lat = position.lat
} else {
lng = MapLiterals.Location.gangnamStation.lng
lat = MapLiterals.Location.gangnamStation.lat
lng = MapLiterals.Location.eonjuStation.lng
lat = MapLiterals.Location.eonjuStation.lat
}
if let text = searchTextField.text {
searchContent = text
Expand Down

0 comments on commit bd9643f

Please sign in to comment.