AnsweredAssumed Answered

revised: how can I access className?!

Question asked by trying2drawlinebetween2points on Apr 30, 2020
Latest reply on May 1, 2020 by rscheitlin

Revised attempt at my previous question:

 

I am successfully adding a class to my graphic layer.... previously I was using an ID.. I console.log(myNewGraphicLayer) and it's found, the added class below: vvv

 

  1. attributionDataUrl: (...)
  2. attributionVisible: (...)
  3. className: "someThing" <-----------------------------------
  4. elevationInfo: (...)
  5. fullExtent: (...)
  6. graphics: (...)
  7. hasAttributionData: (...)
  8. id: (...)
  9. legendEnabled: (...)
  10. listMode: (...)
  11. load: ƒ (e)
  12. loadError: (...)

 

I added it this way: vvvv

 

    let graphicsLayer = new GraphicsLayer({
      //id: "someThing", <------- works, but I am adding many need to use class
      className: "someThing"
    });

 

I am perplexed, because this will work when ID is added...

 

const polyDrawline = map.findLayerById('someThing');

 

but this will not work when className is added...

 

const polyDrawlineS = map.findLayerByClassName('someThing');

 

how do I access my className?

Outcomes