mapbox / MapboxStatic.swift

Static map snapshots with overlays in Swift or Objective-C on iOS, macOS, tvOS, and watchOS
https://www.mapbox.com/api-documentation/?language=Swift#static
Other
188 stars 31 forks source link

.overview alternative? #123

Closed FezVrasta closed 8 months ago

FezVrasta commented 8 months ago

On Mapbox 11 (SwiftUI) I'm using .overview to fit the camera to a specific region. How can I do the same with MapboxStatic?

viewport = .overview(
  geometry: Polygon([[
    LocationCoordinate2D(latitude: minLatitude, longitude: minLongitude),
    LocationCoordinate2D(latitude: minLatitude, longitude: maxLongitude),
    LocationCoordinate2D(latitude: maxLatitude, longitude: minLongitude),
    LocationCoordinate2D(latitude: maxLatitude, longitude: maxLongitude)
  ]])
)
FezVrasta commented 8 months ago

ah nm, I just found the overlays trick of not specifying camera, I can use that