How to add custom content (secured WMS) to Web AppBuilder app

3616
9
06-29-2016 07:31 AM
MichalGasiorowski
New Contributor III

I want to create simple web app in Web AppBuilder Developer Edition 2.0.

The app should combine an ArcGIS Server service and a secured WMS.

My organization uses Portal for ArcGIS 10.3.1 so I'm not able to add a secured WMS as an item in Portal.

I think I can add secured WMS following the way presented in this example:

Custom layer - WMS | ArcGIS API for JavaScript 3.17

Which files generated by the Web AppBuilder should I modify to add custom content which cannot be adde to Portal items?

According to the example above I'll have to use addLayer method among others.

0 Kudos
9 Replies
MichaelRobb
Regular Contributor II

"My organization uses Portal for ArcGIS 10.3.1 so I'm not able to add a secured WMS as an item in Portal. 

Why not?  Add layer from Web >> A WMS Web Service is available in 10.3.

Alternately, you could look at the LocalLayer widget.

0 Kudos
MichalGasiorowski
New Contributor III

Come on, do you think I didn't try first?

I've also read that secured WMS are supported from Portal 10.4.

I'll try with the LocalLayer widget.

0 Kudos
MichaelRobb
Regular Contributor II

my apologies.

10.4

after looking, I dont think LocalLayer will be useful for your situation .

You were on the right track with the JS API

0 Kudos
JunshanLiu
Occasional Contributor III

There is an add data widget(arcgis.com), could you have a play and check whether it's what you want?

0 Kudos
MichalGasiorowski
New Contributor III

Unfortunately https://  WMS service is 'unsupported' in this widget.

Moreover, added URLs are not saved in the map.

I've also found Add Service Widget - but it also doesn't support secured WMS.

0 Kudos
MichalGasiorowski
New Contributor III

So, we've found there's rather no widget which can help.

I was able to display secured WMS using JS API (with standard WMSLayer).

But I still have no idea which files generated by WAB should I modify to insert my code. Any ideas?

0 Kudos
JunshanLiu
Occasional Contributor III

In jimu.js/MapManager, at line 269, the map object is created. I think you can add your layers here.

Shauna-RaeBrown
New Contributor III

Michal, I've found that I need to make the map in Portal, where you can add a service by using its url.  Then you make the web map app from the Portal map.  I hope that helps.

0 Kudos
MichaelRobb
Regular Contributor II

Shauna,  the issue is not the workflow but that using 10.3  does not support HTTPS WMS services.  10.4 does, I have no problem adding this wms service to a web map for example:

https://mesonet.agron.iastate.edu/cgi-bin/wms/iowa/rainfall.cgi?

I only have access to 10.4 at the moment though, not 10.3.1

0 Kudos