Skip to main content

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

How to: Show Titles for Map Shapes

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.

<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