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

1645
10
04-25-2018 08:57 AM
JasonBuck
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

0 Kudos
10 Replies
RobertScheitlin__GISP
MVP Emeritus

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"

0 Kudos
JasonBuck
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

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Jason,

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

0 Kudos
JasonBuck
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

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Jason,

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

0 Kudos
JasonBuck
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

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Jason,

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

0 Kudos
JasonBuck
New Contributor III

Robert,

Yes, the layers do load up initially.  

0 Kudos
PatrickWild3
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

0 Kudos