Skip to content

Commit

Permalink
Minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Pantelis Giazitsis committed Feb 7, 2024
1 parent 6258bf8 commit d12388b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
10 changes: 5 additions & 5 deletions PresentationLayer/UI Components/MapBox/MapBoxMapView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,11 @@ extension MapBoxMapView {

class MapViewController: UIViewController {
private static let SNAP_ANIMATION_DURATION: CGFloat = 1.4
private static let wxm_lat = 37.98075475244475
private static let wxm_lon = 23.710478235562956
private var cancelablesSet = Set<AnyCancelable>()

internal var mapView: MapView!
internal var layer = HeatmapLayer(id: "wtxm-heatmap-layer", source: "heatmap")
internal var layer = HeatmapLayer(id: MapBoxConstants.heatmapLayerId,
source: MapBoxConstants.heatmapSource)
internal weak var polygonManager: PolygonAnnotationManager?

weak var delegate: MapViewControllerDelegate?
Expand Down Expand Up @@ -203,13 +202,14 @@ class MapViewController: UIViewController {
}

internal func configurePolygonLayer(polygonAnnotations: [PolygonAnnotation]) {
let polygonAnnotationManager = self.polygonManager ?? mapView.annotations.makePolygonAnnotationManager(id: "wtxm-polygon-annotation-manager")
let polygonAnnotationManager = self.polygonManager ?? mapView.annotations.makePolygonAnnotationManager(id: MapBoxConstants.polygonManagerId)
polygonAnnotationManager.annotations = polygonAnnotations
polygonManager = polygonAnnotationManager
}

internal func cameraSetup() {
let centerCoordinate = CLLocationCoordinate2D(latitude: Self.wxm_lat, longitude: Self.wxm_lon)
let centerCoordinate = CLLocationCoordinate2D(latitude: MapBoxConstants.initialLat,
longitude: MapBoxConstants.initialLon)
let camera = CameraOptions(center: centerCoordinate, zoom: 1)
mapView.mapboxMap.setCamera(to: camera)
}
Expand Down
5 changes: 5 additions & 0 deletions PresentationLayer/Utils/MapBox/MapBoxConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,9 @@ enum MapBoxConstants {
static let snapshotSize: CGSize = CGSize(width: 340.0, height: 200.0)
static let snapshotZoom: CGFloat = 11.0
static let snapshotMarkerName = "marker"
static let polygonManagerId = "wtxm-polygon-annotation-manager"
static let initialLat = 37.98075475244475
static let initialLon = 23.710478235562956
static let heatmapLayerId = "wtxm-heatmap-layer"
static let heatmapSource = "heatmap"
}

0 comments on commit d12388b

Please sign in to comment.