Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds handling for browsers where WebGL is disabled or unavailable #49

Merged
merged 1 commit into from
Oct 19, 2018

Conversation

romeboards
Copy link
Contributor

This was a tricky one. Apparently there is little or no accounting for this - I looked through react-mapbox-gl and tried some of the event handlers (onWebGlContextLost, onError?) but they didn't seem to affect anything.

So in the meantime I threw in some code that detects if the browser has WebGL or not (see MapHelpers), and throws up a terrible error message and doesn't allow the user to use the map at all:

image

How to reproduce

You can disable WebGL/hardware acceleration on Chrome in Settings > Advanced Settings > Use hardware acceleration when available:

image

@toolness @sraby interested to hear your thoughts! Specifically it would be good to know if we can find a way to degrade this in a better fashion so a version of the map could still maybe be displayed...

@toolness
Copy link
Contributor

Oh interesting... what happens if you use canvas.getContext('3d') or something? I thought that was the canonical way to detect whether 3D was supported but I dunno.

@romeboards
Copy link
Contributor Author

@toolness yeah I found the logic here: mapbox/mapbox-gl-js#3437 (comment)

@sraby
Copy link
Member

sraby commented Oct 16, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants