Skip to content

Commit 63dfebd

Browse files
committed
Fix 3D View
1 parent 9078c9e commit 63dfebd

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

arcgis_map_sdk_web/lib/src/arcgis_map_web_controller.dart

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,10 +271,16 @@ class ArcgisMapWebController {
271271
}
272272

273273
if (webgl2 != null) {
274-
(webgl2 as WebGLRenderingContext)
275-
.getCustomExtension('WEBGL_lose_context')
276-
?.loseContext();
277-
webgl2.getCustomExtension('WEBGL_lose_context')?.restoreContext();
274+
// WebGL2 context needs to be handled differently than WebGL1
275+
final loseContextExtension = callMethod(
276+
webgl2,
277+
'getExtension',
278+
['WEBGL_lose_context'],
279+
);
280+
if (loseContextExtension != null) {
281+
callMethod(loseContextExtension as Object, 'loseContext', []);
282+
callMethod(loseContextExtension, 'restoreContext', []);
283+
}
278284
}
279285
}
280286

0 commit comments

Comments
 (0)