Select to view content in your preferred language

LocalLayer Widget not working

3555
5
Jump to solution
06-26-2015 02:23 PM
LeahSaunders
Deactivated User

All,

I just installed WAB 1.1 Developer Edition and went through the instructions for loading the custom widget, however a few things popped up:

1. There is no \client\builder\predefined-apps\default2DApp\ folder.  I did find a config.json file in client\stemapp\predefined-apps\default so I added the code to this file.

2. I can load the widget and connect to my services, but once I have them added, nothing is actually added to the map.  So there is very clearly something still wrong.

Has anyone had this issue, or know what I could be doing wrong?  I don't have a proxy as my services are not secured, and are actually on the same test machine as the WAB.

Thanks!

0 Kudos
1 Solution

Accepted Solutions
DanielStoelb
Frequent Contributor

Leah,

You might want to check out this post for details: Tips for using the custom LocalLayer widget with WAB-Dev edition

It seems to me the issue is related to where you added the widget in your json code. I documented how I did the install, which is working for me.  Here are the details:

  • This widget updates the interface to allow for local layers to be added into the system
    • Tips and tricks for implementation can be found here: https://community.esri.com/blogs/myAlaskaGIS/2015/02/04/tips-for-using-the-custom-locallayer-widget-...
    • Must click the visibility icon to make it applicable within the application
    • References to the widget must be added manually into the config.json file
      • § Make sure visible=true
    • Two changes are needed within the client\stemapp\jimu.js\LayerInfos\LayerInfoForMapService.js file:
      • § For version 1.1 Line 450 should be changed from:
        • var url = this.originOperLayer.url + '/' + subId;
      • § To:
        • var url = this.originOperLayer.layerObject.url + '/' + subId;
      • § for v1.1 And line 423 should be changed from:
        • var url = this.originOperLayer.url + '/layers';
      • § To:
        • var url = this.originOperLayer.layerObject.url + '/layers';

View solution in original post

0 Kudos
5 Replies
DanielStoelb
Frequent Contributor

Leah,

You might want to check out this post for details: Tips for using the custom LocalLayer widget with WAB-Dev edition

It seems to me the issue is related to where you added the widget in your json code. I documented how I did the install, which is working for me.  Here are the details:

  • This widget updates the interface to allow for local layers to be added into the system
    • Tips and tricks for implementation can be found here: https://community.esri.com/blogs/myAlaskaGIS/2015/02/04/tips-for-using-the-custom-locallayer-widget-...
    • Must click the visibility icon to make it applicable within the application
    • References to the widget must be added manually into the config.json file
      • § Make sure visible=true
    • Two changes are needed within the client\stemapp\jimu.js\LayerInfos\LayerInfoForMapService.js file:
      • § For version 1.1 Line 450 should be changed from:
        • var url = this.originOperLayer.url + '/' + subId;
      • § To:
        • var url = this.originOperLayer.layerObject.url + '/' + subId;
      • § for v1.1 And line 423 should be changed from:
        • var url = this.originOperLayer.url + '/layers';
      • § To:
        • var url = this.originOperLayer.layerObject.url + '/layers';
0 Kudos
LeahSaunders
Deactivated User

Capture.JPG

I did all of this and read through the document.  Do you have that default2D folder in your directory?

This is where I found the config...since there was no pre-defined apps folder in my other location:

Capture2.JPG

0 Kudos
DanielStoelb
Frequent Contributor

I do not have the default2D folder.

Here is the modification that I made in the cofig.json file in the client\stemapp\predefined-apps\default\config.json file:

"widgetOnScreen": {

    "widgets": [{

      "uri": "widgets/LocalLayer/Widget",

      "visible": true

            },

0 Kudos
LeahSaunders
Deactivated User

Okay, I re-did everything and it is working now!!!  Thanks for the very quick reply!!

0 Kudos
DanielStoelb
Frequent Contributor

No problem!

0 Kudos