Web App Builder Hangs Up Looking for odds.css file from local layer widget

584
10
04-25-2018 08:57 AM
Highlighted
New Contributor III

Hello,

I am attempting to use the local layer widget 2.5 (in version 2.7 of web app builder).   The local layer widget is shown as one of the available widgets when I click on the widget tab.  When I click the Show This Widget button, I get a 404 error message stating that the application couldn't fine an odds.json file in the application path (apps/3/configs/LocalLayer/odds.json).  When I look at that path, there is no odds.json or odds.css file present.  This has been causing the applications to hang up.  I'm not sure if I'm not installing the widget correctly or if the file is missing widget.  Thank you.

Jason Buck

Reply
0 Kudos
10 Replies
Highlighted
MVP Esteemed Contributor

Jason,

   The Local Layer widget is not a normal widget that you would click on a button to open or activate. It sounds like you did not review the install instructions that tell you to manually add the widget to the config.json. The odds.json is not a file that is included in the widget download but something that is manually added (if you want that ability). I have never seen the need to use the odds portion of this widget and it does not impact the functionality of the widget once properly installed.

Setting up the LocalLayer Widget

To add this widget to your ArcGIS Web AppBuilder environment, copy the widget folder to your \client\stemapp\widgets directory, and add a reference to the widget in the standard Default App configuration located at \client\stemapp\predefined-apps\default\config.json, under the widgetOnScreen section.

    "widgetOnScreen": {         "widgets": [             {                 "uri": "widgets/LocalLayer/Widget",                 "visible": false            },         ...        ]     }

bulb "visible":false will render the widget 'off' by default when building your applications. This gives you an option of whether or not you wish to override the default ArcGIS-Online-Map-based WAB functionality in favor of importing your own MapServices directly.

Please note that the "/LocalLayer/" portion of the uri path above must match the folder name of the widget on your local deployment, so if you're downloading the widget from github, you'll likely want to rename the folder from "LocalLayer-master" to simply "LocalLayer"

Reply
0 Kudos
Highlighted
New Contributor III

Robert,

Thank you for the quick response.  I think I have the files in correct locations on my local install, but please tell me if these are mistaken:  

C:\Esri_WebAppBuilder\arcgis-web-appbuilder-2.7\WebAppBuilderForArcGIS\client\stemapp\widgets\LocalLayer

C:\Esri_WebAppBuilder\arcgis-web-appbuilder-2.7\WebAppBuilderForArcGIS\client\stemapp\predefined-apps\default\config.json

I made the changes to the local layer name and only copied the 2D local layer widget files from the GitHib download. 

Are there any other config.json files other than at the predefined-apps\default\ that need to be edited?  Thanks.

Jason Buck

Reply
0 Kudos
Highlighted
MVP Esteemed Contributor

Jason,

   Nope that looks right. So when you create a new app you should have it appear like this:

Reply
0 Kudos
Highlighted
New Contributor III

Yes, the only difference is that I have to click on the make visible button.  When I open that widget, I see the default layers.  I can  remove those layers and add my own, but then the program stalls.  I get this message from the developer tools:

Refused to apply style from 'https://is-comp9-new.cityoflacrosse.org:3344/webappbuilder/apps/4/configs/LocalLayer/odds.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

I'm not sure why the application is looking for that file.  There is no odds.css file at that location, so it just hangs.  

Jason Buck

Reply
0 Kudos
Highlighted
MVP Esteemed Contributor

Jason,

  So what happen if you create a new app and leave the defaults?

Reply
0 Kudos
Highlighted
New Contributor III

Robert,

If I just open the program and add layers through a map on ArcGIS online I have no problems and get no error messages.  It's only when I make the local layer widget visible do I see the 404 errors looking for the odds files.  

Jason

Reply
0 Kudos
Highlighted
MVP Esteemed Contributor

Jason,

  Yes you get the error but does the app load the default configured layer from the Local Layer widget?

Reply
0 Kudos
Highlighted
New Contributor III

Robert,

Yes, the layers do load up initially.  

Reply
0 Kudos
Highlighted
New Contributor III

Jason,

I'm seeing the same issue. Were you able to resolve? If so, what was your solution?

LocalLayers 2.5, WAB 2.15

Reply
0 Kudos