De : Mathias MIRRA Envoyé : jeudi 17 septembre 2020 10:10 À : '[email protected]' <[email protected]> Objet : Openstreemap pyqgis error
Hello, I have a problem on the development of a python plugin, I'm trying to display the openstreemap map behind layers, only the map is not synchronized with the layers, it can't find it or even the location. the geographical position of the map does not correspond to that of my layers / Bonjour, j'ai un problème sur le développement d'un plugin en python ,j'essaye de faire afficher la carte openstreemap derrière des layers .Seulement la carte n'est pas synchroniser avec les layers ,elle ce trouve pas ou même endroit. la position géographique de la carte ne correspond pas à celle de mes couches #Vlayer is defined above the code / Vlayer est définie au-dessus du code urlWithParams = 'type=xyz&url=http://a.tile.openstreetmap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png&zmax=19&zmin=0&crs=EPSG3857' maplayer = QgsRasterLayer(urlWithParams, 'OpenStreetMap', 'wms') settings = QgsMapSettings() settings.setLayers([vlayer,maplayer]) settings.setBackgroundColor(QColor(255, 255, 255)) settings.setOutputSize(QSize(800, 690)) settings.setExtent(vlayer.extent()) render = QgsMapRendererParallelJob(settings) render.start() render.waitForFinished() img = render.renderedImage() img.save(QgsApplication.qgisSettingsDirPath()+"python/plugins/nro_print/img/render.png", "png") merci bonne continuation Mathias Mirra Développeur Tel. : 06 29 70 41 92 | Mail. : [email protected]<mailto:[email protected]> [cid:[email protected]] 281 Route d'Espagne, 31100 Toulouse 05 32 09 38 71 | www.mcgr.fr<http://www.mcgr.fr/> [cid:[email protected]] <https://www.facebook.com/groupemcgr/> [cid:[email protected]] <https://fr.linkedin.com/company/groupemcgr> [cid:[email protected]] <https://www.youtube.com/channel/UCahBf8ogJuyGlzAczTTtC9w> [Une image contenant plane, lumière, blanc, grand Description générée automatiquement]
_______________________________________________ QGIS-Developer mailing list [email protected] List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
