WebGL Contexts Error

3586
14
12-18-2018 09:23 AM
joerodmey
MVP Regular Contributor

Get this error when adding layers to my AGOL web map:

What's causing such a problem?

0 Kudos
14 Replies
KatieCullen
Regular Contributor II

1. Is the layer a vector tile layer hosted in ArcGIS Online?

2. Are you adding this to a previously created map that already contains other layers? If so:

a. What other types of layers are in this map?

b. How many of each type are in the the map?

3. Do you get this message if you add the layer to a new map? 

0 Kudos
joerodmey
MVP Regular Contributor

Yes to all

There are tile layers and other vector tile layers. I've followed this process previously with success.

0 Kudos
KatieCullen
Regular Contributor II

How many layers? 

0 Kudos
joerodmey
MVP Regular Contributor

When I got this error I had about 20 total layers...in the end I will probably have around 100 layers

0 Kudos
MikeMinami
Esri Notable Contributor

WebGL (Web Graphics Library) is a JavaScript API used to draw 2D and 3D graphics in a web browser. The ArcGIS JavaScript API 3.x and 4.x use WebGL to draw some layers.

The short answer

You've reached the limit of the number of layers you can add to your map for layers that utilize WebGL.

The longer answer

The web browser has a limit of about 16 WebGL Contexts and the ArcGIS JavaScript API 3.x, upon which the map viewer is currently built, utilizes one context per layer. A vector tile layer will always utilize a WebGL context and a feature layer may utilize a WebGL context (if editing is disabled, there are no labels and a few other things AND a context is available). To maximize the use of WebGL contexts, I think you can add the vector tile layers first. So, the limit will be 16 vector tile layers.

The long term solution

When the map viewer is redesigned using the JavaScript 4.x API--which utilizes WebGL contexts differently--you won't encounter this limit.

Mike

DavidColey
Frequent Contributor

Hi Mike - so is there a work around on this?  For us this happens alot when we use the human geography basemap, and a recently created local base map that uses the Light gray base, a local base vector tile, a local detail vector tile as a reference, and a copy of the light gray reference vector tile as a reference.

How do I stop or otherwise disallow my hosted feature layers in the agol or portal map viewer to not utilize webgl?  Is that possible?

0 Kudos
MikeMinami
Esri Notable Contributor

How many layers do you have in your map? Are you approaching 16 layers? Could you make separate maps with less layers?

Are you using the map viewer or have you written your own custom app? If you're using AGOL map viewer, there's not much you can do, other than remove layers. If you're writing your own app, you could disable WebGL for particular hosted feature layers but not others, or alternatively write your app with the JavaScript 4.x API.

Mike

0 Kudos
DavidColey
Frequent Contributor

Hi Mike - some of our sections have to have data explorer and lookup maps with lots of layers.  Think utilities.  Most of staff uses the online web app builder and other online templates so that's not really an option for them.  The WebGL usually behaves in the developer edition of the web app builder (in that you can see all your layers and not lose them during a basemap switch in the app) and in any online webmaps that use a raster base.

A workaround may be that staff has to save a map with a raster base in order to have 16+ visible (but scale-dependent) layers, or that more layers have to be set not visible.  Either seems to work for the most part.  Awaiting the 4x map viewer.

Thanks,

David

JohnBoyd
New Contributor

Is this ever going to be changed?  We just migrated all our web apps off a web server and have discovered this limitation on a hosted and federated portal platform 10.8.1 using the embedded WAB in portal. 

 

Kind of makes life miserable if you published feature services across your viewers or you are trying to consume another service off your platform like FEMA or USGS who have published their services as feature layers.  We went in and changed them all to map services. It is driving our users to perform analysis using the actual portal and not in a WAB, but some users dont like having to hop between 2 processes when they could do everything in a PRO session or ARCGIS desktop.

We also are using the most current version of WAB as imbedded in the portal.  This seems like a education problem as well for most of the community of publishers that ESRI is not effectively socializing 

0 Kudos