Load Vector Data from a KML File
This document describes the basics of working with KML files using the Map Control.
This subject has been broken down into the following sections.
Overview
Using the Map control, you can load and depict any set of geographic visualization data (placemarks, polygons, images, textual descriptions, etc.) stored in the KML (Keyhole Markup Language) format. KML files have a tag-based structure with nested elements (similar to the XML standard).
Note
For more information, see the following link: KML Documentation.
One of the common usage scenarios for the KML format is to display vector data above an image tiles map. For instance, the image below shows the Liberty Island shape loaded from a KML file.
Load KML File Data
To load vector data from a KML file, do the following.
- Create a KmlFileDataAdapter object.
- Specify the path to a KML file using the KmlFileDataAdapter.FileUri property.
- Assign the KmlFileDataAdapter to the VectorLayer.Data property.
Examples
The following example demonstrates how to load data from a KML file and visualize it in the map control: How to: Load Data from a KML File.