<?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 change TiledMapServiceLayer 'displayLevesl' property AFTER layer is added in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-tiledmapservicelayer-displaylevesl-property/m-p/739862#M68483</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;here's a tricky one.&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm creating a Custom display scale range control with a dojo horizontal range slider.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Seems the cleanest way to do this would be attach a function to the range slider that simply changes the TiledMapServiceLayer's 'displayLevels' property.&amp;nbsp; But in testing it appears that the displayLevels property has to be set when the layer is created. After its added to the map it appears that it becomes ._displayLevels and is not changeable?&amp;nbsp; Am I missing something?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I guess I could remove the layer, redefine it, and re-add it to the map.&amp;nbsp; But it would be nice if there was an easier way to set the display Levels of a Tiled Layer after its added to the map and then just refresh it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I see that the FeatureLayer has a setScaleRange(min,max) method, and min/maxScale property. Can there be something like this for a Tiled Layer?&amp;nbsp;&amp;nbsp;&amp;nbsp; Or better add the min/maxScale to the esri.layers.Layer class so its available on all layers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Or is there an easier way of doing this that i'm missing?&amp;nbsp; I dont want to have to listen for zoom changes and loop through all my layers adding and removing them...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If it helps here's a link to my application.&amp;nbsp;&amp;nbsp; If you click the arrow next to the layer, the range slider appears which im trying to make control the display levels... &lt;/SPAN&gt;&lt;A href="http://geology.utah.gov/testing/marshall/jstest/indexTest.html" rel="nofollow noopener noreferrer" target="_blank"&gt;http://geology.utah.gov/testing/marshall/jstest/indexTest.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
 var rangeslider = new dojox.form.HorizontalRangeSlider({
&amp;nbsp;&amp;nbsp; name: "rangeSlider",
&amp;nbsp;&amp;nbsp; value: [min, max],
&amp;nbsp;&amp;nbsp; minimum: 0,
&amp;nbsp;&amp;nbsp; maximum: 19,
&amp;nbsp;&amp;nbsp; discreteValues: 20,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; intermediateChanges: false,&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; showButtons: true,
&amp;nbsp;&amp;nbsp; onChange: function(n) {
&amp;nbsp;&amp;nbsp; layer._displayLevels = Array.range(n[0],n[1]);
&amp;nbsp;&amp;nbsp; layer.refresh();
 }
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm actually kind of surprised ArcGIS.com doesnt have this functionality next to the set opacity control on each layer.&amp;nbsp; It would be a cool feature.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 07:29:39 GMT</pubDate>
    <dc:creator>lanceweaver</dc:creator>
    <dc:date>2021-12-12T07:29:39Z</dc:date>
    <item>
      <title>change TiledMapServiceLayer 'displayLevesl' property AFTER layer is added</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-tiledmapservicelayer-displaylevesl-property/m-p/739862#M68483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;here's a tricky one.&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm creating a Custom display scale range control with a dojo horizontal range slider.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Seems the cleanest way to do this would be attach a function to the range slider that simply changes the TiledMapServiceLayer's 'displayLevels' property.&amp;nbsp; But in testing it appears that the displayLevels property has to be set when the layer is created. After its added to the map it appears that it becomes ._displayLevels and is not changeable?&amp;nbsp; Am I missing something?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I guess I could remove the layer, redefine it, and re-add it to the map.&amp;nbsp; But it would be nice if there was an easier way to set the display Levels of a Tiled Layer after its added to the map and then just refresh it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I see that the FeatureLayer has a setScaleRange(min,max) method, and min/maxScale property. Can there be something like this for a Tiled Layer?&amp;nbsp;&amp;nbsp;&amp;nbsp; Or better add the min/maxScale to the esri.layers.Layer class so its available on all layers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Or is there an easier way of doing this that i'm missing?&amp;nbsp; I dont want to have to listen for zoom changes and loop through all my layers adding and removing them...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If it helps here's a link to my application.&amp;nbsp;&amp;nbsp; If you click the arrow next to the layer, the range slider appears which im trying to make control the display levels... &lt;/SPAN&gt;&lt;A href="http://geology.utah.gov/testing/marshall/jstest/indexTest.html" rel="nofollow noopener noreferrer" target="_blank"&gt;http://geology.utah.gov/testing/marshall/jstest/indexTest.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
 var rangeslider = new dojox.form.HorizontalRangeSlider({
&amp;nbsp;&amp;nbsp; name: "rangeSlider",
&amp;nbsp;&amp;nbsp; value: [min, max],
&amp;nbsp;&amp;nbsp; minimum: 0,
&amp;nbsp;&amp;nbsp; maximum: 19,
&amp;nbsp;&amp;nbsp; discreteValues: 20,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; intermediateChanges: false,&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; showButtons: true,
&amp;nbsp;&amp;nbsp; onChange: function(n) {
&amp;nbsp;&amp;nbsp; layer._displayLevels = Array.range(n[0],n[1]);
&amp;nbsp;&amp;nbsp; layer.refresh();
 }
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm actually kind of surprised ArcGIS.com doesnt have this functionality next to the set opacity control on each layer.&amp;nbsp; It would be a cool feature.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:29:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-tiledmapservicelayer-displaylevesl-property/m-p/739862#M68483</guid>
      <dc:creator>lanceweaver</dc:creator>
      <dc:date>2021-12-12T07:29:39Z</dc:date>
    </item>
  </channel>
</rss>

