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

Object function ArrayBuffer() { [native code] } has no method 'isView' #6669

Closed
talyuk opened this issue May 15, 2018 · 4 comments
Closed

Object function ArrayBuffer() { [native code] } has no method 'isView' #6669

talyuk opened this issue May 15, 2018 · 4 comments

Comments

@talyuk
Copy link

talyuk commented May 15, 2018

Hello! I have Android 4.x with Cordova app, which uses Chrome 30 as webview, and mapbox cannot be displayed because of error:

Uncaught TypeError: Object function ArrayBuffer() { [native code] } has no method 'isView'

It didn't work on some previous versions of mapbox-gl too.
I've tried to use older version (0.36), but I have other errors like below:
image

How to make it work? Thanks a lot.

Mapbox latest (v45)
Android 4.4.2, Chrome 30.0.0 (Native browser)
Device Honor 3c Lite

@talyuk
Copy link
Author

talyuk commented May 15, 2018

I need to say, that I have fallback for unsupported browsers as mapbox.js.
I have found temporary solution: detect webgl support as described here (https://stackoverflow.com/a/41029281), not with mapboxgl.supported():

var supported;

try {
    var canvas = document.createElement('canvas');
    supported = !! window.WebGLRenderingContext && (canvas.getContext('webgl') || canvas.getContext('experimental-webgl'));
} catch(e) { supported = false; }

try {
    // let is by no means required, but will help us rule out some old browsers: http://caniuse.com/#feat=let
    eval('let foo = 123;');
} catch (e) { supported = false; }

if (supported === false) {
    console.log("WebGL is not supported");
}

Therefore this browser will not use mapbox-gl and ArrayBuffer.isView.
I hope mapbox team can comment on this

@jfirebaugh
Copy link
Contributor

What does mapboxgl.supported() return on this browser?

@talyuk
Copy link
Author

talyuk commented May 15, 2018

It returns true

@jfirebaugh
Copy link
Contributor

Okay -- want to submit a PR to https://github.com/mapbox/mapbox-gl-supported that adds a test for ArrayBuffer.isView?

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

No branches or pull requests

2 participants