Current Location Marker Moves Out of View When Hiding App Bar
Mapbox Navigation SDK version
3.3.1
Steps to reproduce
- Create an embedded view with app bar
- Display the app bar at the top of the screen.
- Tap to hide the app bar while the navigation is active.
- Observe the current position marker's behavior.
Expected behavior
The current location marker should remain visible and centered on the map when the app bar is hidden, maintaining a consistent user experience.
Actual behavior
The current location marker moves downwards and is no longer visible on the screen when the app bar is hidden.
How can I solve this issue if it's ain't a bug.
https://github.com/user-attachments/assets/802274e7-8aad-4f16-b603-9ab0f3b4703b
Is this a one-time issue or a repeatable issue?
repeatable
Hello @bashcious, thank you so much for your report. Can you please provide any binary where we can reproduce this issue?
Thank you for the response.
Do note I encountered this issue while creating a Flutter package for Mapbox Navigation. Anyway i was able to reproduce it using the example app in this repository, with a minor modification: adding a NavigationBar to the EmbeddedExampleViewController. You can find the modified example and reproduce the issue here: https://github.com/bashcious/mapbox-ios-navigation-issue-repro-4723.git
Looking forward to your feedback.
https://github.com/user-attachments/assets/a545a102-0cec-4f78-a019-782f52b025da
Btw i notice same issue occurs when we switch from landscape to portrait mode
https://github.com/user-attachments/assets/676857c5-20bd-4053-bf35-0d96ffc714b1
Any update on this or how to resolve it? we are kinda blocked. Thanks
Hello @bashcious , thank you for your feedback. We are workin on this issues.
Hello @bashcious, DynamicViewAnnotations behave differently based on property ignoreCameraPadding and your camera paddings which you can configure here.
Hello @chizhavko thanks for the response, but this doesn't resolve the issue, configuring setCamera works temporary for the mapview only, as soon as navigation starts it get's ignored and issue still persist
Hi @chizhavko, is issue being worked on? It’s a blocker for us, and any help to resolve it ASAP would be greatly appreciated. Thanks!
Hello @bashcious, @ivanyeoh. You can access MapView during Active Navigation via navigationMapView property on NavigationViewController and apply the same technic discussed earlier.
Hello @bashcious, @ivanyeoh. You can access
MapViewduring Active Navigation vianavigationMapViewproperty onNavigationViewControllerand apply the same technic discussed earlier.
@chizhavko Yeah I've already tried that approach, but it didn't resolve the issue. Could you please share a sample code that works? We're currently blocked and working under tight deadlines, so resolving this as soon as possible would be greatly appreciated.
Hello @bashcious sure. This is the repo of MapsSDK which list of examples https://github.com/mapbox/mapbox-maps-ios/tree/main/Apps/Examples Here you can find annotations example. https://github.com/mapbox/mapbox-maps-ios/blob/main/Apps/Examples/Examples/All%20Examples/Annotations/DynamicViewAnnotationExample.swift
Hey @chizhavko , Thanks. i have a solution for now but the issue seems to be Constraints related
Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
"<NSLayoutConstraint:0x302f47d90 V:|-(0)-[MBBottomBannerView:0x147822140] (active, names: '|':UIView:0x147821f80 )>",
"<NSLayoutConstraint:0x302f47e30 MBBottomBannerView:0x147822140.bottom == MapboxNavigationUIKit.BottomPaddingView:0x147822300.top (active)>",
"<NSLayoutConstraint:0x302f3c1e0 V:[UILayoutGuide:0x303656220'UIViewSafeAreaLayoutGuide']-(0)-[MapboxNavigationUIKit.BottomPaddingView:0x147822300] (active)>",
"<NSLayoutConstraint:0x302f3d860 V:|-(0)-[UIView:0x147821f80] (active, names: '|':MBBannerContainerView:0x13eef1400 )>",
"<NSLayoutConstraint:0x302f3d8b0 UIView:0x147821f80.bottom == MBBannerContainerView:0x13eef1400.bottom (active)>",
"<NSLayoutConstraint:0x302cd2a30 MBBannerContainerView:0x13eef1400.height == 80 (active)>",
"<NSLayoutConstraint:0x302c0b520 MBBottomBannerView:0x147822140.height == 60 (active)>",
"<NSLayoutConstraint:0x302f502d0 'UIViewSafeAreaLayoutGuide-bottom' V:[UILayoutGuide:0x303656220'UIViewSafeAreaLayoutGuide']-(0)-| (active, names: '|':UIView:0x147821f80 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x302c0b520 MBBottomBannerView:0x147822140.height == 60 (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.