Skip to main content

How to: Load Data from a SVG File

To load SVG file content to the Map Control, create a new SvgFileDataAdapter and assign it to the VectorItemsLayer.Data property. Then, specify the SvgFileDataAdapter.FileUri property of the adapter.

View Example

private void Form1_Load(object sender, EventArgs e) {
    Uri baseUri = new Uri(System.Reflection.Assembly.GetExecutingAssembly().Location);
    map.Layers.Add(new VectorItemsLayer {
        Data = new SvgFileDataAdapter {
            FileUri = new Uri(baseUri, "..\\..\\Data\\countries.svg")
        }
    });
}