daily pastebin goal
49%
SHARE
TWEET

Untitled

a guest Nov 12th, 2018 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. text_format = QgsTextFormat()
  2. label = QgsPalLayerSettings()
  3. label.fieldName = 'Description'
  4. label.enabled = True
  5. label.setFormat(text_format)
  6. labeler = QgsVectorLayerSimpleLabeling(label)
  7. layer.setLabelsEnabled(True)
  8. layer.setLabeling(labeler)
  9. layer.triggerRepaint()
  10.    
  11. QgsProject.instance().addMapLayer(layer)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top