SceneView webgl support detection

1014
1
10-18-2016 08:26 PM
NickCameron2
New Contributor III

Hi,

The examples given for detecting webgl in the browser aren't working on newer devices (possibly older ones too, but I haven't tested on them).

I've tried on an iPad running IOS 10.0.2, and a Galaxy S6 using Chrome 53.0.xxx.

It appears the devices do support webgl in some sense, but SceneView's don't render correctly.

The otherwise() callback is not hit, instead then() is as per normal.

This sample page will load up the scene view but only display a dark sphere for the earth -

Detect WebGL support - 4.1 

Cheekily on the description pages for the samples this user agent check is actually used to test if the iframe containing the live sample with a scene view should be loaded.

/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(navigator.userAgent)‍‍

So you get the unsupported message on those pages correctly as in here.

Detect WebGL support | ArcGIS API for JavaScript 4.1 

I personally don't mind relying on the user agent check - but is this something that needs to be done for the moment and if so will it be addressed in a future release? An update to the samples documentation might be in order though.

Thanks,

Nick

Tags (2)
1 Reply
JadeFreeman
Occasional Contributor III

I've found many of the SceneView examples work just fine on my iPhone and iPad.  webglreport.com reports that my iPhone 6 supports WebGL 1.  

In an application I'm working based on a webscene, everything works fine, including setting elevationInfo, adding callouts to symbols and setting featureReduction to 'selection', on mobile devices I've tested until I set screenSizePerspectiveEnabled to true on a feature layer in the application.

It would be useful if the API documentation would clarify which WebGL features individual classes or functionality needed so we could test for support.

In my application, I ended up just set screenSizePerspectiveEnabled to false when the height or width breakpoint is 'small' or 'xsmall'.  I'm sure there is a better way to handle this but this approach works for now.

0 Kudos