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