[Qgis-user] help with labels

Mathieu Dube mathieu at mobilefusioninc.com
Fri Mar 20 06:56:01 PDT 2009


hi,
    Im using qgis to render .shp(esri) files. I use different layers but the
one I have a problem with is a street vector layer.

The display of the streets is fine but when I try to enable the labels which
are street names every single one of them merely prints "Label"

so everywhere instead of the street name its "Label" that is printed.

Here's the code Im using:

 QgsLabel *label = vLayer->label();
 QgsFieldMap fields = vLayer->dataProvider()->fields();
label->setFields(fields);
QgsLabelAttributes *attributes =

label->layerAttributes();
attributes->setColor(Qt::white);
vLayer->enableLabels(true);

Im wondering what Im missing here.

thanks for any help
-M
-- 
Mathieu Dube
Software Engineer
MobileFusion, Inc
2715 Sarah St
Pittsburgh PA, 15203
Main: 412.481.1111 Ext:140
Fax: 412.481.0220
Email: mathieu at mobilefusioninc.com
URL: www.mobilefusioninc.com
****************************************************************************
This communication (including any attachments) is for the use of the
intended recipient(s) only and may contain information that is confidential,
privileged or otherwise legally protected. Any unauthorized use or
dissemination of this communication is prohibited. If you have received this
communication in error, please immediately notify the sender by return
e-mail message and delete all copies of the original communication. Thank
you for your cooperation.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20090320/95991ed5/attachment.html>


More information about the Qgis-user mailing list