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

Fix #437 toggling myLocationEnabled in example #457

Merged
merged 4 commits into from
Jun 25, 2024

Conversation

kuhnroyal
Copy link
Collaborator

myLocationEnabled can only be disabled for MyLocationRenderMode.normal - it is required for gps/compass. This change disables the appropriate buttons and actually passes the current render mode to the map widget.
Fixes #437

`myLocationEnabled` can only be disabled for `MyLocationRenderMode.normal` - it is required for gps/compass. This change disables the appropriate buttons and actually passes the current render mode to the map widget.
@kuhnroyal kuhnroyal added the bug Something isn't working label Jun 9, 2024
@kuhnroyal kuhnroyal requested a review from josxha June 9, 2024 22:14
@kuhnroyal kuhnroyal self-assigned this Jun 9, 2024
@kuhnroyal kuhnroyal added this to the v0.20.1 milestone Jun 9, 2024
Copy link
Collaborator

@josxha josxha left a comment

Choose a reason for hiding this comment

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

Making the buttons non-clickable is a valid workaround. However, I would prefer if we could make the parameter myLocationEnabled less dependent on another parameter. Making MyLocationRenderMode nullable or add a MyLocationRenderMode.none field could be possible solutions.

The assertion has been added in #244 so that the location permission doesn't get requested if not required (#243 (comment)).

}) : assert(
myLocationRenderMode != MyLocationRenderMode.normal
? myLocationEnabled
: true,
"$myLocationRenderMode requires [myLocationEnabled] set to true.",
),

@kuhnroyal
Copy link
Collaborator Author

Sounds good, this PR just fixes the example not working.

Copy link
Collaborator

@josxha josxha left a comment

Choose a reason for hiding this comment

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

Alright 👍

@josxha josxha enabled auto-merge (squash) June 25, 2024 10:08
@josxha josxha merged commit 5839501 into maplibre:main Jun 25, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Example: "User interface > Disable location" error
2 participants