ArcGIS Online - Web App Templates not working?

2731
9
Jump to solution
05-22-2017 08:50 AM
by Anonymous User
Not applicable

I created two different web map applications using the available templates in ArcGIS Online.  At first these web map applications worked great, but now they open slowly and the base map data is missing.  Has anyone else ran across this?  The only change I made was to access via https instead of http so that the "My Location" feature would work on mobile devices.  I tried switching them back and they have the same problem.  All of my data layers are accessed via https and everything shows up great in the web maps (which is used as the basis for the web map applications).  I can use the web maps to create applications in WAB and those work no problem.  It just seems to be these that I created using one of the templates.  Really strange!  I even tried creating brand new web map applications using the same templates and get the same result of no data in the web map application.  I put the link to the websites below.

1. Directions Web Mapp Application - https://onslow.maps.arcgis.com/apps/Directions/index.html?appid=24758cf9f9de4ed488c090b22ea061c5 

2. Smoke Alarm Installs Web Map Application - https://onslow.maps.arcgis.com/apps/View/index.html?appid=676498bcd8d544799355eddc23fad840 

0 Kudos
1 Solution

Accepted Solutions
RandallWilliams
Esri Regular Contributor

Ah, I got it. It's the routing service. It's expecting that a token be supplied as routing consumes credits. When the app detects that credentials haven't been provided, it redirects a user to your org login page. That issue is specific to the directions app.

https://developers.arcgis.com/features/directions/

Looking at the smoke alarms map:

From where I'm sitting, it looks like the basemaps render, but your web services from your GIS Server don't.

The issue here is "Mixed Content". You're requesting the app and the basemaps using HTTPS, but the local services from your ArcGIS Server install were added to the map over HTTP. Browsers don't like to render both HTTP and HTTPS content at the same time.

Personally, I'd go back and add your services back to your organization using the HTTPS prefix.

View solution in original post

0 Kudos
9 Replies
RandallWilliams
Esri Regular Contributor

Hi Angelia,

I'd start looking at this by opening the F12 Dev tools in your browser and have a look at the traffic. This sounds kind of like a mixed content issue. When I tried to look at your apps it looks like they're not shared to the public - I was redirected to your organization log in page.

0 Kudos
by Anonymous User
Not applicable

The strange thing is that they are shared with the public.  I have checked on "Everyone (Public)" for all data layers, all web maps, and the web map applications.  I'm not sure what else I can do to share it with the world.  Am I missing a setting?  I deleted and recreated the Directions applications.  New URL: http://onslow.maps.arcgis.com/apps/Directions/index.html?appid=18bb5e29bddb429a82f107633dc1cf8b 

0 Kudos
RandallWilliams
Esri Regular Contributor

Ah, I got it. It's the routing service. It's expecting that a token be supplied as routing consumes credits. When the app detects that credentials haven't been provided, it redirects a user to your org login page. That issue is specific to the directions app.

https://developers.arcgis.com/features/directions/

Looking at the smoke alarms map:

From where I'm sitting, it looks like the basemaps render, but your web services from your GIS Server don't.

The issue here is "Mixed Content". You're requesting the app and the basemaps using HTTPS, but the local services from your ArcGIS Server install were added to the map over HTTP. Browsers don't like to render both HTTP and HTTPS content at the same time.

Personally, I'd go back and add your services back to your organization using the HTTPS prefix.

0 Kudos
by Anonymous User
Not applicable

Thanks for the quick reply.  Does this mean the Directions template cannot be used to create public web map applications?

I'll initially added my data layers for the smoke alarms map using http but then discovered that the "My Location" widget wouldn't work unless everything was accessed via https.  I went back and change the URL for everything to https and saved but maybe the change didn't take affect properly.  I'll add them again via https as new data layers and see if that fixes the problem.

0 Kudos
RandallWilliams
Esri Regular Contributor

You can use the routing tools and directions template publicly. In this case, I think that the workflow is like this (I'm trying to find the DOC):

a.    Right now, your org is configured to use the default routing service. Your browser is passing the credentials of your current ORG account to the routing server.

b.    What needs to happen in this case is to use ArcGIS.com to create a proxy to automatically pass your organization credentials when using routing - but understand that this will consume credits.

c.      To do that, you can add this as an item to your 'My Content' on ArcGIS.com: https://route.arcgis.com/arcgis/rest/services/World/Route/NAServer

d.      When you press 'OK', you should be prompted for credentials. Provide your named user credentials, and choose the option to 'save credentials'. This will create the proxy.

e.    Now when the item is created, in the bottom right of the items detail page, you should use a URL. It should read like the URL is for https://utility.arcgis.com/usrsvcs... - not https://route.arcgis.com. Use the 'copy' button to copy this URL.

f.    Finally, in My Organization>Edit settings>utility services, paste the URL copied in step 'e' above in to the 'Directions and Routing' combo box.

I'm unsure which changes, if any, you'd need to adjust on the app side. It may just be to reconfigure the routing widget to use the URL from https://utility.arcgis.com, as that URL routes through the proxy you created when you saved the credentials with the item.

RandallWilliams
Esri Regular Contributor
0 Kudos
by Anonymous User
Not applicable

Here is the link to the base map: http://onslow.maps.arcgis.com/home/webmap/viewer.html?webmap=a955543922b148fa93cad48cdcf843dd 

I tested it out and it doesn't require or prompt the user for a login so I cannot understand why the web mapping application (which has the exact same share settings) does.

0 Kudos
by Anonymous User
Not applicable

Originally when I created the "Needed Smoke Alarm Installs" web map application I wanted the "My Location" widget to work on mobile devices.  Turns out in order to get this widget/tool to work, absolutely everything in the web map (base map) needs to be accessed via https and the url for the application itself needs to be accessed via https.  When I originally added my layers I did it using http for the urls, not https.  I went back in to each data layer and changed the url to https but didn't change anything else.  This is when the data layers started not displaying in the web templates.  Based on your feedback of mixed content of http and https traffic, I went back and changed my data layers back to http.  Then I went in and added all new data layers (sames ones actually but freshly added as if new) but used the https url from the start.  Went in and added the data layers to my original base map and removed the old ones.  The template picked up the changes to the base map and seem to be displaying the data without issue.

https://onslow.maps.arcgis.com/apps/View/index.html?appid=676498bcd8d544799355eddc23fad840 

Your feedback was helpful and I was able to (hopefully, fingers crossed) get this template working again.  How were you able to tell that the website had a mix of http and https?

0 Kudos
RandallWilliams
Esri Regular Contributor

When I opened your app, I hit the F12 button and refreshed the page. In most browsers these days, F12 will bring up the debug console.  The debugger captures and enumerates all the requests and responses the browser is making and receiving from resources on the web. From in the debugger I clicked the console tab, which showed me a few errors that I knew to be related to security mismatches. I then clicked the 'network' tab, where I could see the ArcGIS Server endpoints your application was referencing and saw that the protocol over which the services were requested was http instead of https.

In general, websites are a hodgepodge of resources, images, and web services collected from all over the place and presented in one aggregated form. The debugger can help us see from where these resources are coming from, manipulate resources on the fly, issue requests and queries to the application server, find bottlenecks, etc.

0 Kudos