Ejemplo n.º 1
0
        /// <summary>
        /// Adds a line to this layer.
        /// </summary>
        /// <param name="dot"></param>
        /// <returns></returns>
        public ElementLine AddLine(ElementDot first, GeoCoordinate dot, bool create_dot)
        {
            // add new dot.
            if (create_dot)
            {
                this.AddDot(dot);
            }

            // create polyline.
            List<GeoCoordinate> coordinates = new List<GeoCoordinate>();
            coordinates.Add(first.Dot.Point);
            coordinates.Add(dot);
            ShapePolyLineF<GeoCoordinate, GeoCoordinateBox, GeoCoordinateLine> line
                = new ShapePolyLineF<GeoCoordinate, GeoCoordinateBox, GeoCoordinateLine>(
                    PrimitiveGeoFactory.Instance,
                    coordinates.ToArray());

            // create the line element.
            ElementLine element = new ElementLine(
                line,
                Color.Black.ToArgb(),
                0.0002f,
                true);

            lock (_elements)
            {
                _elements.Add(element);
            }

            return element;
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Adds a line to this layer.
 /// </summary>
 /// <param name="dot"></param>
 /// <returns></returns>
 public ElementLine AddLine(ElementDot first, GeoCoordinate dot, bool create_dot)
 {
     throw new NotSupportedException();
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Adds a dot to this layer.
        /// </summary>
        /// <param name="dot"></param>
        /// <returns></returns>
        public ElementDot AddDot(GeoCoordinate dot)
        {
            ElementDot element = new ElementDot(
                Color.Black.ToArgb(),
                0.0002f,
                new OsmSharp.Tools.Math.Shapes.ShapeDotF<GeoCoordinate, GeoCoordinateBox, GeoCoordinateLine>(PrimitiveGeoFactory.Instance, dot),
                false);

            lock (_elements)
            {
                _elements.Add(element);
            }
            return element;
        }