Select to view content in your preferred language

How Clear Graphics?

3927
3
02-10-2015 01:27 AM
Asgharkhan
Regular Contributor

query working but when i close query user control , the Graphics still in map, my code is

GraphicsLayer graphicsLayer = this.MapControl.Layers["MyGraphicsLayer"] as GraphicsLayer;

i use this codes

  this.MapControl.Layers.Clear();

Then all Layers invisible

any idea?

0 Kudos
3 Replies
HabG_
by
Frequent Contributor

Hi Asghar,

Can you post some more codes?

Hab

0 Kudos
HabG_
by
Frequent Contributor

Hi Asghar,

See if this can help.

                    GraphicsLayer graphicsLayer = MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer;

                    graphicsLayer.ClearGraphics();

                  

Hab

0 Kudos
Asgharkhan
Regular Contributor

Fixed!!!!!

This Code Worked

  protected override void OnClose()

        {

            GraphicsLayer graphicsLayer = MapControl.Layers["MyGraphicsLayer"] as GraphicsLayer;

            graphicsLayer.ClearGraphics();

            base.OnClose();

        }

Thanks

0 Kudos