AnsweredAssumed Answered

Sketch widget won't deselect graphics with portal basemap

Question asked by mmacfadden on May 13, 2020
Latest reply on May 13, 2020 by ubatsukh-esristaff

If a map / view is initialized with a basemap from a portal item (as shown below) and we have the sketch widget rendered, we loose the ability to deselect graphics.  

 

const basemap = new Basemap({
  portalItem: {
    id: "f81bc478e12c4f1691d0d7ab6361f5a6"
  }
});

const map = new Map({
  basemap: basemap
});

 

If you draw a square, for example, it will be come selected for update upon creation.  It will be highlighted with the scale/move/rotate tool.  Clicking off the graphic does not deselect it.  If you draw another graphic you can change the selection between the two, but you can not clear the selection by clicking on the basemap.

 

On the other hand if the basemap is initialized as a string for a known id such as "streets" it works as expected:

const map = new Map({
  basemap: "streets"
});

 

I have provided a CodePen which demonstrates the issue:

 

https://codepen.io/michaelmacfadden/pen/qBOyYLX 

Outcomes