LocationMessageSnapshotOptions.swift 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. MIT License
  3. Copyright (c) 2017-2018 MessageKit
  4. Permission is hereby granted, free of charge, to any person obtaining a copy
  5. of this software and associated documentation files (the "Software"), to deal
  6. in the Software without restriction, including without limitation the rights
  7. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. copies of the Software, and to permit persons to whom the Software is
  9. furnished to do so, subject to the following conditions:
  10. The above copyright notice and this permission notice shall be included in all
  11. copies or substantial portions of the Software.
  12. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  17. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  18. SOFTWARE.
  19. */
  20. import MapKit
  21. /// An object grouping the settings used by the `MKMapSnapshotter` through the `LocationMessageDisplayDelegate`.
  22. public struct LocationMessageSnapshotOptions {
  23. /// Initialize LocationMessageSnapshotOptions with given parameters
  24. ///
  25. /// - Parameters:
  26. /// - showsBuildings: A Boolean value indicating whether the snapshot image should display buildings.
  27. /// - showsPointsOfInterest: A Boolean value indicating whether the snapshot image should display points of interest.
  28. /// - span: The span of the snapshot.
  29. /// - scale: The scale of the snapshot.
  30. public init(showsBuildings: Bool = false, showsPointsOfInterest: Bool = false, span: MKCoordinateSpan = MKCoordinateSpan(latitudeDelta: 0, longitudeDelta: 0), scale: CGFloat = UIScreen.main.scale) {
  31. self.showsBuildings = showsBuildings
  32. self.showsPointsOfInterest = showsPointsOfInterest
  33. self.span = span
  34. self.scale = scale
  35. }
  36. /// A Boolean value indicating whether the snapshot image should display buildings.
  37. ///
  38. /// The default value of this property is `false`.
  39. public var showsBuildings: Bool
  40. /// A Boolean value indicating whether the snapshot image should display points of interest.
  41. ///
  42. /// The default value of this property is `false`.
  43. public var showsPointsOfInterest: Bool
  44. /// The span of the snapshot.
  45. ///
  46. /// The default value of this property uses a width of `0` and height of `0`.
  47. public var span: MKCoordinateSpan
  48. /// The scale of the snapshot.
  49. ///
  50. /// The default value of this property uses the `UIScreen.main.scale`.
  51. public var scale: CGFloat
  52. }