<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hi Erik,</p>
    <p>I think maybe there's a nomenclature problem here. I wasn't aware
      that any Google services were available via WMS.</p>
    <p>WMS is a specific specification, and if you're googling around
      using that term you're going to find results that aren't pertinent
      to what you actually want to do (which is using Google's tile
      based, non-WMS services).</p>
    <p>Cheers,</p>
    <p>Jonathan<br>
    </p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 2019-04-09 08:54, Erik Polzin wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CADP_rvuAHJQFOrU7Quog1H7C2z5rMQBh49=druw6NFeRbJ02gQ@mail.gmail.com">
      <pre class="moz-quote-pre" wrap="">I'm busy developing an app using the QGIS Python api, PyQGIS, and am
noticing some strange behaviour when loading WMS tiles: Running the python
script on Linux Mint loads xyz layers from Google Maps and Google Satellite
just fine. On Windows, only the Google Maps layer loads.

Here is a test script I wrote to demonstrate the problem:

from qgis.core import QgsApplication, QgsProject, QgsRasterLayer
from qgis.gui import QgsMapCanvas, QgsLayerTreeMapCanvasBridge

from PyQt5.QtWidgets import QMainWindow
import os

GOOGLE_MAPS_SOURCE = "type=xyz&url=
<a class="moz-txt-link-freetext" href="https://mt1.google.com/vt?lyrs%3Dm%26x%3D%7Bx%7D%26y%3D%7By%7D%26z%3D%7Bz%7D&zmax=19&zmin=0">https://mt1.google.com/vt?lyrs%3Dm%26x%3D%7Bx%7D%26y%3D%7By%7D%26z%3D%7Bz%7D&zmax=19&zmin=0</a>
"
GOOGLE_SATELLITE_SOURCE = "type=xyz&url=
<a class="moz-txt-link-freetext" href="https://mt1.google.com/vt?lyrs%3Ds%26x%3D%7Bx%7D%26y%3D%7By%7D%26z%3D%7Bz%7D&zmax=19&zmin=0">https://mt1.google.com/vt?lyrs%3Ds%26x%3D%7Bx%7D%26y%3D%7By%7D%26z%3D%7Bz%7D&zmax=19&zmin=0</a>
"

class WMSTestApp(QMainWindow):

    def __init__(self):
        super().__init__()

        self.canvas = QgsMapCanvas(self)
        self.bridge =
QgsLayerTreeMapCanvasBridge(QgsProject.instance().layerTreeRoot(),
self.canvas)

        layer = QgsRasterLayer(GOOGLE_SATELLITE_SOURCE, "Test WMS Layer",
"wms")

        QgsProject.instance().addMapLayer(layer)
        self.canvas.setLayers([layer])

        self.setCentralWidget(self.canvas)


QgsApplication.setPrefixPath(os.environ.get("QGIS_PREFIX_PATH", "C:\Program
Files\QGIS 3.4\apps\qgis"), True)
qgs = QgsApplication([], True)
qgs.initQgis()

app = WMSTestApp()
app.show()
qgs.exec_()
qgs.exitQgis()

Interestingly, the layers (from the same sources!) both load from the
Windows QGIS app.
So I did some digging and noticed that the default Google Maps url returns
PNG files, while the Satellite url returns JPEGs. I tested a couple of
other links, and it seems like only PNG tile servers have any effect on
windows systems.

Have tested this on Windows 7 and 10, with the same results.

Does PyQgis need to be reconfigured in some way to get this to work? Or is
it a known issue with the version (3.4) I'm using?

Cheers and thanks,
Erik

</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
QGIS-Developer mailing list
<a class="moz-txt-link-abbreviated" href="mailto:QGIS-Developer@lists.osgeo.org">QGIS-Developer@lists.osgeo.org</a>
List info: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-developer">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a>
Unsubscribe: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-developer">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a></pre>
    </blockquote>
  </body>
</html>