mapbox-navigation-ios icon indicating copy to clipboard operation
mapbox-navigation-ios copied to clipboard

Current Location Marker Moves Out of View When Hiding App Bar

Open bashcious opened this issue 1 year ago • 12 comments

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

bashcious avatar Sep 26 '24 06:09 bashcious

Hello @bashcious, thank you so much for your report. Can you please provide any binary where we can reproduce this issue?

chizhavko avatar Sep 26 '24 16:09 chizhavko

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

bashcious avatar Sep 26 '24 19:09 bashcious

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

bashcious avatar Sep 27 '24 06:09 bashcious

Any update on this or how to resolve it? we are kinda blocked. Thanks

bashcious avatar Sep 30 '24 08:09 bashcious

Hello @bashcious , thank you for your feedback. We are workin on this issues.

chizhavko avatar Sep 30 '24 09:09 chizhavko

Hello @bashcious, DynamicViewAnnotations behave differently based on property ignoreCameraPadding and your camera paddings which you can configure here.

chizhavko avatar Oct 01 '24 17:10 chizhavko

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

bashcious avatar Oct 03 '24 09:10 bashcious

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!

ivanyeoh avatar Oct 07 '24 07:10 ivanyeoh

Hello @bashcious, @ivanyeoh. You can access MapView during Active Navigation via navigationMapView property on NavigationViewController and apply the same technic discussed earlier.

chizhavko avatar Oct 07 '24 12:10 chizhavko

Hello @bashcious, @ivanyeoh. You can access MapView during Active Navigation via navigationMapView property on NavigationViewController and 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.

bashcious avatar Oct 09 '24 18:10 bashcious

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

chizhavko avatar Oct 11 '24 10:10 chizhavko

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. 

bashcious avatar Oct 17 '24 17:10 bashcious