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 = System.Drawing.Drawing2D.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 = System.Drawing.Drawing2D.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 = System.Drawing.Drawing2D.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 void cmbStrokeType_SelectedIndexChanged(object sender, EventArgs e) { if (_ignoreChanges) return; int index = ccStrokes.Strokes.IndexOf(ccStrokes.SelectedStroke); if (index == -1) return; string strokeType = cmbStrokeType.SelectedItem.ToString(); if (strokeType == "Cartographic") { ICartographicStroke cs = new CartographicStroke(); ccStrokes.Strokes[index] = cs; ccStrokes.RefreshList(); ccStrokes.SelectedStroke = cs; //UpdateStrokeControls(); } else if (strokeType == "Simple") { ISimpleStroke ss = new SimpleStroke(); ccStrokes.Strokes[index] = ss; ccStrokes.RefreshList(); ccStrokes.SelectedStroke = ss; // UpdateStrokeControls(); } //UpdatePreview(); }