Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update SearchExample attribution and logo placement #170

Merged
merged 2 commits into from
Feb 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Examples/SearchExamples/SimpleUISearchViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,25 @@ class SimpleUISearchViewController: MapsViewController {
let cameraOptions = CameraOptions(center: .sanFrancisco, zoom: 15)
mapView.camera.fly(to: cameraOptions, duration: 1, completion: nil)

let horizontalMargin: CGFloat = 4
mapView.ornaments.options.logo = LogoViewOptions(
position: .topLeading,
margins: CGPoint(x: horizontalMargin, y: 0)
)

mapView.ornaments.options.attributionButton = AttributionButtonOptions(
position: .topLeading,
margins: CGPoint(x: 0, y: 4)
)

let scalarX = mapView.ornaments.logoView.bounds.maxX + 12
mapView.ornaments.options.scaleBar = ScaleBarViewOptions(
position: .topLeading,
margins: CGPoint(x: scalarX, y: 0),
visibility: .visible,
useMetricUnits: false
)
Comment on lines +33 to +39
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can just hide scale bar, not like it's important to the sample

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it is not essential although I would like to leave it because the margin behavior is not entirely obvious so this helps demonstrate what is possible.


searchController.delegate = self
addChild(panelController)
}
Expand Down
Loading