Hi,
We are experiencing a strange issue with the LayerList Widget from the 4.x api. For a specific MapService, all layers are coming through with the label "Untitled Layer". This happens every time we load our app in IE11, and it happens inconsistently in all other major browsers (ex: for Chrome, it doesn't happen for a while, but then it happens and doesn't go away). The MapService layers are added to the Map as a WebMap.
Has anyone ever seen this behavior before with the LayerList? Any suggestions on how to resolve it?
Thanks!
-Cameron
Solved! Go to Solution.
Hi Joseph,
I think I figured it out for the major browsers. But even with these changes, it's still happening in IE11. The changes I made were related to the webmap's json. You can edit the webmap json using AGOL Assistant. There were two edits that I made:
1. I took out all field references in any popup's display field. Sometimes the display field references old fields from the service that are no longer available, and that messes things up.
2. I cleared out all layers that were only defined by just the id. So something like:
...
{
id: 3
},
...
I took all of them out of the webmap json.
After those 2 changes, we don't get the untitled layers in the Layerlist for major browsers (excluding IE11, where it always happens).
Hope this helps you
Can you provide a link to this webapp?
I can. I'd feel more comfortable DMing it to you. I can't seem to figure out how to send a DM on GeoNet to you. Could you shoot me a quick email at cameronsmith@vhb.com, and then I'll send you the link to check out? I would really appreciate the help.
Please feel free to respond with any ideas here. Like I said, the behavior is reproducible most consistently in IE11.
Maybe the map is loading wrong with IE. I am not sure what one is designed.
So with IE I get:
With Chrome I get different layers loading at start:
Hi, did you ever figure out the cause of the Untitled Layer problem? I'm having this in my custom 4.x app as well, but its so intermittent and random that I'm having a hard time to debugging it. I was thinking it was a browser cache problem, but sometimes it even persists in an incognito window. It seems to always to always display the real title when I have the browser console open making this hard to figure out.
Hi Joseph,
I think I figured it out for the major browsers. But even with these changes, it's still happening in IE11. The changes I made were related to the webmap's json. You can edit the webmap json using AGOL Assistant. There were two edits that I made:
1. I took out all field references in any popup's display field. Sometimes the display field references old fields from the service that are no longer available, and that messes things up.
2. I cleared out all layers that were only defined by just the id. So something like:
...
{
id: 3
},
...
I took all of them out of the webmap json.
After those 2 changes, we don't get the untitled layers in the Layerlist for major browsers (excluding IE11, where it always happens).
Hope this helps you
Cameron,
That's great that you've mostly fixed it. I actually might have fixed it on my end too, all I did was rename the affected layers in the webmap, removing brackets ( ) that were in the titles. I don't know if it was the brackets causing the issue (doubt it) or just resaving the webmap might have refreshed some other json.
I've had other issues with layer titles when the services have < > symbols in them. Usually I just end up replacing them with visually identical looking symbols in the windows character map tool. So that was my reasoning for at least trying this.
Thanks for the quick reply!
Joe