Skip to content

The Map Suite WPF ApplyDirectionPointStyleForLineStyle sample will guide you to draw lineStyle's direction Point on map. The direction Point can be an image or a glyph, it not only rotates the icon accross the angle of the road, but also provides a way to customize the rotation of the direction point. The arrows highlighted in the red circle in …

Notifications You must be signed in to change notification settings

ThinkGeo/ApplyDirectionPointStyleForLineStyle-ForWpf

Repository files navigation

Apply DirectionPointStyle for LineStyle for Wpf

Description

The Map Suite WPF ApplyDirectionPointStyleForLineStyle sample will guide you to draw lineStyle's direction Point on map. The direction Point can be an image or a glyph, it not only rotates the icon accross the angle of the road, but also provides a way to customize the rotation of the direction point. The arrows highlighted in the red circle in the following screenshot are customized based on the line's attributes. Please check out the source for detail. This sample supports Map Suite 10.5.8 and higher.

Please refer to Wiki for the details.

Screenshot

About the Code

// Set up the line style with white inner pen and black center pen. 
var lineStyle = new LineStyle(new GeoPen(GeoColors.Black, 16) { StartCap = DrawingLineCap.Round, EndCap = DrawingLineCap.Round }, new GeoPen(GeoColors.White, 13) { StartCap = DrawingLineCap.Round, EndCap = DrawingLineCap.Round });
// Set up the required column name for the style. We will customize the line style based on this column value. 
lineStyle.RequiredColumnNames.Add("FENAME");
            
// Set up the style for Direction Point and set up the event for customization. 
lineStyle.DirectionPointStyle = new PointStyle(new GeoImage("AppData\\Arrow.png"));
lineStyle.DrawingDirectionPoint += LineStyle_DrawingPointStyle;
            
private void LineStyle_DrawingPointStyle(object sender, DrawingDirectionPointEventArgs e)
{
    // Customize the direction point for the line feature whose "FENAME" column equals to "Mo-Pac". 
    if (e.Line.ColumnValues["FENAME"] == "Mo-Pac")
    {
        e.RotationAngle = 0;
    }
}

Getting Help

Map Suite Desktop for Wpf Wiki Resources

Map Suite Desktop for Wpf Product Description

ThinkGeo Community Site

ThinkGeo Web Site

About ThinkGeo

ThinkGeo is a GIS (Geographic Information Systems) company founded in 2004 and located in Frisco, TX. Our clients are in more than 40 industries including agriculture, energy, transportation, government, engineering, software development, and defense.

About

The Map Suite WPF ApplyDirectionPointStyleForLineStyle sample will guide you to draw lineStyle's direction Point on map. The direction Point can be an image or a glyph, it not only rotates the icon accross the angle of the road, but also provides a way to customize the rotation of the direction point. The arrows highlighted in the red circle in …

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages