Skip to main content
All docs
V25.1
  • DevExpress v25.1 Update — Your Feedback Matters

    Our What's New in v25.1 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

    VectorTileDataProviderBase.StyleFileUri Property

    SECURITY NOTE

    Downloading files passed through URLs specified by the StyleFileUri property may create security issues. Review the following help topic and learn how to spot, analyze, and prohibit unwanted download requests:

    Suppress Control Requests to Download Data from External URLs

    Gets or sets a style used to customize the vector tile map’s appearance.

    Namespace: DevExpress.Xpf.Map

    Assembly: DevExpress.Xpf.Map.v25.1.dll

    NuGet Package: DevExpress.Wpf.Map

    #Declaration

    public Uri StyleFileUri { get; set; }

    #Property Value

    Type Description
    Uri

    A Uri object that specifies the style file’s location.

    #Remarks

    Use the StyleFileUri property to apply a custom style to vector tiles. Styles apply on a client’s side before rendering the map.

    A style must be a valid JSON file. The Map Control supports layers and their properties:

    • filter
    • paint
      • fill-color
      • fill-opacity
      • line-color
      • line-opacity
      • line-width
      • text-color
    • layout
      • visibility
      • text-field
      • text-font
      • text-max-width
      • text-size
      • text-transform

    Property values can be set directly (for example, “text-size”: 10) or via an interpolation syntax (for example, “line-width”: {“base”: 1.2, “stops”: [[15, 1], [17, 4]]}).

    The following color formats are supported: hsl, rgb, rgba, hsla, hex. You can use web color names, such as red or yellow.

    #Apply a Style

    1. The MapControl uses the System.Text.Json library to parse style files. Install the System.Text.Json package if your .NET Framework application does not reference this library. .NET projects do not require manual installation of the System.Text.Json package, as it is already included in the .NET environment. Set the DevExpress.Map.Native.VectorTileStyleParser.ProcessingLibrary property to NewtonsoftJson to use the Newtonsoft.Json library instead.
    2. Use the VectorTileDataProviderBase.StyleFileUri property to define a path to a style file.
    <dxm:MbTilesDataProvider ... StyleFileUri="D:\Styles\basic-style.json"/>
    
    See Also