Labels for dynamic layer

4088
14
Jump to solution
01-20-2016 01:32 AM
OndrejFialík
New Contributor II

Hello,

how add custom labels to ArcGISDynamicMapServiceLayer? (like FeatureLayer.setLabelingInfo())

Thanks

Ondra

0 Kudos
14 Replies
shilpakaramar
New Contributor II

@RobertScheitlin__GISP 

I tried like you suggested but also labels are not showing in map.

var options = [];
var json = {
"labelExpression": {"name": "{label}"}
}
var labelClass = new LabelClass(json);
drawingOptions.labelingInfo = [labelClass];
option.push(drawingOptions);
EsriDynamicLayer.setLayerDrawingOptions(options);
0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor
var options = [];
var json = {
"labelExpression": "{label}"
}
var labelClass = new LabelClass(json);
drawingOptions.labelingInfo = [labelClass];
option.push(drawingOptions);
EsriDynamicLayer.setLayerDrawingOptions(options);
0 Kudos
shilpakaramar
New Contributor II

I tried this as well but labels were not visible 

var options = [];
var json = {
"labelExpression": "{label}"
}
var labelClass = new LabelClass(json);
drawingOptions.labelingInfo = [labelClass];
drawingOptions.showLables = true;
options.push(drawingOptions);
EsriDynamicLayer.setLayerDrawingOptions(options);
0 Kudos
shilpakaramar
New Contributor II

@RobertScheitlin__GISP any solution for this?

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

@shilpakaramar No I am out of suggestions.

0 Kudos