AnsweredAssumed Answered

ArcGIS API for JavaScript: StreamLayer: Labels

Question asked by tod_stevens@sdsi.com.au on Oct 13, 2014
Latest reply on Oct 16, 2014 by tod_stevens@sdsi.com.au

Has anyone been able to turn on labels for streamlayers in ArcGIS API for JavaScript?

 

The samples do not show any labels (dots with labels are not very useful), but the API has the ability to via SetLabelingInfo.

 

I used the streamlayer sandbox to test this (full sample attached)

 

var labelClass = new LabelClass({

  labelExpression: '[BusNo]',

  labelPlacement: 'always-horizontal'

});

 

  labelClass.symbol = new TextSymbol({

    font: new Font("12", Font.STYLE_NORMAL, Font.VARIANT_NORMAL, Font.WEIGHT_BOLD, "Helvetica"),

    color: new Color("#666633")

                         });

 

            layer.setLabelingInfo([labelClass]);

            layer.setShowLabels(true);

            layer.setRenderer( renderer );

 

Regards

Tod

Attachments

Outcomes