How to: Load Data from a KML File
To load data from a KML file, do the following:
- Create a KmlFileDataAdapter object and assign it to the VectorLayer.Data property.
- Specify the MapGeoDataAdapter.FileUri property of the object.
Note
Make sure that the Build Action property of a KML file is set to Resource.
<dxm:MapControl CenterPoint="40.689830, -74.045229" ZoomLevel="16">
<dxm:ImageTilesLayer>
<dxm:ImageTilesLayer.DataProvider>
<dxm:BingMapDataProvider BingKey="YOUR BING KEY HERE"/>
</dxm:ImageTilesLayer.DataProvider>
</dxm:ImageTilesLayer>
<!--region #KmlFileDataAdapter-->
<dxm:VectorLayer>
<dxm:KmlFileDataAdapter FileUri="kmlFile.kml" />
</dxm:VectorLayer>
<!--endregion #KmlFileDataAdapter-->
</dxm:MapControl>
See Also