/// <summary> /// Extracts style information. /// </summary> /// <param name="point"></param> /// <returns></returns> public static Point2DStyle From(Point2D point, int layer) { Point2DStyle newStyle = new Point2DStyle(); newStyle.Color = point.Color; newStyle.MaxZoom = point.MaxZoom; newStyle.MinZoom = point.MinZoom; newStyle.Layer = layer; return newStyle; }
/// <summary> /// Sets style information. /// </summary> /// <param name="point"></param> public void Set(Point2D point) { point.Color = this.Color; point.MaxZoom = this.MaxZoom; point.MinZoom = this.MinZoom; }
/// <summary> /// Adds a new style and returns it's index. /// </summary> /// <param name="point"></param> /// <param name="layer"></param> /// <returns></returns> public ushort AddStyle(Point2D point, int layer) { Point2DStyle newStyle = Point2DStyle.From(point, layer); int indexOf = this.PointStyles.IndexOf(newStyle); if (indexOf < 0) { // the style is not found yet. indexOf = this.PointStyles.Count; this.PointStyles.Add(newStyle); } return (ushort)indexOf; }