SuperMap.Connector.Control.Forms.MapControl.AddLine C# (CSharp) Method

AddLine() private method

private AddLine ( GraphicsLayer graphicsLayer, GMapOverlay overlay, IList items ) : void
graphicsLayer GraphicsLayer
overlay GMapOverlay
items IList
return void
        private void AddLine(GraphicsLayer graphicsLayer, GMapOverlay overlay, IList<Line> items)
        {
            if (graphicsLayer == null || overlay == null) return;
            if (items == null && items.Count <= 0) return;
            if (!_lineMapGMapRoute.ContainsKey(graphicsLayer.ID))
            {
                _lineMapGMapRoute.Add(graphicsLayer.ID, new Dictionary<string, LineMapGMapRoute>());
            }
            foreach (Line lineItem in items)
            {
                if (lineItem != null)
                {
                    if (_lineMapGMapRoute[graphicsLayer.ID].ContainsKey(lineItem.ID))
                    {
                        graphicsLayer.Lines.Remove(lineItem);
                    }
                    GMapRoute route = new GMapRoute(Helper.Point2Ds2PointLatLngs(lineItem.Point2Ds), lineItem.ID);
                    route.IsHitTestVisible = true;
                    route.IsVisible = true;
                    route.Stroke = new Pen(lineItem.StrokeColor, (float)lineItem.StrokeWeight);
                    overlay.Routes.Add(route);
                    _lineMapGMapRoute[graphicsLayer.ID].Add(lineItem.ID, new LineMapGMapRoute(lineItem, route));
                }
            }
        }