How to Use WebGL with ArcGIS API for JavaScript 3.24

3128
2
Jump to solution
05-04-2018 11:12 AM
BehrouzHosseini
Occasional Contributor

Starting with 3.24 of ArcGIS API for JavaScript we can opt in to render FeatureLayer with WebGL.

According to ESRI This allows to display more data in the map and update the visualization of features more rapidly. To enable WebGL rendering of FeatureLayer, we need to paste the following script in the application prior to loading the ArcGIS API for JavaScript:

  <script>    var dojoConfig = {      has: {        "esri-featurelayer-webgl": 1      }    };  </script>

but looking at This sample I am not really seeing any difference between having the webgl or not on performance speed. Can you please let me know what I am doing wrong?

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Behrouz,

   You missed the part of the documentation that talks about the limitations:

Known Limitations

The following are current limitations of WebGL-rendered FeatureLayers subject to change in future releases. If any of these conditions are not met, then the layer will automatically switch from WebGL to SVG during the session.

  • Support is limited to layers created from feature services hosted on ArcGIS Online. Non-hosted enterprise feature services will be supported at the ArcGIS Server 10.6.1 release. FeatureLayers created from FeatureCollections are not supported.
  • Polygon layers must support returning centroids.
  • The layer must not be editable.
  • The layer must not be clustered.
  • The layer must use on-demand fetch mode.
  • The layer must not use labels.
  • The layer must not use Arcade expressions containing geometry operations.
  • The layer's renderer must be of type SimpleRenderer, ClassBreaksRenderer, or UniqueValueRenderer.
  • Color and opacity visual variables must have 8 stops or less.
  • Attribute-driven size visual variables must have 6 stops or less. This does not affect variables driven by map scale.
  • Line symbols must not have arrow markers.
  • Marker symbols must not have CROSS or X styles.
  • Marker symbols must not use x/y offset or angle properties.
  • Selection symbol is not supported.

Note that only the click event will fire when WebGL is enabled. All other events are not supported. FeatureLayer subclasses do not support WebGL rendering. Also note that modifying attributes, symbol, geometry and visibility of individual features in a WebGL-rendered layer will NOT have any effect.

View solution in original post

0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus

Behrouz,

   You missed the part of the documentation that talks about the limitations:

Known Limitations

The following are current limitations of WebGL-rendered FeatureLayers subject to change in future releases. If any of these conditions are not met, then the layer will automatically switch from WebGL to SVG during the session.

  • Support is limited to layers created from feature services hosted on ArcGIS Online. Non-hosted enterprise feature services will be supported at the ArcGIS Server 10.6.1 release. FeatureLayers created from FeatureCollections are not supported.
  • Polygon layers must support returning centroids.
  • The layer must not be editable.
  • The layer must not be clustered.
  • The layer must use on-demand fetch mode.
  • The layer must not use labels.
  • The layer must not use Arcade expressions containing geometry operations.
  • The layer's renderer must be of type SimpleRenderer, ClassBreaksRenderer, or UniqueValueRenderer.
  • Color and opacity visual variables must have 8 stops or less.
  • Attribute-driven size visual variables must have 6 stops or less. This does not affect variables driven by map scale.
  • Line symbols must not have arrow markers.
  • Marker symbols must not have CROSS or X styles.
  • Marker symbols must not use x/y offset or angle properties.
  • Selection symbol is not supported.

Note that only the click event will fire when WebGL is enabled. All other events are not supported. FeatureLayer subclasses do not support WebGL rendering. Also note that modifying attributes, symbol, geometry and visibility of individual features in a WebGL-rendered layer will NOT have any effect.

0 Kudos
nicogis
MVP Frequent Contributor

Extra info:

you need paste the following script in your application prior to loading the ArcGIS API for JavaScript

<script>
 
var dojoConfig = {
    has
: {
     
"esri-featurelayer-webgl": 1
   
}
 
};
</script>

In fact your sample I see that service isn't called with f=pbf

0 Kudos