I have an app created that allows users to swap views between 2D and 3D, similar to the sample app used for the Calcite Maps Style Explorer. Now that the Sketch widget is available in 3D in 4.11 I'm trying to get the widget synced between views however I'm running into an issue. When I first create the widget in 2d, everything works as expected. You can create sketch graphics and you can click on the graphic to start updating it. Here is a sample of how my code looks when the widget is first created in 2d:
var sketch = new Sketch({
view: mapView,
layer: graphicsLayer
})
When the user switches views I assign the sketch widget view to the new view, SceneView, like so:
sketch.view = sceneView
This works to an extent. The sketch widget is still visible on the map and will let you sketch new graphics. However you can no longer click on a created graphic to update/transform it, it is like the hitTest no longer works. This problem persists when the user switches back to 2d. As before, I assign the sketch widget view back to mapView, like so:
sketch.view = mapView
And now the same problem occurs. You can add in new graphics but you can no longer click on a graphic to update/transform it. It only adds the graphic to the screen and nothing more. The only time that the widget fully works as expected is when the app is first loaded. After that, once the user switches views, it will only allow the user to sketch new graphics and they can no longer select a graphic to update/transform/delete.
Can someone point me in the right direction and tell me what I'm doing wrong? Has anyone figured out how to sync the new Sketch widget yet so you don't lose functionality when changing views?