Created
May 12, 2023 00:50
-
-
Save benwirf/c87452956aed7947d5724a946b5c671d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
layer = QgsProject.instance().mapLayersByName('LIMITES_ADMINISTRATIVES_EXPRESS.LATEST')[0] | |
url = 'https://www.geoportail.gouv.fr/depot/layers/LIMITES_ADMINISTRATIVES_EXPRESS.LATEST/legendes/LIMITES_ADMINISTRATIVES_EXPRESS.LATEST-legend.png' | |
layer.setLegendPlaceholderImage(url) | |
props = QgsRasterLayerProperties(layer, self.iface.mapCanvas())# Note use of self.iface object if this is in a plugin | |
props.apply() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment