I am developing an application with Qt + QGIS. It will have a map component to be rendered by QGIS. The map needs to contain a base layer with Google Maps tiles and additional layers with data loaded from local files.

Is this possible with Qt + QGIS?

As far as I understand, displaying Google Maps data requires using the Google Maps JavaScript API. In Qt, one can have a browser component, where the map can be displayed. I'm not sure if this is a good approach, specifically because of projections problems and lack on synchronization with map layer and the other layers. See also this question: Overlaying Google Map in standalone PyQgis application?

I couldn't find clear answers in the extensive searches I have done.

  • There are at least two QGIS plugins that cover this issue. Have you looked at them? – underdark Nov 28 '17 at 17:14
  • Yes, I have. But as far as I understand, those are for the QGIS application, and not for to be used in standalone applications, like this one. – jmc Nov 28 '17 at 20:35
  • You can use QgsXyzTileDataItemProvider class github.com/qgis/QGIS/blob/… – Dmitry Baryshnikov Nov 29 '17 at 7:52
  • Thanks to pointing this, @DmitryBaryshnikov. As I have read somewhere else, the QGIS application code is a good tutorial - but I wouldn't know where to look at. – jmc Nov 29 '17 at 13:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.