AnsweredAssumed Answered

Legend Widget with ArcGISTiledMapServiceLayer

Question asked by maddog56 on Oct 24, 2018
Latest reply on Oct 25, 2018 by rscheitlin

In regards to displaying a ArcGISTiledMapServiceLayer in a legend widget with the JavaScript 3.26 API (see code and layer below). The legend is displaying the layer's symbology, but it is simultaneously displaying a set of symbology, one for each scale cached into the service layer. The results of which is that I see (the same) symbology in the legend for all scales. I am only interested in the legend displaying the correct symbols based on the map's current display scale. Any way to javascript code my way around this? BTW- I am not the owner of this layer.

 

basemaplayerStreet = new esri.layers.ArcGISTiledMapServiceLayer("http://maps.cityofmobile.org/ArcGIS/rest/services/Base_Cache/MapServer",
{id: 'City Base'});

 

 map.on("layers-add-result", function (results)
 {

  var legendDijit = new Legend
  ({map: map,}, "legendDiv");  


  legendDijit.startup(); 
     
  }); /*end layers-add-result*/

 

  map.addLayer(basemaplayerStreet);

Outcomes