Hi,
I have DynamicMapService published on server with default labeling on for two layers (Manhole and Parcel).
I have menu "Labels" next to each layer in TOC of my application.
I have tried this below code when you click on "Labels" menu :
topic.subscribe('layerControl/showLabelPicker', function (event) {
var drawingOptions = new LayerDrawingOptions();
//also tried below line to get existing drawing options but first time event.layer.layerDrawingOptions is undefined
//var drawingOptions = event.layer.layerDrawingOptions;
drawingOptions.showLabels = false;
var options = [];
options[event.subLayer.id] = drawingOptions;
event.layer.setLayerDrawingOptions(options);
});
This is what I get in event.
Label is getting turn on/off but it switch the labeling for @those two layers (Manhole and Parcel). for example :
- First I click on Foul Sewer Manhole layer Labels menu to Turn off the Labels - It is working fine
- Now, I click on Parcel layer Labels menu to Turn Off the labels - here it switch the label, it turn off the Parcel layer label and turn on label for Manhole
- Again If i click on Foul Sewer Manhole - it turn on Parcel label and so on.
Any idea how to toggle label of DynamicMapService service published on server with default labeling on ?
if layer labeling is On/Off then toggle labeling of layer ?
Thanks,