maplibre / swiftui-dsl

Making it easy to use MapLibre in SwiftUI
BSD 3-Clause "New" or "Revised" License
29 stars 9 forks source link

Pitch improvements #37

Closed hactar closed 5 months ago

hactar commented 6 months ago

The current pitch implementation manipulates pitch via minPitch and maxPitch. This has two issues:

I've split pitch into pitch and pitchRange to allow pitching and restriction separately.

Note, on initial load, functions in our DSL are being called with MLNMapView's frame being .zero. This is bad: the maplibre camera uses the frame for its calculations, for at .zero, they are wrong - there might be other stuff depending on this too. I've worked around this issue by not using the camera for the .zero case, but maybe we should investigate if we can have MLNMapView having a none .zero frame on first load - no idea if this is possible but might make these workarounds obsolete and solve potential other problems on first load.

ianthetechie commented 5 months ago

Thanks @hactar! I just need to do a bit of testing, but the code looks good + I understand and generally agree with the workarounds. Hopefully merging this soon :)

ianthetechie commented 5 months ago

Sorry I've been a bottleneck on this; I'm going to merge and can always handle any issues discovered in testing later. I know you guys are using this as well, so sorry for blocking 😅