Back to Devexpress

How to: Customize the Appearance of a Vector Element

wpf-12265-controls-and-libraries-map-control-examples-vector-data-customize-data-appearance-how-to-customize-the-appearance-of-a-vector-element.md

latest3.7 KB
Original Source

How to: Customize the Appearance of a Vector Element

  • Jun 07, 2019

This example shows how to customize the visual representation of a map shape element (MapRectangle).

To change the appearance of a map shape (MapRectangle), use the corresponding appearance properties of the MapShape class (e.g., MapShapeBase.Fill, MapShapeBase.HighlightFill, MapShapeBase.StrokeStyle).

xaml
<Window x:Class="MapShapeAppearance.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525" 
        xmlns:dxm="http://schemas.devexpress.com/winfx/2008/xaml/map">
    <Grid>
        <dxm:MapControl>
            <dxm:ImageTilesLayer>
                <dxm:ImageTilesLayer.DataProvider>
                    <dxm:OpenStreetMapDataProvider/>
                </dxm:ImageTilesLayer.DataProvider>
            </dxm:ImageTilesLayer>
            <dxm:VectorLayer>
                <!--region #ShapeCustomization-->
                <dxm:MapItemStorage>
                    <dxm:MapRectangle Width="700" Height="700" Location="54,90" 
                                        RadiusX="7" RadiusY="7" Fill="Red" HighlightFill="Orange">
                        <dxm:MapRectangle.HighlightStrokeStyle>
                            <dxm:StrokeStyle Thickness="2" />
                        </dxm:MapRectangle.HighlightStrokeStyle>
                        <dxm:MapRectangle.StrokeStyle>
                            <dxm:StrokeStyle Thickness="2" DashCap="Round" LineJoin="Round" />
                        </dxm:MapRectangle.StrokeStyle>
                    </dxm:MapRectangle>
                </dxm:MapItemStorage>
                <!--endregion #ShapeCustomization-->
            </dxm:VectorLayer>
        </dxm:MapControl>
    </Grid>
</Window>

See Also

How to: Show Titles for Map Shapes

How to: Show Tooltips for Map Shapes

How to: Create a Map Item Attribute and Show its Value in the Map Tooltip

How to: Show a Title for a Vector Element

How to: Customize the Appearance of a Vector Element's Title

How to: Customize the Appearance of a Map Pushpin

How to: Customize Animation of a Map Pushpin

How to: Provide Cylindrical Equal-Area Projections