Tips for using the custom LocalLayer widget with WAB-Dev edition (updated 10/12/2017)

11470
27
02-03-2015 07:18 PM
RebeccaStrauch__GISP
MVP Emeritus
5 27 11.5K

LocalLayer widget install and usage tips

For those wanting to be able to use ArcGIS Server services with your own ArcGIS Server services in Web AppBuilder for ArcGIS (Developer Edition) | ArcGIS for Developers  without having to have all your services in one web map in ArcGIS Online, the LocalLayer custom widget is a good place to start.

Updates to this blog and attached document:

10/12/2017

10/11/2017 - Updated and uploaded the help document (pdf)

7/19/2017 - Web AppBuilder for ArcGIS v2.5 Developer Edition Now Available! | ArcGIS Blog 

2/18/2017 -  added links to my other blog pages

10/1/2015 - updated and attached new PDF

For a more WAB resources, check out  Web AppBuilder Developer Edition - Resource List (updated 3/26/2018)

My other WAB related blog posts:

This document was created initially because the first few versions were lacking any detailed help.  The READMME.md now contains much of this information, but the attached document expands this info to hopefully make it a little more user friendly, for those of us that are not as hardcore at developing as they are. (NOTE: help docs have been improved since I originally wrote this. Also, very detailed doc/tutorial for this,  plus other custom widgets, can be found  Using the Web AppBuilder   ) 

These are my tips and observations that I'm collecting as I'm learning to implement the widget.  Not a true "help" document, but some info that might help others.  I will update and re-post as needed.  Comments/corrections are welcome in the comment section.

For the latest download, status, information on possible new features, or to help collaborate, check out the GitHub page:  LocalLayer · GitHub 

27 Comments
PeterMoeller-Christensen
New Contributor

Hi Rebecca,

Thanks so much for this. Customizing the web app buider isnt all that easy, so it is great to get some how tos. Could you tell me how I can find themost recent version?

RebeccaStrauch__GISP
MVP Emeritus

Hi Peter,

I'm not sure what particular item you are wanting the latest version link, so:

  • For the WEB-Dev edition     Web AppBuilder for ArcGIS (Developer Edition) | ArcGIS for Developers   you will need to log in with you esri account.
  • For the LocalLayer  widget   LocalLayer · GitHub
  • for my PDF....the attachment marked 1.3 is the latest I've uploaded...haven't modified since since the widget releases have been coming fast, and I haven't seen any major changes to wha tI have there so far.....but I'll add things I figure out, as I have time.

By the way, all of those links are also included above in the text...in case my copy paste didn't work.

PeterMoeller-Christensen
New Contributor

Hi Rebecca,

I got it wrong – now I see that the versions you refer to are the widget versions, not documentation versions. It is a good idea to slow down since it seems a lot of development is going on, and anyway, I got it all going fine inside a test web app builder.

But thanks for your initiative. I am also considering some customisations, for example a link inside the widget to upload some featuresets to the portal.

All the best,

Peter

RebeccaStrauch__GISP
MVP Emeritus

And just to let you know, I can't take any credit for the development of the widget, that's all Adam and Robert, so far.  So if you are planning on collaborating on widget additions (i.e. to share), I would work with them on the github site to see what's in the works. 

PeterMoeller-Christensen
New Contributor

I would love to, hope my ugly code can stand the light of the day

Peter

RebeccaStrauch__GISP
MVP Emeritus

I can relate.

BillSpiking__GISP
Occasional Contributor

Hi Rebecca, thank you so much for taking the time to document the procedures for deploying the LL widget.  Great job!

What are the steps that you use for upgrading to the latest version of the LL widget?  Every time I upgrade my version I loose my pop-up configurations in the gui.  I can see the pop-up configuration in the server/apps/#/configs/LocalLayer/config_Local Layer Widget.json, but it's not showing up in the gui.

Thank you,

Bill

RebeccaStrauch__GISP
MVP Emeritus

Hi Bill,

--- sorry for the delayed response....I wrote most of below on my ipad on Friday, and either the iPador GeoNet "ate my homework" without recovery....ah, but this morning at least part of it was there....  ---

I've been thinking I need to add notes on upgrading and other custom tweaks. I see there is a new version 1.5.1, so I will update my documentation to include tips for upgrading.

Until then, a short answer as to what I've done.  If I'm just replacing the LL widget, I first unzip the new version to a temp location. I then rename it to match the folder name of the one I have been using.  I mention this only because the unzipped folder may or may not be the same.  I then rename the one that was in the WAB folder(s), copy this one over and copy any customization I did outside of the widgets GUI.

Remember, that besides copying the updated widget to your ../apps/#/..  you also need to update the \client\stemapp\widgets version.

-Rebecca

PeterMoeller-Christensen
New Contributor

Dear Rebecca,

I have played a bit with the LocalLayers widget and added some search functionality. Do you think I should post the code somewhere?

Kind regards

Peter Møller-Christensen

Integrated Business Technology

D +45 5161 7239

pmc@ramboll.dk<mailto:pmc@ramboll.dk>

BillSpiking__GISP
Occasional Contributor

Not a problem at all Rebecca! Thank  you for the reply.

I'm following the same steps for updating the LL windget, though for some reason I'm loosing my Custom pop-up configs after updating.

I'll do some more testing and see if it's a bug or an issue w/ my workflow for updating.

Regards,

Bill

PeterMoeller-Christensen
New Contributor

Thanks for copying me Bill. I have made some adjustments to the LocalLayer, I wonder if I should post it somewhere when it’s complete? It allows searching for layers instead of pasting the REST url.

Kind regards

Peter Møller-Christensen

Integrated Business Technology

D +45 5161 7239

