/// <summary> /// Creates a new Custom Line symbolizer with the specified properties /// </summary> /// <param name="uniqueName">the unique name</param> /// <param name="name">the name of the custom symbolizer</param> /// <param name="category">the map category of the custom symbolizer</param> /// <param name="symbolizer">the associated line symbolizer</param> public CustomLineSymbolizer(string uniqueName, string name, string category, LineSymbolizer symbolizer) { UniqueName = uniqueName; Name = name; Category = category; base.Symbolizer = symbolizer; }
private void CreateMap() { String BasePath = Server.MapPath(@"~\Shape"); WebMap1.Projection = KnownCoordinateSystems.Projected.World.WebMercator; WebMap1.MapViewExtents = new Extent(-20037508.342789, -20037508.342789, 20037508.342789, 20037508.342789); WebMapClient client = new WebMapClient(); WMTClient WMT1 = new WMTClient(); WMT1.Create(WebServiceType.BingHybrid); string WMSServerWMS0 = "http://maps.ngdc.noaa.gov/soap/web_mercator/nos_hydro/MapServer/WMSServer"; WMSClient WMS0 = new WMSClient(); WMS0.ReadCapabilities(WMSServerWMS0); WMS0.CRS = "EPSG:3857"; WMS0.Projection = KnownCoordinateSystems.Projected.World.WebMercator; string WMSServerWMS1 = "http://maps.ngdc.noaa.gov/soap/web_mercator/graticule/MapServer/WMSServer"; WMSClient WMS1 = new WMSClient(); WMS1.ReadCapabilities(WMSServerWMS1); WMS1.CRS = "EPSG:3857"; WMS1.Projection = KnownCoordinateSystems.Projected.World.WebMercator; client.AddService(WMT1); client.AddService(WMS0); client.AddService(WMS1); WebMap1.Back = client; IMapFeatureLayer CountriesLayer = (IMapFeatureLayer)WebMap1.AddLayer(BasePath + @"\10m_admin_0_countries.shp"); PolygonSymbolizer SymbCountries = new PolygonSymbolizer(Color.FromArgb(0, 191, 0)); SymbCountries.SetFillColor(Color.Transparent); SymbCountries.OutlineSymbolizer = new LineSymbolizer(Color.Magenta, 1); CountriesLayer.Symbolizer = SymbCountries; IMapFeatureLayer Graticules30Layer = (IMapFeatureLayer)WebMap1.AddLayer(BasePath + @"\10m_graticules_30.shp"); LineSymbolizer SymbGratitules30 = new LineSymbolizer(Color.Red, 1); Graticules30Layer.Symbolizer = SymbGratitules30; Graticules30Layer.IsVisible = false; }
/// <summary> /// Creates a new PicturePattern with the specified image /// </summary> /// <param name="picture">The picture to draw</param> /// <param name="wrap">The way to wrap the picture</param> /// <param name="angle">The angle to rotate the image</param> /// <param name="outlineColor">The color to use for the border symbolizer</param> /// <param name="outlineWidth">The width of the line to use for the border symbolizer</param> public PolygonSymbolizer(Image picture, WrapMode wrap, double angle, Color outlineColor, double outlineWidth) { _patterns = new CopyList<IPattern>(); _patterns.Add(new PicturePattern(picture, wrap, angle)); OutlineSymbolizer = new LineSymbolizer(outlineColor, outlineWidth); }
public ILineSymbolizer ToLineSymbolizer() { SimpleStroke stBase = new SimpleStroke(this.LineSize,this.Color.ToDrawingColor()); SimpleStroke stBorder = new SimpleStroke(this.LineSize+this.LineBorderSize , this._lineBorderColor .ToDrawingColor()); LineSymbolizer line = new LineSymbolizer(new SimpleStroke[] { stBorder,stBase }); return line; }
/// <summary> /// Creates a new line category with the specified color and width /// </summary> /// <param name="color">The color of the unselected line</param> /// <param name="width">The width of both the selected and unselected lines.</param> public LineCategory(Color color, double width) { Symbolizer = new LineSymbolizer(color, width); SelectionSymbolizer = new LineSymbolizer(Color.Cyan, width); }
/// <summary> /// Creates a new instance of PointSchemeCategory /// </summary> public LineCategory() { Symbolizer = new LineSymbolizer(); SelectionSymbolizer = new LineSymbolizer(true); }
/// <summary> /// Creates a new instance of a solid colored polygon symbolizer /// </summary> /// <param name="fillColor">The fill color to use for the polygons</param> /// <param name="outlineColor">The border color to use for the polygons</param> /// <param name="outlineWidth">The width of the outline to use fo</param> public PolygonSymbolizer(Color fillColor, Color outlineColor, double outlineWidth) { _patterns = new CopyList <IPattern>(); _patterns.Add(new SimplePattern(fillColor)); OutlineSymbolizer = new LineSymbolizer(outlineColor, outlineWidth); }
/// <summary> /// Deserializes the layer. /// </summary> /// <param name="layer">The layer.</param> /// <param name="lineLayer">The line layer.</param> internal static void DeserializeLayer(dynamic layer, MapLineLayer lineLayer) { if (UseAlternateParser(layer)) { // TODO: write alternate parser for this layer information. return; } var lineSymbolizer = new LineSymbolizer(); lineSymbolizer.SetWidth(Convert.ToDouble(layer.ShapeFileProperties["LineOrPointSize"])); lineLayer.Symbolizer = lineSymbolizer; }
/// <summary> /// Creates a new instance of a Gradient Pattern using the specified colors and angle /// </summary> /// <param name="startColor">The start color</param> /// <param name="endColor">The end color</param> /// <param name="angle">The direction of the gradient, measured in degrees clockwise from the x-axis</param> /// <param name="style">The type of gradient to use</param> /// <param name="outlineColor">The color to use for the border symbolizer</param> /// <param name="outlineWidth">The width of the line to use for the border symbolizer</param> public PolygonSymbolizer(Color startColor, Color endColor, double angle, GradientType style, Color outlineColor, double outlineWidth) { _patterns = new CopyList<IPattern>(); _patterns.Add(new GradientPattern(startColor, endColor, angle, style)); OutlineSymbolizer = new LineSymbolizer(outlineColor, outlineWidth); }
private static List <CustomLineSymbolizer> GetLineSymbols() { List <CustomLineSymbolizer> lst = new List <CustomLineSymbolizer>(); LineSymbolizer sym1 = new LineSymbolizer(); sym1.Strokes.Clear(); SimpleStroke stroke11 = new SimpleStroke(Color.DarkGray); sym1.Strokes.Add(stroke11); CustomLineSymbolizer cust1 = new CustomLineSymbolizer(); cust1.Symbolizer = sym1; cust1.UniqueName = "line_0001"; cust1.Name = "simple line"; cust1.Category = "Transportation"; lst.Add(cust1); LineSymbolizer sym2 = new LineSymbolizer(); sym2.Strokes.Clear(); SimpleStroke stroke1 = new SimpleStroke(2.5, Color.Brown); sym2.Strokes.Add(stroke1); SimpleStroke stroke0 = new SimpleStroke(1.0, Color.Yellow); sym2.Strokes.Add(stroke0); CustomLineSymbolizer cust2 = new CustomLineSymbolizer(); cust2.Symbolizer = sym2; cust2.UniqueName = "line_0002"; cust2.Name = "Road"; cust2.Category = "Transportation"; lst.Add(cust2); LineSymbolizer sym3 = new LineSymbolizer(); sym3.Strokes.Clear(); CartographicStroke stroke3 = new CartographicStroke(Color.Brown); stroke3.DashStyle = DashStyle.Dash; sym3.Strokes.Add(stroke3); CustomLineSymbolizer cust3 = new CustomLineSymbolizer(); cust3.Symbolizer = sym3; cust3.UniqueName = "line_0003"; cust3.Category = "Transportation"; cust3.Name = "Path"; lst.Add(cust3); LineSymbolizer sym4 = new LineSymbolizer(); sym4.Strokes.Clear(); SimpleStroke stroke41 = new SimpleStroke(4.5, Color.Gray); SimpleStroke stroke42 = new SimpleStroke(2.5, Color.Yellow); SimpleStroke stroke43 = new SimpleStroke(0.5, Color.Gray); sym4.Strokes.Add(stroke41); sym4.Strokes.Add(stroke42); sym4.Strokes.Add(stroke43); CustomLineSymbolizer cust4 = new CustomLineSymbolizer(); cust4.Symbolizer = sym4; cust4.UniqueName = "line_0004"; cust4.Category = "Transportation"; cust4.Name = "Highway"; lst.Add(cust4); LineSymbolizer sym5 = new LineSymbolizer(); sym5.Strokes.Clear(); CartographicStroke stroke51 = new CartographicStroke(Color.Gray); CartographicStroke stroke52 = new CartographicStroke(Color.LightPink); stroke52.Width = 4.0; stroke52.Offset = 2.5f; stroke52.DashStyle = DashStyle.DashDotDot; sym5.Strokes.Add(stroke51); sym5.Strokes.Add(stroke52); CustomLineSymbolizer cust5 = new CustomLineSymbolizer(); cust5.Symbolizer = sym5; cust5.UniqueName = "line_0005"; cust5.Category = "Boundaries"; cust5.Name = "Boundary 1"; lst.Add(cust5); LineSymbolizer sym6 = new LineSymbolizer(); sym6.Strokes.Clear(); SimpleStroke stroke53 = new SimpleStroke(Color.DarkBlue); SimpleStroke stroke54 = new SimpleStroke(Color.LightBlue); stroke53.Width = 3; sym6.Strokes.Add(stroke53); sym6.Strokes.Add(stroke54); CustomLineSymbolizer cust6 = new CustomLineSymbolizer(); cust6.Symbolizer = sym6; cust6.UniqueName = "line_0006"; cust6.Category = "Rivers"; cust6.Name = "River"; lst.Add(cust6); return(lst); }
/// <summary> /// Creates a new CustomSymbolizer for symbolizing lines /// </summary> public CustomLineSymbolizer() { Symbolizer = new LineSymbolizer(); }
private static List<CustomLineSymbolizer> GetLineSymbols() { List<CustomLineSymbolizer> lst = new List<CustomLineSymbolizer>(); LineSymbolizer sym1 = new LineSymbolizer(); sym1.Strokes.Clear(); SimpleStroke stroke11 = new SimpleStroke(Color.DarkGray); sym1.Strokes.Add(stroke11); CustomLineSymbolizer cust1 = new CustomLineSymbolizer(); cust1.Symbolizer = sym1; cust1.UniqueName = "line_0001"; cust1.Name = "simple line"; cust1.Category = "Transportation"; lst.Add(cust1); LineSymbolizer sym2 = new LineSymbolizer(); sym2.Strokes.Clear(); SimpleStroke stroke1 = new SimpleStroke(2.5, Color.Brown); sym2.Strokes.Add(stroke1); SimpleStroke stroke0 = new SimpleStroke(1.0, Color.Yellow); sym2.Strokes.Add(stroke0); CustomLineSymbolizer cust2 = new CustomLineSymbolizer(); cust2.Symbolizer = sym2; cust2.UniqueName = "line_0002"; cust2.Name = "Road"; cust2.Category = "Transportation"; lst.Add(cust2); LineSymbolizer sym3 = new LineSymbolizer(); sym3.Strokes.Clear(); CartographicStroke stroke3 = new CartographicStroke(Color.Brown); stroke3.DashStyle = DashStyle.Dash; sym3.Strokes.Add(stroke3); CustomLineSymbolizer cust3 = new CustomLineSymbolizer(); cust3.Symbolizer = sym3; cust3.UniqueName = "line_0003"; cust3.Category = "Transportation"; cust3.Name = "Path"; lst.Add(cust3); LineSymbolizer sym4 = new LineSymbolizer(); sym4.Strokes.Clear(); SimpleStroke stroke41 = new SimpleStroke(4.5, Color.Gray); SimpleStroke stroke42 = new SimpleStroke(2.5, Color.Yellow); SimpleStroke stroke43 = new SimpleStroke(0.5, Color.Gray); sym4.Strokes.Add(stroke41); sym4.Strokes.Add(stroke42); sym4.Strokes.Add(stroke43); CustomLineSymbolizer cust4 = new CustomLineSymbolizer(); cust4.Symbolizer = sym4; cust4.UniqueName = "line_0004"; cust4.Category = "Transportation"; cust4.Name = "Highway"; lst.Add(cust4); LineSymbolizer sym5 = new LineSymbolizer(); sym5.Strokes.Clear(); CartographicStroke stroke51 = new CartographicStroke(Color.Gray); CartographicStroke stroke52 = new CartographicStroke(Color.LightPink); stroke52.Width = 4.0; stroke52.Offset = 2.5f; stroke52.DashStyle = DashStyle.DashDotDot; sym5.Strokes.Add(stroke51); sym5.Strokes.Add(stroke52); CustomLineSymbolizer cust5 = new CustomLineSymbolizer(); cust5.Symbolizer = sym5; cust5.UniqueName = "line_0005"; cust5.Category = "Boundaries"; cust5.Name = "Boundary 1"; lst.Add(cust5); LineSymbolizer sym6 = new LineSymbolizer(); sym6.Strokes.Clear(); SimpleStroke stroke53 = new SimpleStroke(Color.DarkBlue); SimpleStroke stroke54 = new SimpleStroke(Color.LightBlue); stroke53.Width = 3; sym6.Strokes.Add(stroke53); sym6.Strokes.Add(stroke54); CustomLineSymbolizer cust6 = new CustomLineSymbolizer(); cust6.Symbolizer = sym6; cust6.UniqueName = "line_0006"; cust6.Category = "Rivers"; cust6.Name = "River"; lst.Add(cust6); return lst; }
private static List<CustomSymbolizer> getBasicLineSymbols() { List<CustomSymbolizer> lst = new List<CustomSymbolizer>(); LineSymbolizer sym1 = new LineSymbolizer(); CustomLineSymbolizer cust1 = new CustomLineSymbolizer(); cust1.Symbolizer = sym1; cust1.UniqueName = "line_0001"; cust1.Category = "default"; lst.Add(cust1); LineSymbolizer sym2 = new LineSymbolizer(); sym2.Strokes.Clear(); SimpleStroke stroke1 = new SimpleStroke(2.5, Color.Brown); sym2.Strokes.Add(stroke1); SimpleStroke stroke0 = new SimpleStroke(1.0, Color.Yellow); sym2.Strokes.Add(stroke0); CustomLineSymbolizer cust2 = new CustomLineSymbolizer(); cust2.Symbolizer = sym2; cust2.UniqueName = "line_0002"; cust2.Category = "default"; lst.Add(cust2); LineSymbolizer sym3 = new LineSymbolizer(); sym3.Strokes.Clear(); CartographicStroke stroke3 = new CartographicStroke(Color.Brown); stroke3.DashStyle = DashStyle.Dash; sym3.Strokes.Add(stroke3); CustomLineSymbolizer cust3 = new CustomLineSymbolizer(); cust3.Symbolizer = sym3; cust3.UniqueName = "line_0003"; cust3.Category = "travel"; cust3.Name = "path"; lst.Add(cust3); return lst; }
private static List <CustomLineSymbolizer> GetLineSymbols() { List <CustomLineSymbolizer> lst = new List <CustomLineSymbolizer>(); LineSymbolizer sym1 = new LineSymbolizer(); sym1.Strokes.Clear(); SimpleStroke stroke11 = new SimpleStroke(Color.DarkGray); sym1.Strokes.Add(stroke11); CustomLineSymbolizer cust1 = new CustomLineSymbolizer { Symbolizer = sym1, UniqueName = "line_0001", Name = "simple line", Category = "Transportation" }; lst.Add(cust1); LineSymbolizer sym2 = new LineSymbolizer(); sym2.Strokes.Clear(); SimpleStroke stroke1 = new SimpleStroke(2.5, Color.Brown); sym2.Strokes.Add(stroke1); SimpleStroke stroke0 = new SimpleStroke(1.0, Color.Yellow); sym2.Strokes.Add(stroke0); CustomLineSymbolizer cust2 = new CustomLineSymbolizer { Symbolizer = sym2, UniqueName = "line_0002", Name = "Road", Category = "Transportation" }; lst.Add(cust2); LineSymbolizer sym3 = new LineSymbolizer(); sym3.Strokes.Clear(); CartographicStroke stroke3 = new CartographicStroke(Color.Brown) { DashStyle = DashStyle.Dash }; sym3.Strokes.Add(stroke3); CustomLineSymbolizer cust3 = new CustomLineSymbolizer { Symbolizer = sym3, UniqueName = "line_0003", Category = "Transportation", Name = "Path" }; lst.Add(cust3); LineSymbolizer sym4 = new LineSymbolizer(); sym4.Strokes.Clear(); SimpleStroke stroke41 = new SimpleStroke(4.5, Color.Gray); SimpleStroke stroke42 = new SimpleStroke(2.5, Color.Yellow); SimpleStroke stroke43 = new SimpleStroke(0.5, Color.Gray); sym4.Strokes.Add(stroke41); sym4.Strokes.Add(stroke42); sym4.Strokes.Add(stroke43); CustomLineSymbolizer cust4 = new CustomLineSymbolizer { Symbolizer = sym4, UniqueName = "line_0004", Category = "Transportation", Name = "Highway" }; lst.Add(cust4); LineSymbolizer sym5 = new LineSymbolizer(); sym5.Strokes.Clear(); CartographicStroke stroke51 = new CartographicStroke(Color.Gray); CartographicStroke stroke52 = new CartographicStroke(Color.LightPink) { Width = 4.0, Offset = 2.5f, DashStyle = DashStyle.DashDotDot }; sym5.Strokes.Add(stroke51); sym5.Strokes.Add(stroke52); CustomLineSymbolizer cust5 = new CustomLineSymbolizer { Symbolizer = sym5, UniqueName = "line_0005", Category = "Boundaries", Name = "Boundary 1" }; lst.Add(cust5); LineSymbolizer sym6 = new LineSymbolizer(); sym6.Strokes.Clear(); SimpleStroke stroke53 = new SimpleStroke(Color.DarkBlue); SimpleStroke stroke54 = new SimpleStroke(Color.LightBlue); stroke53.Width = 3; sym6.Strokes.Add(stroke53); sym6.Strokes.Add(stroke54); CustomLineSymbolizer cust6 = new CustomLineSymbolizer { Symbolizer = sym6, UniqueName = "line_0006", Category = "Rivers", Name = "River" }; lst.Add(cust6); return(lst); }
/// <summary> /// Creates a new instance of PolygonSymbolizer /// </summary> /// <param name="selected">Boolean, true if this should use selection symbology</param> public PolygonSymbolizer(bool selected) { _patterns = new CopyList<IPattern>(); if (selected) { _patterns.Add(new SimplePattern(Color.Cyan)); OutlineSymbolizer = new LineSymbolizer(Color.DarkCyan, 1); } else { _patterns.Add(new SimplePattern()); } }
/// <summary> /// Initializes a new instance of the <see cref="PolygonSymbolizer"/> class using PicturePattern with the specified image. /// </summary> /// <param name="picture">The picture to draw.</param> /// <param name="wrap">The way to wrap the picture.</param> /// <param name="angle">The angle to rotate the image.</param> /// <param name="outlineColor">The color to use for the border symbolizer.</param> /// <param name="outlineWidth">The width of the line to use for the border symbolizer.</param> public PolygonSymbolizer(Image picture, WrapMode wrap, double angle, Color outlineColor, double outlineWidth) : this(picture, wrap, angle) { OutlineSymbolizer = new LineSymbolizer(outlineColor, outlineWidth); }
/// <summary> /// Creates a new instance of a solid colored polygon symbolizer /// </summary> /// <param name="fillColor">The fill color to use for the polygons</param> /// <param name="outlineColor">The border color to use for the polygons</param> /// <param name="outlineWidth">The width of the outline to use fo</param> public PolygonSymbolizer(Color fillColor, Color outlineColor, double outlineWidth) { _patterns = new CopyList<IPattern>(); _patterns.Add(new SimplePattern(fillColor)); OutlineSymbolizer = new LineSymbolizer(outlineColor, outlineWidth); }
/// <summary> /// Initializes a new instance of the <see cref="PolygonSymbolizer"/> class using a Gradient Pattern with the specified colors and angle. /// </summary> /// <param name="startColor">The start color.</param> /// <param name="endColor">The end color.</param> /// <param name="angle">The direction of the gradient, measured in degrees clockwise from the x-axis.</param> /// <param name="style">The type of gradient to use.</param> /// <param name="outlineColor">The color to use for the border symbolizer.</param> /// <param name="outlineWidth">The width of the line to use for the border symbolizer.</param> public PolygonSymbolizer(Color startColor, Color endColor, double angle, GradientType style, Color outlineColor, double outlineWidth) : this(startColor, endColor, angle, style) { OutlineSymbolizer = new LineSymbolizer(outlineColor, outlineWidth); }
/// <summary> /// Creates a new PicturePattern with the specified image /// </summary> /// <param name="picture">The picture to draw</param> /// <param name="wrap">The way to wrap the picture</param> /// <param name="angle">The angle to rotate the image</param> /// <param name="outlineColor">The color to use for the border symbolizer</param> /// <param name="outlineWidth">The width of the line to use for the border symbolizer</param> public PolygonSymbolizer(Image picture, WrapMode wrap, double angle, Color outlineColor, double outlineWidth) { _patterns = new CopyList <IPattern>(); _patterns.Add(new PicturePattern(picture, wrap, angle)); OutlineSymbolizer = new LineSymbolizer(outlineColor, outlineWidth); }
/// <summary> /// Creates a new set of cartographic lines that together form a line with a border. Since a compound /// pen is used, it is possible to use this to create a transparent line with just two border parts. /// The selection symbolizer will be dark cyan bordering light cyan, but use the same dash and cap /// patterns. /// </summary> /// <param name="fillColor">The fill color for the line</param> /// <param name="borderColor">The border color of the line</param> /// <param name="width">The width of the entire line</param> /// <param name="dash">The dash pattern to use</param> /// <param name="caps">The style of the start and end caps</param> public LineCategory(Color fillColor, Color borderColor, double width, DashStyle dash, LineCap caps) { Symbolizer = new LineSymbolizer(fillColor, borderColor, width, dash, caps); SelectionSymbolizer = new LineSymbolizer(Color.Cyan, Color.DarkCyan, width, dash, caps); }
/// <summary> /// Creates a new instance of a Gradient Pattern using the specified colors and angle /// </summary> /// <param name="startColor">The start color</param> /// <param name="endColor">The end color</param> /// <param name="angle">The direction of the gradient, measured in degrees clockwise from the x-axis</param> /// <param name="style">The type of gradient to use</param> /// <param name="outlineColor">The color to use for the border symbolizer</param> /// <param name="outlineWidth">The width of the line to use for the border symbolizer</param> public PolygonSymbolizer(Color startColor, Color endColor, double angle, GradientType style, Color outlineColor, double outlineWidth) { _patterns = new CopyList <IPattern>(); _patterns.Add(new GradientPattern(startColor, endColor, angle, style)); OutlineSymbolizer = new LineSymbolizer(outlineColor, outlineWidth); }
/// <summary> /// Creates a new instanec of a default point scheme category where the geographic symbol size has been /// scaled to the specified extent. /// </summary> /// <param name="extent">The geographic extent that is 100 times wider than the geographic size of the points.</param> public LineCategory(IEnvelope extent) { Symbolizer = new LineSymbolizer(extent, false); SelectionSymbolizer = new LineSymbolizer(extent, true); }
/// <summary> /// Creates a new instanec of a default point scheme category where the geographic symbol size has been /// scaled to the specified extent. /// </summary> /// <param name="extent">The geographic extent that is 100 times wider than the geographic size of the points.</param> public LineCategory(Envelope extent) { Symbolizer = new LineSymbolizer(extent, false); SelectionSymbolizer = new LineSymbolizer(extent, true); }
/// <summary> /// Creates the category using a random fill color /// </summary> /// <param name="fillColor">The base color to use for creating the category</param> /// <param name="size">Creates the size</param> /// <returns>A new polygon category</returns> public override ICategory CreateNewCategory(Color fillColor, double size) { ILineSymbolizer ls = EditorSettings.TemplateSymbolizer.Copy() as ILineSymbolizer; if (ls != null) { ls.SetFillColor(fillColor); ls.SetWidth(size); } else { ls = new LineSymbolizer(fillColor, size); } return new LineCategory(ls); }