All docs
V21.2
21.2
21.1
20.2
20.1
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

VectorTileDataProviderBase.StyleFileUri Property

Gets or sets

Namespace: DevExpress.Xpf.Map

Assembly: DevExpress.Xpf.Map.v21.2.dll

Declaration

public Uri StyleFileUri { get; set; }

Property Value

Type Description
Uri

A Uri object that identifies a style file.

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.

If a style uses custom fonts (not installed on the client machine), specify a path to a directory that contains fonts (.TTF files) via the provider’s FontFolder property. Otherwise, the default font (Segoe UI) is used.

Apply a Style

  1. The MapControl uses the Newtonsoft.Json library to parse style files. Install the Newtonsoft.Json package if your application does not reference this library.
  2. Use the VectorTileDataProviderBase.StyleFileUri property to define a path to a style file.
<dxm:MbTilesDataProvider ... StyleFileUri="D:\Styles\basic-style.json"/>
See Also