Select to view content in your preferred language

Web AppBuilder LocalLayer Widget

3103
4
Jump to solution
11-09-2015 03:53 AM
DavidAdams7
Emerging Contributor

I have installed the LocalLayer widget which seems perfect for me to add some locally hosted dynamic maps within an app. I can configure the map to point at a local service successfully however when I try and use the button I get an error. I'm not sure if I have missed something in the configuration - it's the first time I've tried using web appbuilder with a custom widget?

TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.

    at TypeError (native)

    at Object.b.place (http://js.arcgis.com/3.14/init.js:148:448)

    at declare.setPosition (http://ws211:3344/webappbuilder/apps/6/jimu.js/BaseWidget.js:235:12)

    at null.<anonymous> (http://ws211:3344/webappbuilder/apps/6/jimu.js/OnScreenWidgetIcon.js:120:18)

    at http://js.arcgis.com/3.14/init.js:167:296

Any help would be greatly appreciated.

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

David,

    The fact that this error mentions OnScreenWidgetIcon.js tells me that you have not added this widget properly to WAB.

When you add the widget to the config.json for your basic_viewer or default (i.e. [install dir]\client\stemapp\predefined-apps\default). It needs to be added to the widgetOnScreen and widgets array as noted in the readme.md "Setting up the Widget" section. Once you have done this and create a new app then you will see the Local Layer widget in the widgets list in WAB and you do not need to add it to a on screen widget place holder like you have.

Preview.jpg

View solution in original post

4 Replies
RobertScheitlin__GISP
MVP Emeritus

David,

    The fact that this error mentions OnScreenWidgetIcon.js tells me that you have not added this widget properly to WAB.

When you add the widget to the config.json for your basic_viewer or default (i.e. [install dir]\client\stemapp\predefined-apps\default). It needs to be added to the widgetOnScreen and widgets array as noted in the readme.md "Setting up the Widget" section. Once you have done this and create a new app then you will see the Local Layer widget in the widgets list in WAB and you do not need to add it to a on screen widget place holder like you have.

Preview.jpg

DavidAdams7
Emerging Contributor

Robert,

Many thanks for the prompt reply - I re-looked at the instructions and added the lines and it now works. It's not quite what I wanted as my colleague I was working for, wanted an in-panel widget which he could click to add the operational layers after initially going into the app.

Many thanks

Dave

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

David,

   For that there is a widget called "Add Service"

Add Service Widget 1.1.3

DavidAdams7
Emerging Contributor

Robert,

I grabbed the Add service widget and it's perfect for what I needed. Again many thanks for your help.

cheers

Dave

0 Kudos