[Qgis-user] google road layer loaded incorrect

ngoc pham quanpm4910 at gmail.com
Tue May 18 01:41:05 PDT 2021


I add google road map layer to canvas, but it seem load incorrect CRS?
QgsDataSourceUri ds;
ds.setParam("type", "xyz");
ds.setParam("url", QString("
https://mt1.google.com/vt/lyrs=m&x={x}&y={y}&z={z}"));
QgsRasterLayer* layer = new QgsRasterLayer(ds.encodedUri(), "my map",
"wms");
QList<QgsMapLayer*> layers = mCanvas->layers();
layers.insert(0, layer);
mCanvas->setLayers(layers);
mCanvas->setExtent(layer->extent());

but when I using qgis desktop, add XYZTiles with Google Maps, I get map is
square and no any information from provider about CRS, missed extent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20210518/5fb125e1/attachment.html>


More information about the Qgis-user mailing list