Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

MapPolylineBase.StartLineCap Property

Specifies start cap settings.

Namespace: DevExpress.Xpf.Map

Assembly: DevExpress.Xpf.Map.v24.2.dll

NuGet Package: DevExpress.Wpf.Map

#Declaration

public MapLineCap StartLineCap { get; set; }

#Property Value

Type Description
MapLineCap

Contains start cap settings.

#Remarks

#Display the Default Arrow

Use the StartLineCap property to display a shape at the beginning of a MapPolylineBase descendant. The default cap shape is an arrow. Set the Visible property to true to display the arrow:

Map Polyline and Spline Caps

<dxm:VectorLayer x:Name="vectorLayer">
  <dxm:MapItemStorage>
    <dxm:MapPolyline Stroke="Blue">
      <dxm:MapPolyline.StrokeStyle>
        <dxm:StrokeStyle Thickness="2"/>
      </dxm:MapPolyline.StrokeStyle>
      <dxm:MapPolyline.StartLineCap >
        <dxm:MapLineCap Visible="True" />
      </dxm:MapPolyline.StartLineCap>
      <dxm:MapPolyline.Points>
        <dxm:GeoPoint>-6, -4</dxm:GeoPoint>
        <dxm:GeoPoint>-3, -10</dxm:GeoPoint>
        <dxm:GeoPoint>-6, -20</dxm:GeoPoint>
      </dxm:MapPolyline.Points>
      </dxm:MapPolyline>
      <dxm:MapSpline Stroke="Blue">
        <dxm:MapSpline.StartLineCap>
          <dxm:MapLineCap Visible="True" />
        </dxm:MapSpline.StartLineCap>
        <dxm:MapSpline.StrokeStyle>
          <dxm:StrokeStyle Thickness="2"/>
        </dxm:MapSpline.StrokeStyle>
        <dxm:MapSpline.Points>
          <dxm:GeoPoint>-11, -4</dxm:GeoPoint>
          <dxm:GeoPoint>-8, -10</dxm:GeoPoint>
          <dxm:GeoPoint>-11, -20</dxm:GeoPoint>
        </dxm:MapSpline.Points>
      </dxm:MapSpline>
  </dxm:MapItemStorage>
</dxm:VectorLayer>

#Display a Custom Shape

To display a custom shape, set the MapLineCap.Geometry property to the PathGeometry object that defines a cap shape.

Use the MapLineCap.Width and MapLineCap.Length properties to specify dimensions of the default arrow or a custom shape.

The following example defines a custom start cap shape and its dimensions:

<Window.Resources>
  <PathGeometry x:Key="CapShape" Figures="M-0.38,-0.5 L 0.44,-0.05 C 0.44,-0.05 0.5,0 0.44,0.05 
                               L 0.44,0.05 L -0.38,0.5 C -0.38,0.5 -0.44,0.5 -0.41,0.4 L -0.41,0.4 
                               L -0.13,0 L -0.41,-0.4 C -0.41,-0.4 -0.44,-0.475 -0.38,-0.5 Z"/>
</Window.Resources>
<Grid>
  <!--...-->
  <dxm:MapPolyline Stroke="Blue">
    <dxm:MapPolyline.StartLineCap>
      <dxm:MapLineCap Visible="True" Length="18" Width="8" Geometry="{StaticResource CapShape}"/>
    </dxm:MapPolyline.StartLineCap>
    <!--...-->
  </dxm:MapPolyline>
  <dxm:MapSpline Stroke="Blue">
    <dxm:MapSpline.StartLineCap>
      <dxm:MapLineCap Visible="True" Length="10" Width="10" Geometry="{StaticResource CapShape}"/>
    </dxm:MapSpline.StartLineCap>
    <!--...-->
  </dxm:MapSpline>
  <!--...-->
</Grid>

Result:

Map polyline and spline custom caps

See Also