Select to view content in your preferred language

Toggle 3D to 2D KO since v4.30

267
2
08-09-2024 05:35 AM
BenjaminLecuona
Emerging Contributor

Hello all,

Since upgrade to last version of ArcGIS Maps SDK (v4.30), I am unable to switch back from 3D to 2D, obtaining error log "Uncaught TypeError: Cannot read properties of null (reading 'symbologySnappingSupported')".

Here is a sample code reproducing my issue (https://codepen.io/blecuona/pen/OJejdoe?editors=1011).

Differences with Esri sample code ([https://developers.arcgis.com/javascript/latest/sample-code/views-switch-2d-3d/](https://developers.arcgis.com/javascript/latest/sample-code/views-switch-2d-3d/)) which perfectly works are:
1. There is a layer on map
2. This layer is shared between mapView and sceneView
3. A measurement widget is set on map
4. This layer's renderer is reset on mapMode change (2D - 3D)

After many checks, renderer update (difference 4) while measurement widget is opened (difference 3) is responsible of the bug.

Is there any solution keeping this code logic? Or should I stay with ArcGIS Maps SDK v4.39?

Thanks for your help.

2 Replies
GreteSoosalu
Esri Contributor

Hi @BenjaminLecuona 

Thanks for pointing out this issue! We'll have this fixed in the upcoming release of the Maps SDK v4.31.  Meanwhile, if you want to test the fix before it heads to production, check out the development version of the API: https://js.arcgis.com/next and please let us know if you have any feedback.

A workaround for v4.30 is to avoid using the same layer for 2D and 3D, like in this copy of your app: https://codepen.io/gsoosalu/pen/BagYYbx.

 

0 Kudos
BenjaminLecuona
Emerging Contributor

Thanks for your reply. I can confirm the fix is ok!