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

Problems with Map plugin backends #46

Closed
smarttowel opened this issue Jul 17, 2019 · 8 comments
Closed

Problems with Map plugin backends #46

smarttowel opened this issue Jul 17, 2019 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@smarttowel
Copy link
Member

I want to draw QGeoPolygon with a hole inside (related to #32). I can do it in Qt 5.13 release with a mapboxgl plugin (see this)

But, for some reason, we have hardcoded plugin: Plugin { name: "itemsoverlay" } in GCS code.
If I change this line to plugin: Plugin { name: "mapboxgl" } it works fine.

@smarttowel smarttowel added the bug Something isn't working label Jul 17, 2019
@uavinda uavinda self-assigned this Jul 17, 2019
@uavinda uavinda added this to TODO in APX Ground Control via automation Jul 17, 2019
@smarttowel
Copy link
Member Author

Bump

@uavinda
Copy link
Member

uavinda commented Aug 19, 2019 via email

@uavinda
Copy link
Member

uavinda commented Aug 22, 2019

Mapbox-gl works twice slower than itemsoverlay, at least with Qt5.13 QML bindings. It also requires access token which is not free. Right now we can't port everything to mapboxgl as it would require to implement it all in JavaScript and WebView coupled to QML and facts backend. Although, this could be our future step and anyway, it should be performed in separate plugin to keep current functionality untouched.

@uavinda uavinda closed this as completed Aug 22, 2019
APX Ground Control automation moved this from TODO to Closed Aug 22, 2019
@smarttowel
Copy link
Member Author

I don't speak about porting everything to mapboxgl backend.
I mean, that we can choose mapboxgl plugin in GCS, but it's not works as expected (no holes in polygon).

Strictly speaking, MapPolygon::geoShape is not documented feature right now, because only mapboxgl support this. But! In next releases, Qt will be add this feature to other backends and we have problems with that.

@uavinda
Copy link
Member

uavinda commented Aug 22, 2019

Then its gonna work with itemsoverlay as well, isn't it?

@uavinda
Copy link
Member

uavinda commented Aug 22, 2019

The reason why the itemsoverlay is used above provider plugin is that it makes it independent from underlying backend like osm or mapbox-gl or whatever. Strictly speaking, when you add an item to mapbox-gl map, it does not draw it natively through mapbox engine, but creates wrapped QML MapItem to draw it in the GL context of mapbox-gl which is relatively slow and 'non-native' way of doing things. I've made a test - 1000 waypoints are much slower with mapbox-gl. Sure, this will be improved in future versions of Qt.

To resolve your issue - I have added ui.mapbase reference to the JS context, so that your plugin could add items to the underlying Map, or control its parameters. Just change parent to be ui.mapbase not map.

In future - this would be very attractive to implement our flight planner natively in mapbox-gl JS with backend synchronization. Such things are either hard to implement and maintain in C++. Also, porting the application to different platforms (including Web) would be much easier.

@smarttowel
Copy link
Member Author

I just replace ui.map on ui.mapbase and I see errors, that ui.mapbase is undefined.

@smarttowel smarttowel reopened this Aug 23, 2019
APX Ground Control automation moved this from Closed to High priority Aug 23, 2019
@uavinda uavinda closed this as completed Aug 26, 2019
APX Ground Control automation moved this from High priority to Closed Aug 26, 2019
@smarttowel
Copy link
Member Author

Still not working

@smarttowel smarttowel reopened this Aug 29, 2019
APX Ground Control automation moved this from Closed to High priority Aug 29, 2019
@smarttowel smarttowel assigned smarttowel and unassigned uavinda Aug 31, 2019
@uavinda uavinda closed this as completed Sep 8, 2019
APX Ground Control automation moved this from High priority to Closed Sep 8, 2019
uavinda pushed a commit to uavos/apx-gcs that referenced this issue Oct 16, 2020
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
No open projects
Development

No branches or pull requests

2 participants