Modifying IdentifyWidget for multi-selection

751
5
Jump to solution
12-06-2018 12:02 AM
shamnaspc2
New Contributor

Hello Robert,

I am currently using your identify widget, and I have a question regarding modifying it. How do I modify the code in Widget.js to allow the fill in selected polygons to remain without disappearing when I select another polygon? Currently I have modified the widget to have a ongoing list so that I can add and remove multiple polygons from the map to the results list as well as removing them. So I just need the map to also reflect which polygons have been selected using the polygon fills, and remove them when their results are removed as well.

Thank you for your assistance,

Shamnas

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Shammas,

   That is because the draw tool uses the same graphics layer in the _onDrawEnd function. You would need to make this change:

      _onDrawEnd:function(graphic, geotype, commontype){
        this._hideInfoWindow();
        this.drawBox.clear();

        this.map.graphics.clear();
        this.map.graphics.add(graphic);‍‍‍‍‍‍
...

View solution in original post

0 Kudos
5 Replies
RobertScheitlin__GISP
MVP Emeritus

Shammas,

  Just look for 

this.graphicsLayer.clear();
0 Kudos
shamnaspc2
New Contributor

Thanks! I commented them out and it worked. However, the points that I clicked on did not disappear when I remove them from the results. Attached a picture showing the effect.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Don't forget to mark this question as answered by clicking on the "Mark Correct" link on the reply that answered your question.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Shammas,

   That is because the draw tool uses the same graphics layer in the _onDrawEnd function. You would need to make this change:

      _onDrawEnd:function(graphic, geotype, commontype){
        this._hideInfoWindow();
        this.drawBox.clear();

        this.map.graphics.clear();
        this.map.graphics.add(graphic);‍‍‍‍‍‍
...
0 Kudos
shamnaspc2
New Contributor

Thank you so much! That helped me a lot.

0 Kudos