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

Adds MSL Altitude Support #1029

Closed
wants to merge 5 commits into from

Conversation

Wackymax
Copy link
Contributor

✨ What kind of change does this PR introduce? (Bug fix, feature, docs update...)

Feature: Adds NMEA message support to position updates
Feature: Adds MSL altitude support

⤵️ What is the current behavior?

Altitude is reported as height above the ellipsoid but iOS reports altitude as height above the geoid. It's also not possible to get NMEA messages in the current version.

🆕 What is the new behavior (if this is a feature change)?

  • Adds a new NMEA message listener in Android
  • Adds 2 settings to the AndroidSettings file to allow the user to request NMEA messages and to request that altitude is reported as MSL
  • Adds the NMEA message as a property on the location model.

💥 Does this PR introduce a breaking change?

No

🐛 Recommendations for testing

  1. Test without NMEA messages
  2. Test with NMEA messages enabled
  3. Test with MSL altitude.

📝 Links to relevant issues/docs

Coses #561, closes #605, closes #819, closes #932

Should help with: #987

🤔 Checklist before submitting

  • I made sure all projects build.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy.
  • I updated CHANGELOG.md to add a description of the change.
  • I followed the style guide lines (code style guide).
  • I updated the relevant documentation.
  • I rebased onto current master.

@Wackymax
Copy link
Contributor Author

@mvanbeusekom please let me know if you are happy with this solution. It should have a smaller impact on all the other platforms compared to the current PR's that are up for NMEA.

@codecov
Copy link

codecov bot commented Apr 11, 2022

Codecov Report

Merging #1029 (0663c6b) into master (32068b2) will not change coverage.
The diff coverage is 100.00%.

❗ Current head 0663c6b differs from pull request most recent head 8cb59d7. Consider uploading reports for the commit 8cb59d7 to get more accurate results

@@            Coverage Diff             @@
##            master     #1029    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files            1        17    +16     
  Lines           30       245   +215     
==========================================
+ Hits            30       245   +215     
Impacted Files Coverage Δ
...or_platform_interface/lib/src/models/position.dart 100.00% <100.00%> (ø)
geolocator/lib/geolocator.dart
...src/implementations/method_channel_geolocator.dart 100.00% <0.00%> (ø)
...m_interface/lib/src/enums/location_permission.dart 100.00% <0.00%> (ø)
...terface/lib/src/geolocator_platform_interface.dart 100.00% <0.00%> (ø)
...rm_interface/lib/src/models/location_settings.dart 100.00% <0.00%> (ø)
...rs/permission_definitions_not_found_exception.dart 100.00% <0.00%> (ø)
...ace/lib/src/errors/activity_missing_exception.dart 100.00% <0.00%> (ø)
...form_interface/lib/src/enums/location_service.dart 100.00% <0.00%> (ø)
...e/lib/src/errors/invalid_permission_exception.dart 100.00% <0.00%> (ø)
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3f84fc7...8cb59d7. Read the comment docs.

@mvanbeusekom
Copy link
Member

Hi @Wackymax,

Thank you for the PR and taking an interest.

The impact is indeed a lot smaller compared to the other implementations. However it will still expose a field in the Position class that is only used on Android.

Wouldn't it be better if we could add a separate Dart class (e.g. NmeaClient to the geolocator_android package and expose that to people would like to make use of it? The additional benefit would be that developers can listen to the position stream and NMEA streams separately.

This is also more in line with the plans Google has for their plugins. I started updating the platform specific implementations inline with issue flutter/flutter#94224. Since I have some time available I can pick this up and see if I can get this implemented today and tomorrow.

Please let me know how you feel?

@Wackymax
Copy link
Contributor Author

Sounds good. If you want to have a separate stream then #932 is probably a good candidate for you to work from. I think having the option of reporting altitude as MSL is still a good candidate case for this PR. What are your thoughts on keeping that in?

@Wackymax
Copy link
Contributor Author

@mvanbeusekom I've rebased on the latest master containing your changes. I've split things up a bit as well, still have the MSL option for altitude in Android settings and I've created a separate channel for NMEA messages but I am not sure how to go about using it with the approach you want to take. Do you want to take it from here?

@mvanbeusekom
Copy link
Member

@Wackymax, thanks. In general my idea would be to apply a similar architecture as done with the recent refactor for webview_flutter (see also issue flutter/flutter#93732). Where the idea is to duplicate the platform specific location API on the Dart side and create an additional cross-platform implementation that uses this API to implement the geolocator_platform_interface.

This should enable users of the plugin to choose between using the cross-platform API (easy to use but limited) versus using the platform specific API (which is more work but removes the limitations).

I understand if this is all a bit too much and I can definitely take over from here if you prefer.

@Wackymax
Copy link
Contributor Author

Closing this to bring in this changes with a new PR

@Wackymax Wackymax closed this May 10, 2022
@Wackymax
Copy link
Contributor Author

Wackymax commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants