Widgets in wab-dev isn't showing new layers added to the reference web map

393
4
Jump to solution
08-08-2022 04:09 PM
VanessaSimps
Occasional Contributor III

I recently was asked to add additional layers to a web map which feeds into one of our WAB-DEV apps. I can see the layers in my web map, but when I go into the web app builder to configure these  new layers in the app, I can't see them! I have checked over and over that I am looking at the correct reference map in the app, but they aren't matching up. 

I took a look around the config files, but I am not totally sure where to look for to adjust things? 

Has anyone had this happen? Or know how to fix this issue?

Here is the web map: 

VanessaSimps_3-1659999998133.png

 

Here is what the widget is seeing:

VanessaSimps_2-1659999978320.png

 

 

0 Kudos
1 Solution

Accepted Solutions
VanessaSimps
Occasional Contributor III

I figured it out! I had to mess around with the map image layer's json in ArcGIS Online Assistant. I thought I had everything showing properly, but it wasn't. You used to be able to overwrite a service with new layers in it and it wouldn't require any messing with the json, but???

once I got that dialed in, everything showed up as expected. Thanks again for your reply. I appreciate it!

View solution in original post

0 Kudos
4 Replies
Brian_Wilson
Occasional Contributor III

WAB applications really really like to cache things. It can be very frustrating.

I assume you have already tried clearing your browsers cache? Try again. Seriously. 

If that still does not work for you try a different browser. I use Chrome most of the time but keep Firefox installed and use it when this pops up here.

If that does not work have someone hit the URL from a different computer.

The Esri support people always want me to try "Incognito mode", if that's an option for you try that too. Our IT dept has it disabled as it is regarded as a security problem.

 

0 Kudos
VanessaSimps
Occasional Contributor III

Thanks for the suggestions. I had tried all of those things, and still nothing. grrr. 

interestingly enough. I saved the map image layer that is giving me issues into a new web map. I then tried opened that map up in a new WAB to see if the layers would show up there or not- and they don't. So there is something more going on here. 

Wondering if this has to do with the fact that I published the service from ArcPro vs. ArcMap and it is causing issues. 

0 Kudos
Brian_Wilson
Occasional Contributor III

Did you create the map with the "Classic" map viewer or the new one? I have had only bad experiences so far with the new one.

ArcPro vs ArcMap -- We stopped publishing services over a year ago from ArcMap so I don't think it's that.

Do you know that maps are just JSON files and you can edit them? It's very easy to break them that way too, but sometimes you can get insights into what is going on.

Personally I do something like this:

Find the right folder, for me it's C:/arcgisportal/content/items/LONGIDTHING where LONGIDTHING is the code from Portal for the map, for example, 8220470e7d8141ada9917eb31a42c107 from the end of the URL when you have the map details open in Portal

Copy the file in that folder, and give it a JSON extension so for example "8220470e7d8141ada9917eb31a42c107.json".

Open it in an editor that understands JSON. I use "Visual Studio Code" and in there I can use "Format file" to expand the compressed JSON file to make it readable. (I am sure there are a dozen other editors that can handle JSON. You probably use one already.) VS Code can do some syntax error checking on the file too.

Then I can search for any layer, and read the JSON code that goes with it.

I have gotten in the habit of making two copies of the file. For example, one called 8220470e7d8141ada9917eb31a42c107.json that I edit and one called 8220470e7d8141ada9917eb31a42c107.BACKUP that I don't touch

I can edit the file and then copy it back on top of 8220470e7d8141ada9917eb31a42c107 without fretting, because if I break it then I just copy 8220470e7d8141ada9917eb31a42c107.BACKUP onto 8220470e7d8141ada9917eb31a42c107 and I am back in business.

You never have to re-compress the file after copying it. It can stay uncompressed. The next time you do edit and save in the map viewer it will compress it again.

When you mess around with editing the JSON files you learn about caching and all that. People around here have sticky notes up on the wall "CLEAR YOUR CACHE". Sigh.

 

0 Kudos
VanessaSimps
Occasional Contributor III

I figured it out! I had to mess around with the map image layer's json in ArcGIS Online Assistant. I thought I had everything showing properly, but it wasn't. You used to be able to overwrite a service with new layers in it and it wouldn't require any messing with the json, but???

once I got that dialed in, everything showed up as expected. Thanks again for your reply. I appreciate it!

0 Kudos