select a text graphics (annotation)on map and delete it arcgis javascript

3060
12
02-29-2016 10:34 PM
ADITIROY
New Contributor III

Hello,

I have graphics on the map and i just want to delete the selected text graphics on button click. Please suggest how to do this.

Thanks for help.

Regards,

Aditi

Tags (3)
0 Kudos
12 Replies
MiriamBrockmann
Occasional Contributor

Hi Aditi!

No, it wont do when you copy the code one to one. There are two possible ways :

1. You can highlight the Points, where the Text is anchord or

2. change the Textcolor by looping through the selected Geometries and change the Textcolor.

Regards

ADITIROY
New Contributor III

Thank you Miriam,

But is there any code which can be integrated to this code below to make selection work instead on button click, it will work by drawing rectangle on  the text graphic and highlighting the selected text.

on(dom.byId("select"), "click", function () {

             

                that.map.graphics.on("click", function (evt) {

                    that.selected = evt.graphic;

                       });

});

Thank you again.

0 Kudos
MiriamBrockmann
Occasional Contributor

There's no code i can offer you, which you can copy and paste.

I would suggest you write a Shedule what you want to program, what should happend when in which Order, which tools you need for and then write your code.

Above is all you need to do what you want.

0 Kudos