Can I remove layers from my LayerList in a WAB created map?

14759
52
Jump to solution
03-16-2015 01:31 PM
BrianO_keefe
Regular Contributor II

I have had to replicate, duplicate, and masticate (it means chew, people) several layers on a web map in order to get them to show up like the clients want them to be shown.

However, now I have a LayerList that is obnoxious with repetitive layers.

Can I remove layers from the LayerList?

And how?

Tags (2)
52 Replies
JasonStanton__GISP
Occasional Contributor

Thank you Robert!  New thread here.

0 Kudos
Lars_ElmkærChwastek
Occasional Contributor

Mathias,

This might be a silly question but, how do you get your webmaps JSON? I should say, that I haven't worked  a day in my life with JSON.

0 Kudos
JuneAcosta
Occasional Contributor III
Lars_ElmkærChwastek
Occasional Contributor

Hmm thats rather anoying! I've tried that at least 10 times with the same URL as Mathias provided, and could not get it to Work. Now I tried again with your URL, and it worked! OMG!

Thanks June 🙂

0 Kudos
ChristopherSchreiber
Occasional Contributor II

Lars, 

You can also use the ArcGIS Online Assistant app to find a webmap's JSON. 

Link: ArcGIS Online Assistant 

Just log in, Select "I want to", and then select "View an Item's JSON". Then select the map that you want to view.

Chris

LindseyStone
Occasional Contributor II

How do you do this with a web map on portal?  I go to http://gis.adamscounty.org/parcgis/sharing/content/items/f6693fbd7acb403b97de38d1bd0e0fa4/data?f=pjs... but I have no IOT numbers, like your example.

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Lindsey,

   You'll notice that the answer Mathais provided says to search for the "id" of your layers in the webmap json. So your would be "id": "land_use_4895",

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Mathias,

  FYI: I think it would be easier to use the layerInfo.title than the id as this is the text that is actually displayed to the user in the Layer List Widget and they would not need to view the webmap json to get the actual layer id.

      if(this.config.hide && this.config.exclude.hide(layerInfo.title) >= 0) {

        return;

      }

deleted-user-0W0-oLHxDjCX
New Contributor III

It worked well but I could not find the Layerlist load event to call it every time the widget is activated (made visible).

I would like to implement a checkbox to filter some layers on my LayerList widget.

Could anyone help me with this issue?

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

You have to add that method yourself. It is not in the Widget.js by default.

0 Kudos