Shapes Styling
The ShapefileLayer exposes ShapeStyle/SelectedShapeStyle as well as a ShapeStyleSelector properties that will help achieve the desired look & feel of the shapes on the map.
Shapes Styles
ShapeStyle and SelectedShapeStyle properties are of type MapShapeStyle which provides the following styling options for the shapes:
- StrokeWidth;
- StrokeColor;
- FillColor.
The snippet below shows how ShapeStyle property can be applied:
Here is the result:
where the Source and the DataSource of the MapShapeReader should be set to a .shp and .dbf files, respectively:
Shapes StyleSelector
Through the ShapeStyleSelector property of the ShapefileLayer you could implement conditional styling.
The example below shows how to apply different styles to shapes according to certain property value of each shape.
First, create the selector class that should inherit from MapShapeStyleSelector:
Then, define the selector with the Styles as a resource inside a ResourceDictionary:
Lastly, add the definition of the RadMap control with the PopulationShapeStyleSelector applied;
Check the result in the screenshot below:
Sample Shapes Styling examples can be found in the Map/Features folder of the SDK Samples Browser application.