laptop and a wrench

Bug

The Sketch widget graphics are drawn behind layers brought in through an ArcGIS Online web map.

Last Published: August 7, 2019 ArcGIS API for JavaScript
Bug ID Number BUG-000123451
SubmittedJuly 1, 2019
Last ModifiedJune 5, 2024
Applies toArcGIS API for JavaScript
Version found4.12
StatusNon-Reproducible

Additional Information

GraphicsLayer is added before the view is ready. Update the code to the following and it works correctly: var layer = new GraphicsLayer(); const map = new WebMap({ portalItem: { id: '3acfce904368451f82b60d5c8a120f82' }}); const view = new MapView({ container: "viewDiv", map: map, zoom: 5, center: [-74, 45] }); view.when(function(evt) { map.add(layer); var sketch = new Sketch({ layer: layer, view: view }); view.ui.add(sketch, "top-right"); })

Workaround

Repeat the above steps with this jsbin: https://jsbin.com/tatatedece/edit?html,output

The workaround is to add the image service directly to the map versus adding in the web map and consuming it via ArcGIS API for JavaScript.

Steps to Reproduce

Bug ID: BUG-000123451

Software:

  • ArcGIS API for JavaScript

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options