Back to Devexpress

How to: Show Titles for Map Shapes

wpf-12283-controls-and-libraries-map-control-examples-vector-data-customize-data-appearance-how-to-show-titles-for-map-shapes.md

latest3.0 KB
Original Source

How to: Show Titles for Map Shapes

  • Jun 07, 2019

This example demonstrates how to display a title for shapes loaded from Shapefiles ( SouthAmerica.dbf , SouthAmerica.shp ).

To accomplish this task, it is necessary to create a ShapeTitleOptions object and assign it to the VectorLayer.ShapeTitleOptions property. Then, set the ShapeTitleOptions.VisibilityMode property to Visible to see titles for all loaded shapes on a map.

xaml
<Window x:Class="VectorLayerTitleOptions.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:dxm="http://schemas.devexpress.com/winfx/2008/xaml/map"
        Title="MainWindow" Height="350" Width="525" >
    <Grid>
        <dxm:MapControl>
            <dxm:VectorLayer >
                <dxm:VectorLayer.ShapeTitleOptions>
                    <dxm:ShapeTitleOptions Visible="True"/>
                </dxm:VectorLayer.ShapeTitleOptions>
                    <dxm:ShapefileDataAdapter FileUri="/VectorLayerTitleOptions;component/Shapefile/SouthAmerica.shp">
                    </dxm:ShapefileDataAdapter>
            </dxm:VectorLayer>
        </dxm:MapControl>
    </Grid>
</Window>

See Also

How to: Show Tooltips for Map Shapes

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

How to: Customize the Appearance of a Vector Element

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