private void DrawAndLabelANiceLookingRoad_Load(object sender, EventArgs e) { winformsMap1.MapUnit = GeographyUnit.DecimalDegree; winformsMap1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.FromArgb(255, 233, 232, 214)); inmlayer = new InMemoryFeatureLayer(); inmlayer.InternalFeatures.Add(new Feature("LINESTRING(0 0,10 10)")); inmlayer.InternalFeatures.Add(new Feature(-20, -20)); inmlayer.InternalFeatures.Add(new Feature("POLYGON ((30 10, 10 20, 20 40, 40 40, 30 10))")); inmlayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; inmlayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(LineStyles.Canal1); inmlayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(PointStyles.Capital1); inmlayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(AreaStyles.Country1); LayerOverlay staticOverlay = new LayerOverlay(); staticOverlay.Layers.Add("AustinStreetsShapeLayer", inmlayer); winformsMap1.Overlays.Add(staticOverlay); inmlayer.Open(); winformsMap1.CurrentExtent = inmlayer.GetBoundingBox(); inmlayer.Close(); Timer timer = new Timer(); timer.Interval = 1000; timer.Tick += new EventHandler(timer_Tick); timer.Start(); } InMemoryFeatureLayer inmlayer; bool flag; void timer_Tick(object sender, EventArgs e) { inmlayer.InternalFeatures.Clear(); if (flag) { inmlayer.InternalFeatures.Add(new Feature("LINESTRING(0 0,10 10)")); inmlayer.InternalFeatures.Add(new Feature(-20, -20)); inmlayer.InternalFeatures.Add(new Feature("POLYGON ((30 10, 10 20, 20 40, 40 40, 30 10))")); flag = false; } else { inmlayer.InternalFeatures.Add(new Feature("LINESTRING(18 64,74 22)")); inmlayer.InternalFeatures.Add(new Feature(-40, -20)); inmlayer.InternalFeatures.Add(new Feature("POLYGON ((10 10, 10 20, 20 40, 40 40, 10 10))")); flag = true; } winformsMap1.Refresh(); }