Select to view content in your preferred language

Can I customize the LayerList widget to add non-interactive descriptive text lines between layers listed.

4486
32
Jump to solution
01-19-2018 12:48 PM
BenjaminGrover
Emerging Contributor

I've seen some talk about this in other discussions, but no solid solutions.  Where would one need to add code to insert text lines between layers in the LayerList widget?  I'm wanting to add some descriptive text, smaller font, bolded, and in red, below a few layers listed in the Widget. Can this be done??

0 Kudos
32 Replies
RobertScheitlin__GISP
MVP Emeritus

Benjamin,

   OK. I see the issue now. I have been looking into it for a bit now and I don't see an easy fix. I will try and keep you up to date if I find a fix.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Benjamin,

   Here is what I came up with:

      showLayers: function() {
        // summary:
        //    create a LayerListView module used to draw layers list in browser.
        this.layerListView = new LayerListView({
          operLayerInfos: this.operLayerInfos,
          layerListWidget: this,
          layerFilter: this.layerFilter,
          config: this.config
        }).placeAt(this.layerListBody);

//RJS code changes begin
//The next line is what you need to change from your layer you want this desc added to
//.llayer-title-div-LOJIC_LandRecords_Louisville_4356
//replace LOJIC_LandRecords_Louisville_4356 with your layers id in the code
        setTimeout(lang.hitch(this, function(){
          var node = query('.layer-title-div-LOJIC_LandRecords_Louisville_4356')[0];

          domConstruct.create('br', {}, node);

          domConstruct.create('div', {
            'innerHTML': "My special text",
            'class':'div-content jimu-float-leading LayerNote'
          }, node);
        }), 1000);
//RJS code changes end
        if(this.config.expandAllLayersByDefault) {
          this.layerListView.foldOrUnfoldAllLayers(false);
        }
      },‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
.jimu-widget-layerList .LayerNote{
  height: 10px;
  color: #ff0000;
  font-size: 11px;
  margin-top: 6px;
}
BenjaminGrover1
Emerging Contributor

Robert you are a Gentleman and a Scholar.  Works perfectly again. Thank you.

0 Kudos