I've been having a blast playing around with the new Web AppBuilder, and have taken a few cracks at putting together some custom Widgets that I'd like to share with the community. I hope these can assist in everyone's future Mappmaking endeavours!
September 28 2017 : LocalLayerWidget v2.5 released: This major release includes the following enhancements for the widget. Thanks to everyone who's donated!:
Release LocalLayerWidget 2.5 · cmndrbensisko/LocalLayer · GitHub
November 14, 2016: LocalLayerWidget v2.2 released: This major release includes the following enhancements for the widget:
Release LocalLayer v2.2 · cmndrbensisko/LocalLayer · GitHub
May 18, 2016: LocalLayerWidget v.2.0 released: This substantial change for Web App Builder v.2.0. removes the need to edit any core files in the Web App Builder, unlike previous versions. A slight change will still be necessary for the AttributeTable widget to work properly with LocalLayerWidget layers.
Mar 29, 2016: LocalLayerWidget v.1.3.1 released; Contains bugfixes to v.1.3. related to custom rendering for Feature Layers and toggling sublayer visibility in the LayerList widget.
Mar 22, 2016: LocalLayerWidget v.1.3 is now available! (Note the version naming change; Version 1.3 refers to its compatibility with v1.3 of the WAB - This is indeed the latest version of the widget as of March 22, 2016). Be sure to read the github page to see what tweaks need to be made to ensure that everything continues running smoothly in version 1.3 of the Web AppBuilder.
Feb 10, 2015: LocalLayerWidget v.1.5 is now available! This release contains full support for adding Tiled layers to your application directly from ArcGIS Server, in addition to the Basemap, Dynamic, and Feature layers available before. Feel free to grab the widget from our Release page located at https://github.com/cmndrbensisko/LocalLayer/releases.
Feb 2, 2015: LocalLayerWidget v.1.2 is now available! This release provides a great GUI developed by Robert Scheitlin to more easily add Feature, Dynamic, and Basemap layers to your ArcGIS Web AppBuilder Applications. Take it for a spin, and please keep us informed of any bugs or desired enhancements through our Github Issue Tracker located at https://github.com/cmndrbensisko/LocalLayerWidget/issues.
Jan 12, 2015: Note that LocalLayerWidget v.1.1 is now available, which provides Click-To-Identify support and the option to add Feature and Basemap layers in addition to Dynamic layers.
The LocalLayer Widget is intended to allow the direct addition of MapServices to an ArcGIS Web AppBuilder application, without needing to wrap the desired services in an ArcGIS Online/Portal Web Map.
https://github.com/cmndrbensisko/LocalLayerWidget
Basically, your basemap will still need to come from Portal/AGOL, but otherwise you just provide direct URLs to your own MapServices in the widget's configuration settings. The MapServices should load and display as usual in the map, and cooperate with the Legend, LayerList, and Attribute Table widgets. Click-To-Identify functionality won't work currently, though, because the current WAB implementation relies on Portal for all the popup info. As stated in the January 12th 2015 release, popups are fully customizable. Note that it's not an in-panel widget, so you'll need to follow a few extra steps in the project's Readme file.
Let's make Mapps accessible for everyone! With an eye on WCAG compliance, the Accessifizr Widget is designed to help make web applications keyboard navigable without having to modify core application code and UI.
https://github.com/cmndrbensisko/AccessifizrWidget
Information about how to configure this widget is available in the core Accessifizr.js library project available here, but the gist is that you create a JSON-based 'roadmap' detailing the keyboard navigation of your web application, and how it should change in response to users entering modal menus, hitting the escape button, etc. For applying descriptive alternate text to page elements, the widget leverages dojo's built-in internationalization support to specify multilingual alternate text strings. The end result is a web app that, hopefully, is a bit easier to use for people with mobility or visual challenges.
Adam,
Here is another stupid question. I have just started with Web AppBuilder and read the docs.
I followed you instructions but still I get the LocalLayerWidget to show up in the builder?
What am I doing Wrong.
I added the widget to the \client\stemapp\widgets directory
I added the code to the configuration file C:\arcgis-web-appbuilder-1.0\client\builder\predefined-apps\default2DApp\config.json
"widgetOnScreen": {
"widgets": [{
"uri": "widgets\LocalLayerWidget/Widget"
}, {
"uri": "themes/FoldableTheme/widgets/HeaderController/Widget",
"positionRelativeTo": "browser",
"position": {
"left": 0,
"top": 0,
"right": 0,
"height": 40
},
"version": "1.1"
}, { ...
I made changes to the line 433 in the C:\arcgis-web-appbuilder-1.0\client\stemapp\jimu.js\LayerInfos\LayerInfoForMapService.js file
I add a basemap to the C:\arcgis-web-appbuilder-1.0\client\stemapp\widgets\LocalLayerWidget\config.json file
{
"LocalLayerWidget":{
"layerJson": [
{
"type": "Basemap",
"name": "2010 Aerial Imagery",
"url": "http://mymapserver/arcgis/rest/services/Orthos_2010/ImageServer"
}
]
}
}
I didn't use the mymapserver but my server URL
Thanks
Skip
Hey Anthony, it looks like you're following the right steps. Two quick questions to get started;
1) The "\stemapp\widgets" directory is located in the same "c:\arcgis-web-appbuilder-1.0\client.." directory you mention below it, yes?
2) In the "default2DApp\config.json", for the widget entry for the LocalLayerWidget, are both the slashes in the "uri" param the same? Also, is it still called LocalLayerWidget in your environment, or have you changed any widget/directory names anywhere?
3) When you create a new app, in the Node.js console that logs all the backend work, do you see a line similar to the following?
[2015-01-15 20:34:50.223] [INFO] app - copy widget LocalLayerWidget to app 15
Hopefully we can piece apart the problem!
Adam,
I just tried to create a new map and got this error:
[2015-01-16 08:24:34.417] [ERROR] dbutils - [SyntaxError: Unexpected token L]
SyntaxError: Unexpected token L
at Object.parse (native)
at Object.me.readFileSync (C:\arcgis-web-appbuilder-1.0\server\node_modules\
fs-extra\node_modules\jsonfile\lib\jsonfile.js:23:15)
at copyAppFiles (C:\arcgis-web-appbuilder-1.0\server\rest\apps.js:1:1189)
at C:\arcgis-web-appbuilder-1.0\server\rest\apps.js:1:508
at C:\arcgis-web-appbuilder-1.0\server\dbutils.js:1:568
at C:\arcgis-web-appbuilder-1.0\server\node_modules\tingodb\lib\wqueue.js:37
:7
at C:\arcgis-web-appbuilder-1.0\server\node_modules\tingodb\lib\tcoll.js:369
:4
at C:\arcgis-web-appbuilder-1.0\server\node_modules\tingodb\node_modules\saf
e\lib\safe.js:31:7
at C:\arcgis-web-appbuilder-1.0\server\node_modules\tingodb\node_modules\asy
nc\lib\async.js:157:25
at C:\arcgis-web-appbuilder-1.0\server\node_modules\tingodb\lib\wqueue.js:37
:7
[2015-01-16 08:24:34.428] [ERROR] app - create app failed! name: testNew
Anthony,
It sounds like you have introduced a syntax error into the config.json. Open the C:\arcgis-web-appbuilder-1.0\client\stemapp\widgets\LocalLayerWidget\config.json and the C:\arcgis-web-appbuilder-1.0\client\builder\predefined-apps\default2DApp\config.json and copy all of the text and go to a JSON validator site like JSONLint - The JSON Validator. and paste it in the window and click validate on both those files.
I received this same error when I used your syntax. I noticed that you have two different types of slashes in the following excerpt:
"widgetOnScreen": {
"widgets": [{
"uri": "widgets\LocalLayerWidget/Widget"
}
The "Unexpected Token L" might be referring to the forward slash before the word LocalLayerWidget. Try the following instead, and see if you have any improvement:
"widgetOnScreen": {
"widgets": [{
"uri": "widgets/LocalLayerWidget/Widget"
}
Thanks Guys. Works great
Adam,
Two questions:
1. Do you still have to use ArcGISOnline for the base map? I am not getting the map I configured with LocalLayerWidget?
2. The dynamic layer I added to the map with LocalLayerWidget doesn't show a legend of the layer?
Thanks for all the help
Would I be able to see your config for the widget, Anthony? Feel free to take out domain names and service names; I'm more curious about the types of services that you're feeding into the widget.
Here is the config
{
"LocalLayerWidget":{
"layerJson": [
{
"type": "Dynamic",
"name": "Tax Parcels",
"url": "http://myserver/arcgis/rest/services/stuff/MapServer",
"popup": {
"infoTemplates":[
{
"layerId": 0,
"title": "<b>TaxParcel Info</b>",
"content": "PIN: ${PIN}"
}
]
}
},{
"type": "Basemap",
"name": "County Basemap",
"url": "http://myserver:6080/arcgis/rest/services/stuff/MapServer"
}
]
}
}
I have a couple of more questions if you don't mind
Can you change the LocalLayerWidget config for a specific app?
How do you add more fields to the content in the infotemplate? I have tried:
"content": "PIN: ${PIN}" + "OWNER: ${OWNER}"
and
"content": "PIN: ${PIN} <br>OWNER: ${OWNER}"
Thanks
Please for get the first question. I was able to change the config file on an app