Select to view content in your preferred language

Enable WebGL Feature Layer in Web AppBuilder Developer Edition 2.8

1793
5
05-14-2018 08:47 PM
Jianxia
Esri Regular Contributor
2 5 1,793

The WebGL rendering of feature Layer allows you to display more data in the map and update the visualization of features more rapidly. Although it is not supported in Web AppBuilder Developer Editon 2.8, you can manually opt in with the steps below.

1. Find the init.js file in the client/stemapp folder
2. Add a line to dojoConfig:

 

dojoConfig = {
   parseOnLoad: false,
   async: true,
   tlmSiblingOfDojo: false,
   has: {
   'extend-esri': 1,
   // add this line
   'esri-featurelayer-webgl': 1
   }
};

3. Save the file
3. Start Web AppBuilder Developer Edition 2.8 and create a new 2D app

To verify whether the layer is rendered in WebGL, access the layer through this.map.getLayer in the Widget.js file. Then call the following properties and method:

var layerId = this.map.graphicsLayerIds[0];
var layer = this.map.getLayer(layerId);

console.log("webgl enabled on map? ", this.map.webglEnabled);
console.log("webgl enabled on layer? ", layer.webglEnabled);
console.log("layer drawn with webgl? ", layer.hasWebGLSurface());

Also, see known limitations for the WebGL Feature Layer.

5 Comments
About the Author
Product Manager for ArcGIS Experience Builder and ArcGIS Web Appbuilder. She likes camping and hiking.