pmc@ramboll.dk<mailto:pmc@ramboll.dk>

BillSpiking__GISP
Occasional Contributor

Hi Peter, I believe all updates to the LL widget are being managed via Github.

cmndrbensisko/LocalLayer · GitHub

RebeccaStrauch__GISP
MVP Emeritus

Bill is correct on direct updates to the LL widget.  If you just want to post value-added code, that may not go into the widget, I would post them Web AppBuilder Custom Widgets‌   And in particular, https://community.esri.com/message/454858?et=watches.email.thread#454858  If you want to suggest an enhancement but don't want to do the coding.

I have several tips that aren't enhancements to the widget, but are tips for additional tweaking, especially for updating to new versions.  I've been documenting some of this and hope to post later today.

PeterMoeller-Christensen
New Contributor

Thanks Rebecca and Bill,

I think I’ll post it as value added code when it is ready.

Regards,

Peter

RebeccaStrauch__GISP
MVP Emeritus

Thanks Peter, and just fyi - I'm trying to gather value-added posts, when I find them, and add links to them to my tips documents.....with a recap if the original post gets too long.  So thanks in advance. 

RebeccaStrauch__GISP
MVP Emeritus

Bill,

I believe you are looking at the correct file for you pop-ups

server\apps\##\configs\LocalLayer\config_Local Layer Widget.json

Check to make sure all your  (various brackets)     () {} []   are balanced, and comma's are where they are supposed to be.  I've noticed that when I'm doing the copy and paste for updating (or re-arranging), if anything is out of place, I don't necessarily get an error, but things just don't show.  I've have this happen in my attribute config file a few times....no error, but the arrow for the attribute tables doesn't show (and yet the config UI works).  My guess is pop-ups are the same.

If you are using an editor that understands JavaScript code (and there are many), you typically can highlight one end and it will show you the matching bracket, as it sees it.  By process of elimination you can trace the problem. Each editor have it's own way of showing the matching pairs.  I use Brackets - A modern, open source code editor that understands web design. but there are many.

RebeccaStrauch__GISP
MVP Emeritus

I created a new post for Updating the widget, and some additional customization tips.  I thought this post might get too long otherwise. 

Tips (LocalLayer widgets) for more customization and Updating (may help with others too)

It will be a work in progress too, as I add things as I see them (and thought of something I forgot, already)

DanielStoelb
Occasional Contributor III

I'm having issues trying to figure out how to set up a definition query for the layers that I'm loading into the local layer widget without having to redo the service from the server.  Do you have an idea on how this can be done using the local layer widget code?

RebeccaStrauch__GISP
MVP Emeritus

Hi Daniel,

I would suggest posting you question in the

Web AppBuilder Custom Widgets  group so those that can help have a better chance of seeing it.  I'm away from my office desk for a few days, so I'm not much help trying to test anything, and Adam and Robert ...and others can probably respond sooner.

YiQi1
by
New Contributor

Web Appbuilder just released version 1.2. Daniel's comments give instruction on how to make locallayer widget visible in predefined templates. Are there any other configuration that are needed to make locallayer useable? The readme file in the zipped download from GitHub shows a few lines of code to be changed in version 1.0 and 1.1, but that instruction seems not feasible for version 1.2.

Thank you for your hard work!

RebeccaStrauch__GISP
MVP Emeritus

https://community.esri.com/message/544487?tstart=0#544487

I think Robert/Adam is still working on an update for 1.2.  You can follow the conversation with the link above.

СергейСергей
New Contributor II

Hi. Add your own widget and everything seems to be working, but today no longer displayed layers from arcgis server. The server itself is functioning normally. Can you have any advice?

RebeccaStrauch__GISP
MVP Emeritus

I Would check to make sure all your brackets ( ) { } [ ] are balanced and other syntax is correct.  If all that is fine, you should post you question in Web AppBuilder Custom Widgets​ and share with ArcGIS for Server​ which will give you more possible answers.  Posting you code will help...follow Posting Code blocks in the new GeoNet​ so others can read it properly.

LefterisKoumis
Occasional Contributor III

Hello Rebecca. I am referring to the screenshot posted under 10/12/2017.

You stated: "making sure the widget\LocalLayer does have another layer of LocalLayer as a subdirectory"

But then in the pdf titled "TipsUsing...." you stated:

"Make sure the LocalLayer is the top folder name of the widget, and not repeated as a subfolder"

Are these two statements contradict each other?

It will be useful to provide a screenshot under the 2D or 3D.

Thanks

RebeccaStrauch__GISP
MVP Emeritus

I think I was missing the word "NOT" so I added that.  It's been a while since I looked at all this, but if I remember correctly, its' just to make sure when you unzip it to a folder, lets say c:\temp  that you cont get c:\temp\LocalLayer\LocalLayer\<other stuff>

Sometimes the zip or how up unzip the zip will "double-up" the folder name.  Other sime, you may get a _master appended to the folder.  Those are the things you need to watch for.  

I would not mess with and of the files under the 2D/3D folders unless modifying them intentionally.

LefterisKoumis
Occasional Contributor III

so, if we don't mess with the folders, it is ok to have the LocalLayer folder name twice?

How the app will access the widget.js under locallayer/2d/locallayer/ 

with this entry in app's config.json:    "uri": "widgets/LocalLayer/Widget" ?

Thanks.

RebeccaStrauch__GISP
MVP Emeritus

yes.  this is what mine looks like under the widgets folder...

At least that is what I had done....but again, I have't used it for a while.  Did you check out the link in that step?

https://community.esri.com/thread/203359-is-there-a-problem-with-wab-25-and-locallayer-25-i-cant-see... 

That may help more.

About the Author
Worked with GIS for 30+ years for the Alaska Dept of Fish and Game.