Clear all graphics in MessageLayer

3169
2
Jump to solution
09-11-2013 01:02 AM
Labels (1)
EstherColero
New Contributor III
Hi all!!

We are creating a map to display military symbols, so we use a MessageLayer with SymbolDictionaryType.App6B.

Every minute, we need to clear all graphics and reload from a web service. Create and process a message to insert a new element is not a problem, but, how can I clear all graphics in the MessageLayer? There is not an element ID to create an update message, and store all the elements in an alternative list to send a delete message one to one is not efficient 😞

Regards
Esther
0 Kudos
1 Solution

Accepted Solutions
MichaelBranscomb
Esri Frequent Contributor
Hi,

You raise a good point. Unfortunately there isn't an API method to simply clear the Messages from a MessageLayer, without processing a Remove action for each message you want to remove. However, if you always want to get rid of all of them then you could try removing the layer from the Map, and instantiating a new layer?

I've taken note of your suggestion for a future release.

Cheers

Mike

View solution in original post

0 Kudos
2 Replies
MichaelBranscomb
Esri Frequent Contributor
Hi,

You raise a good point. Unfortunately there isn't an API method to simply clear the Messages from a MessageLayer, without processing a Remove action for each message you want to remove. However, if you always want to get rid of all of them then you could try removing the layer from the Map, and instantiating a new layer?

I've taken note of your suggestion for a future release.

Cheers

Mike
0 Kudos
EstherColero
New Contributor III
Thank you Mike,

I also thought about that option and maybe is the best option for the current API.

I appreciate that you are going to consider my suggestion for future versions 🙂

Regards
Esther
0 Kudos