AnsweredAssumed Answered

Legend Displays Wrong Symbol

Question asked by BLomas on Aug 26, 2020
Latest reply on Sep 4, 2020 by bromlein

Using arcgis js 4.16 legend widget. I have a two tile layers added to the map. For some reason one of the layers gets the symbol from the opposite tile layer. For example, one layer is a tile layer of sanitary sewer and the other is parcels. The sanitary sewer's legend symbol is shown as the parcel's symbol. See pic below. The basic code used is below. Anyone have an idea what would cause this?

 

var parcelLayer = new TileLayer({
      url: ""
    });

    var sanitary = new TileLayer({
      url: ""
    });

    var map = new Map({
      basemap: basemap,
      layers:[parcelLayer, sanitary]
    });

  var view = new MapView({
    container: "sceneDiv",
    map: map,
    center: []
  });

  var legend = new Legend({
    view: view,
    layerInfos: [{
      layer: sanitary,
      title: "Legend"
    },{
      layer: parcelLayer
    }]
  });

Outcomes