Select to view content in your preferred language

Suspend map drawing

1290
3
10-19-2011 06:21 AM
SteeveCouture
Emerging Contributor
Hello,

Is there a way to disable (or suspend) the map drawing during a moment? By example, if I unselect 500 elements of 1000 elements for a GraphicsLayer, that operation is very long (there's severa refresh).  May be, a workaround is to set the GraphicsLayer not visible.

An another example is if I add some layers (like 10) in map control, could I disable drawing to avoid to add to much redraw for each add?

What is the best pattern?

Thanks,
Steeve
0 Kudos
3 Replies
JenniferNery
Esri Regular Contributor
Are you using Draw class as shown in this SDK sample? http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#DrawGraphics. If yes, Draw.IsEnabled=False or Draw.Mode=DrawMode.None will disable draw.
0 Kudos
SteeveCouture
Emerging Contributor
No, sorry.  I don't talk about the Draw object.  I mean to suspend the Map refresh when I change the Graphic element state (like Selected property) in GraphicsLayer. An another example if I remove 500 Graphics from GraphicsLayer (total count is 1000), it's very long because I thought there's lot Map refresh.

I'm perhaps not clear.

Steeve
0 Kudos
JenniferNery
Esri Regular Contributor
What version of the API are you using? Can you share some code and steps to reproduce this? I don't understand why selecting/deselecting graphics from GraphicsLayer will cause a re-draw on the map. Could you perhaps been calling layer.Refresh() in your code? Map triggers layer.Draw when pan/zoom is completed, map size changed, layers initialized.
0 Kudos