Skip to main content

How to: Load Data from a KML File

This example demonstrates how to load a route line with multiple pushpins from a KML file and display these data on a map control.

To do this, create a KmlFileLoader object and assign it to the VectorLayer.ShapeLoader property. Then, specify the path to a KML file using the KmlFileLoader.FileUri property.

Note that if you run this sample as is, you will get a warning message saying that the specified Bing Maps key is invalid. To learn more about Bing Map keys, please refer to the How to: Get a Bing Maps Key tutorial.