Skip to content

Commit

Permalink
Corrected wierd comments on line breaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Archdoog committed Mar 2, 2024
1 parent cb133d9 commit 3b2dce1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
9 changes: 3 additions & 6 deletions Sources/MapLibreSwiftUI/Examples/Other.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,14 @@ import SwiftUI
}

// Demonstrates how to use the unsafeMapModifier to set MLNMapView properties that have not been exposed as
// modifiers
// yet.
// modifiers yet.
SymbolStyleLayer(identifier: "simple-symbols", source: pointSource)
.iconImage(constant: UIImage(systemName: "mappin")!)
}
.unsafeMapViewModifier { mapView in
// Not all properties have modifiers yet. Until they do, you can use this 'escape hatch' to the underlying
// MLNMapView.
// Be careful: if you modify properties that the DSL controls already, they may be overridden. This modifier is
// a
// "hack", not a final function.
// MLNMapView. Be careful: if you modify properties that the DSL controls already, they may be overridden. This
// modifier is a "hack", not a final function.
mapView.logoView.isHidden = false
mapView.compassViewPosition = .topLeft
}
Expand Down
9 changes: 3 additions & 6 deletions Sources/MapLibreSwiftUI/MapViewCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -191,18 +191,15 @@ extension MapViewCoordinator: MLNMapViewDelegate {
.userTrackingMode == .followWithCourse

// If any of these are a mismatch, we know the camera is no longer following a desired method, so we should
// detach and
// revert
// to a .centered camera.
// If any one of these is true, the desired camera state still matches the mapView's userTrackingMode
// detach and revert to a .centered camera. If any one of these is true, the desired camera state still matches
// the mapView's userTrackingMode
if isFollowing || isFollowingHeading || isFollowingCourse {
// User tracking is still active, we can ignore camera updates until we unset/fail this boolean check
return
}

// The user's desired camera is not a user tracking method, now we need to publish the MLNMapView's camera state
// to the
// MapView camera binding.
// to the MapView camera binding.
parent.camera = .center(mapView.centerCoordinate,
zoom: mapView.zoomLevel,
reason: CameraChangeReason(reason))
Expand Down

0 comments on commit 3b2dce1

Please sign in to comment.