Show VectorLayer in window

المشرف العام

Administrator
طاقم الإدارة
I'm new in PyQgis. I can create vector layer and lines/polygons on it :

layer = QgsVectorLayer("LineString", "points", "memory") pr = layer.dataProvider() pt = QgsFeature() point1 = QgsPoint(0,0) point2 = QgsPoint(100,100) pt.setGeometry(QgsGeometry.fromPolyline([point1,point2])) pr.addFeatures([pt]) layer.updateExtents() Is there a simple way, how can I visuall see that line in window? I tried canvas, but I wasn't able to display anything on it.

Thanks



أكثر...
 
أعلى