[Qgis-developer] pyqgis load a memorylayer in plugin but not show it in layerlist/legend

Matthias Kuhn matthias at opengis.ch
Wed Dec 2 04:20:36 PST 2015


The API seems to make that not too hard ;)

http://qgis.org/api/classQgsMapLayerRegistry.html#a3d0d19c86467341bdd62471c5de61376

QgsMapLayer <http://qgis.org/api/classQgsMapLayer.html> *
QgsMapLayerRegistry::addMapLayer 	( 	QgsMapLayer
<http://qgis.org/api/classQgsMapLayer.html> *  	/theMapLayer/,

	
	bool  	/addToLegend/ = |true|,

	
	bool  	/takeOwnership/ = |true| 

	) 	



Matthias

On 12/02/2015 01:11 PM, Richard Duivenvoorde wrote:
> Hi Devs,
>
> Is there a way to create a memory layer in a plugin, and load it in the
> map (and put temporary features in it), but NOT show it in the
> legend/layerlist?
>
> Context: we generate sort of big pie-charts in a plugin, which are shown
> to user (and user is able to change color), but after closing of the
> plugin the layer is emptied (or published to a shp or server).
> It seems not very usefull to let the user for exampel make the layer go
> down or make invisible or so.
>
> So: possible? If yes: how?
>
> Regards & Thanks,
>
> Richard Duivenvoorde
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

-- 
Matthias Kuhn
OPENGIS.ch - https://www.opengis.ch
Spatial • (Q)GIS • PostGIS • Open Source

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20151202/d8f69339/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20151202/d8f69339/attachment.sig>


More information about the Qgis-developer mailing list