WebGL detection with arcgis/cli application

277
2
Jump to solution
06-27-2018 12:30 PM
NicolasGIS
Regular Contributor

Hi !

Might be simple but I can't find a way to detect WebGL using a fresh arcgis/cli application.

I try to apply the same principle as described in this tutorial:

Detect WebGL support | ArcGIS API for JavaScript 4.7 

In this app, I believe it should be handle in AppViewModel but I can't find a way to "catch" the fact the view was rejected. I even tried directly after creating the view  in 'onAfterCreate' method of the app View but it still never catch that the view is rejected.

Could it be because of the webpack configuration ?

Any idea ?!

Thanks !

0 Kudos
1 Solution

Accepted Solutions
ReneRubalcava
Frequent Contributor

With that sample, it's using SceneView, so that works a little different than a MapView.

SceneView won't work at all without WebGL, but MapView doesn't need WebGL, so it doesn't throw an error without WebGL. The cli template app, has it enabled by default and uses VectorTiles which do require it not matter what.

You can do your own detection up front though.

Detect WebGL - Learn web development | MDN 

That would be a good solution.

View solution in original post

0 Kudos
2 Replies
ReneRubalcava
Frequent Contributor

With that sample, it's using SceneView, so that works a little different than a MapView.

SceneView won't work at all without WebGL, but MapView doesn't need WebGL, so it doesn't throw an error without WebGL. The cli template app, has it enabled by default and uses VectorTiles which do require it not matter what.

You can do your own detection up front though.

Detect WebGL - Learn web development | MDN 

That would be a good solution.

View solution in original post

0 Kudos
NicolasGIS
Regular Contributor

Of course ! It is a sceneView !

Thanks for the quick reply !

0 Kudos