<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Toggle Labeling for DynamicLayers ? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/toggle-labeling-for-dynamiclayers/m-p/373655#M34666</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #24292e; background-color: #ffffff; margin-top: 0px !important; margin-bottom: 16px;"&gt;Hi,&lt;/P&gt;&lt;P style="color: #24292e; background-color: #ffffff; margin-bottom: 16px;"&gt;I have DynamicMapService published on server with default labeling on for two layers (Manhole and Parcel).&lt;/P&gt;&lt;P style="color: #24292e; background-color: #ffffff; margin-bottom: 16px;"&gt;I have menu "Labels" next to each layer in TOC&amp;nbsp;of my application.&lt;/P&gt;&lt;P style="color: #24292e; background-color: #ffffff; margin-bottom: 16px;"&gt;&lt;IMG __jive_id="458463" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/458463_pastedImage_3.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #24292e; background-color: #ffffff; margin-bottom: 16px;"&gt;I have tried this below code when you click on "Labels" menu :&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;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); 
});&lt;/PRE&gt;&lt;P&gt;This is what I get in event.&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="458455" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/458455_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #24292e; background-color: #ffffff; margin-bottom: 16px;"&gt;Label is getting turn on/off but it switch the labeling for @those two layers (Manhole and Parcel). for example :&lt;/P&gt;&lt;OL style="color: #24292e; background-color: #ffffff; margin-bottom: 16px; padding-left: 2em;"&gt;&lt;LI&gt;First I click on Foul Sewer Manhole layer Labels menu to Turn off the Labels - It is working fine&lt;/LI&gt;&lt;LI style="margin-top: 0.25em;"&gt;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&lt;/LI&gt;&lt;LI style="margin-top: 0.25em;"&gt;Again If i click on Foul Sewer Manhole - it turn on Parcel label and so on.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Any idea how to toggle label of DynamicMapService service published on server with default labeling on ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;if layer labeling&amp;nbsp;is On/Off then toggle labeling&amp;nbsp;of layer ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 17:16:33 GMT</pubDate>
    <dc:creator>MayurDodiya</dc:creator>
    <dc:date>2021-12-11T17:16:33Z</dc:date>
    <item>
      <title>Toggle Labeling for DynamicLayers ?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/toggle-labeling-for-dynamiclayers/m-p/373655#M34666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #24292e; background-color: #ffffff; margin-top: 0px !important; margin-bottom: 16px;"&gt;Hi,&lt;/P&gt;&lt;P style="color: #24292e; background-color: #ffffff; margin-bottom: 16px;"&gt;I have DynamicMapService published on server with default labeling on for two layers (Manhole and Parcel).&lt;/P&gt;&lt;P style="color: #24292e; background-color: #ffffff; margin-bottom: 16px;"&gt;I have menu "Labels" next to each layer in TOC&amp;nbsp;of my application.&lt;/P&gt;&lt;P style="color: #24292e; background-color: #ffffff; margin-bottom: 16px;"&gt;&lt;IMG __jive_id="458463" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/458463_pastedImage_3.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #24292e; background-color: #ffffff; margin-bottom: 16px;"&gt;I have tried this below code when you click on "Labels" menu :&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;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); 
});&lt;/PRE&gt;&lt;P&gt;This is what I get in event.&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="458455" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/458455_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #24292e; background-color: #ffffff; margin-bottom: 16px;"&gt;Label is getting turn on/off but it switch the labeling for @those two layers (Manhole and Parcel). for example :&lt;/P&gt;&lt;OL style="color: #24292e; background-color: #ffffff; margin-bottom: 16px; padding-left: 2em;"&gt;&lt;LI&gt;First I click on Foul Sewer Manhole layer Labels menu to Turn off the Labels - It is working fine&lt;/LI&gt;&lt;LI style="margin-top: 0.25em;"&gt;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&lt;/LI&gt;&lt;LI style="margin-top: 0.25em;"&gt;Again If i click on Foul Sewer Manhole - it turn on Parcel label and so on.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Any idea how to toggle label of DynamicMapService service published on server with default labeling on ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;if layer labeling&amp;nbsp;is On/Off then toggle labeling&amp;nbsp;of layer ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:16:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/toggle-labeling-for-dynamiclayers/m-p/373655#M34666</guid>
      <dc:creator>MayurDodiya</dc:creator>
      <dc:date>2021-12-11T17:16:33Z</dc:date>
    </item>
  </channel>
</rss>

